117: #line 137 "latex_weaver.ipk"
118: def prolog(self,kwds):
119:
120:
121: if kwds.has_key('llambda'):
122: self._writeline('\\ocp\\inutf=inutf8')
123: self._writeline('\\inputTranslation\\inutf8')
124: self.omega=1
125: else:
126: self.omega=0
127:
128:
129:
130:
131:
132:
133: documentclass = 'book'
134: if kwds.has_key('documentclass'):
135: documentclass=kwds['documentclass']
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153: docopts = []
154: if kwds.has_key('documentclass_options'):
155: docopts =kwds['documentclass']
156: docoptstr=''
157: if docopts: docoptstr = docopts[0]
158: for opt in range(1,len(docopts)):
159: docoptstr = dosoptstr + ', ' + opt
160: self._writeline('\\documentclass['+docoptstr+']{'+documentclass+'}')
161:
162: if kwds.has_key('heading_level_offset'):
163: self.heading_level_offset = kwds['heading_level_offset']
164:
165:
166: pagestyle = 'headings'
167: if kwds.has_key('pagestyle'):
168: pagestyle=kwds['pagestyle']
169: self._writeline('\\pagestyle{'+pagestyle+'}')
170:
171: pagenumbering= 'arabic'
172: if kwds.has_key('pagenumbering'):
173: pagenumbering=kwds['pagenumbering']
174: self._writeline('\\pagenumbering{'+pagenumbering+'}')
175:
176:
177: page_format_params = [
178: 'topmargin','headheight','headsep','topskip','textheight','footskip',
179: 'oddsidemargin','evensidemargin',
180: 'textwidth']
181: for p in page_format_params:
182: if kwds.has_key(p):
183: param=kwds[p]
184: self._writeline('\\setlength{\\'+p+'}{'+param+'}')
185:
186:
187:
188:
189:
190:
191:
192: baselinestretch= 1
193: if kwds.has_key('baselinestretch'):
194: baselinestretch=kwds['baselinestretch']
195: self._writeline('\\renewcommand{\\baselinestretch}{'+str(baselinestretch)+'}')
196:
197: self._writeline('\\setlength{\\parskip 2mm plus 0.5mm minus 1mm}')
198: self._writeline('\\setlength{\\parindent 0mm}')
199:
200: self._writeline( '\\begin{document}')
201: if kwds.has_key('title'):
202: title=kwds['title']
203: else:
204: title = self.sink.pass_frame.master.filename
205: self._writeline('\\title{'+cvt_text(title)+'}')
206: if kwds.has_key('author'):
207: author =kwds['author']
208: self._writeline('\\author{'+cvt_text(author)+'}')
209:
210: self._writeline( '\\maketitle')
211:
212: def epilog(self):
213: self._writeline('\\end{document}')
214: