Orbiter 2022
Combinatorial Objects
latex_interface.cpp
Go to the documentation of this file.
1/*
2 * latex_interface.cpp
3 *
4 * Created on: Apr 13, 2019
5 * Author: betten
6 */
7
8
9#include "foundations.h"
10
11#include <sstream>
12
13using namespace std;
14
15
16
17namespace orbiter {
18namespace layer1_foundations {
19namespace orbiter_kernel_system {
20
21
23{
24
25}
26
28{
29
30}
31
32void latex_interface::head_easy(std::ostream& ost)
33{
34 head(ost,
35 FALSE /* f_book */,
36 FALSE /* f_title */,
37 "", "",
38 FALSE /*f_toc */,
39 FALSE /* f_landscape */,
40 FALSE /* f_12pt */,
41 FALSE /* f_enlarged_page */,
42 TRUE /* f_pagenumbers */,
43 NULL /* extras_for_preamble */);
44
45}
46
48 std::ostream& ost, const char *extras)
49{
50 head(ost,
51 FALSE /* f_book */,
52 FALSE /* f_title */,
53 "", "",
54 FALSE /*f_toc */,
55 FALSE /* f_landscape */,
56 FALSE /* f_12pt */,
57 FALSE /* f_enlarged_page */,
58 TRUE /* f_pagenumbers */,
59 extras /* extras_for_preamble */);
60
61}
62
64{
65 head(ost, FALSE /* f_book */,
66 FALSE /* f_title */,
67 "", "",
68 FALSE /*f_toc */,
69 TRUE /* f_landscape */,
70 FALSE /* f_12pt */,
71 FALSE /* f_enlarged_page */,
72 TRUE /* f_pagenumbers */,
73 NULL /* extras_for_preamble */);
74
75}
76
77void latex_interface::head(std::ostream& ost,
78 int f_book, int f_title,
79 const char *title, const char *author,
80 int f_toc, int f_landscape, int f_12pt,
81 int f_enlarged_page, int f_pagenumbers,
82 const char *extras_for_preamble)
83{
84 if (f_12pt) {
85 ost << "\\documentclass[12pt]{";
86 }
87 else {
88 ost << "\\documentclass{";
89 }
90 if (f_book)
91 ost << "book";
92 else
93 ost << "article";
94 ost << "}" << endl;
95 ost << "% a4paper" << endl;
96 ost << endl;
97 ost << "%\\usepackage[dvips]{epsfig}" << endl;
98 ost << "%\\usepackage{cours11, cours}" << endl;
99 ost << "%\\usepackage{fancyheadings}" << endl;
100 ost << "%\\usepackage{calc}" << endl;
101 ost << "\\usepackage{amsmath}" << endl;
102 ost << "\\usepackage{amssymb}" << endl;
103 ost << "\\usepackage{latexsym}" << endl;
104 ost << "\\usepackage{epsfig}" << endl;
105 ost << "\\usepackage{enumerate}" << endl;
106 ost << "%\\usepackage{supertabular}" << endl;
107 ost << "%\\usepackage{wrapfig}" << endl;
108 ost << "%\\usepackage{blackbrd}" << endl;
109 ost << "%\\usepackage{epic,eepic}" << endl;
110 ost << "\\usepackage{rotating}" << endl;
111 ost << "\\usepackage{multicol}" << endl;
112 ost << "%\\usepackage{multirow}" << endl;
113 ost << "\\usepackage{makeidx} % additional command see" << endl;
114 ost << "\\usepackage{rotating}" << endl;
115 ost << "\\usepackage{array}" << endl;
116 ost << "\\usepackage{tikz}" << endl;
117 ost << "\\usepackage{longtable}" << endl;
118 ost << "\\usepackage{anyfontsize}" << endl;
119 ost << "\\usepackage{t1enc}" << endl;
120 ost << "%\\usepackage{amsmath,amsfonts}" << endl;
121 ost << endl;
122 ost << endl;
123 ost << "%\\usepackage[mtbold,mtplusscr]{mathtime}" << endl;
124 ost << "% lucidacal,lucidascr," << endl;
125 ost << endl;
126 ost << "%\\usepackage{mathtimy}" << endl;
127 ost << "%\\usepackage{bm}" << endl;
128 ost << "%\\usepackage{avant}" << endl;
129 ost << "%\\usepackage{basker}" << endl;
130 ost << "%\\usepackage{bembo}" << endl;
131 ost << "%\\usepackage{bookman}" << endl;
132 ost << "%\\usepackage{chancery}" << endl;
133 ost << "%\\usepackage{garamond}" << endl;
134 ost << "%\\usepackage{helvet}" << endl;
135 ost << "%\\usepackage{newcent}" << endl;
136 ost << "%\\usepackage{palatino}" << endl;
137 ost << "%\\usepackage{times}" << endl;
138 ost << "%\\usepackage{pifont}" << endl;
139 if (f_enlarged_page) {
140 ost << "\\usepackage{fullpage}" << endl;
141 ost << "\\usepackage[top=1in,bottom=0.2in,right=1in,left=1in]{geometry}" << endl; // A Betten 2/7/2021
142#if 0
143 ost << "%\\voffset=-1.5cm" << endl;
144 ost << "\\hoffset=-2cm" << endl;
145 ost << "\\textwidth=20cm" << endl;
146 ost << "%\\topmargin 0.0in" << endl;
147 ost << "\\textheight 25cm" << endl;
148#endif
149 }
150
151 if (extras_for_preamble) {
152 ost << extras_for_preamble << endl;
153 }
154 ost << endl;
155 ost << endl;
156 ost << endl;
157 ost << "%\\parindent=0pt\n";
158 ost << endl;
159 //ost << "\\renewcommand{\\baselinestretch}{1.5}\n";
160 ost << endl;
161
162
163#if 0
164 if (f_enlarged_page) {
165 ost << "\\hoffset -2cm\n";
166 ost << "\\voffset -1cm\n";
167 ost << "\\topmargin 0.0cm\n";
168 if (f_landscape) {
169 ost << "\\textheight=18cm\n";
170 ost << "\\textwidth=23cm\n";
171 }
172 else {
173 ost << "\\textheight=23cm\n";
174 ost << "\\textwidth=18cm\n";
175 }
176 }
177 else {
178 ost << "\\hoffset -0.7cm\n";
179 ost << "%\\voffset 0cm\n";
180 ost << endl;
181 ost << "%\\oddsidemargin=15pt\n";
182 ost << endl;
183 ost << "%\\oddsidemargin 0pt\n";
184 ost << "%\\evensidemargin 0pt\n";
185 ost << "%\\topmargin 0pt\n";
186 ost << endl;
187#if 1
188 if (f_landscape) {
189 ost << "\\textwidth = 20cm\n";
190 ost << "\\textheight= 17cm\n";
191 }
192 else {
193 ost << "\\textwidth = 17cm\n";
194 ost << "\\textheight= 21cm\n";
195 }
196 ost << endl;
197#endif
198 }
199#endif
200
201
202 ost << "%\\topmargin=0pt\n";
203 ost << "%\\headsep=18pt\n";
204 ost << "%\\footskip=45pt\n";
205 ost << "%\\mathsurround=1pt\n";
206 ost << "%\\evensidemargin=0pt\n";
207 ost << "%\\oddsidemargin=15pt\n";
208 ost << endl;
209
210 ost << "%\\setlength{\\textheight}{\\baselineskip*41+\\topskip}\n";
211 ost << endl;
212
213
214 ost << "\\newcommand{\\sectionline}{" << endl;
215 ost << " \\nointerlineskip \\vspace{\\baselineskip}" << endl;
216 ost << " \\hspace{\\fill}\\rule{0.9\\linewidth}{1.7pt}\\hspace{\\fill}" << endl;
217 ost << " \\par\\nointerlineskip \\vspace{\\baselineskip}" << endl;
218 ost << " }" << endl;
219
220 ost << "\\newcommand\\setTBstruts{\\def\\T{\\rule{0pt}{2.6ex}}%" << endl;
221 ost << "\\def\\B{\\rule[-1.2ex]{0pt}{0pt}}}" << endl;
222
223 ost << "\\newcommand{\\ans}[1]{\\\\{\\bf ANSWER}: {#1}}" << endl;
224 ost << "\\newcommand{\\Aut}{{\\rm Aut}}\n";
225 ost << "\\newcommand{\\Sym}{{\\rm Sym}}\n";
226 ost << "\\newcommand{\\sFix}{{\\cal Fix}}\n";
227 ost << "\\newcommand{\\sOrbits}{{\\cal Orbits}}\n";
228 //ost << "\\newcommand{\\sFix}{{\\mathscr Fix}}\n";
229 //ost << "\\newcommand{\\sOrbits}{{\\mathscr Orbits}}\n";
230 ost << "\\newcommand{\\Stab}{{\\rm Stab}}\n";
231 ost << "\\newcommand{\\Fix}{{\\rm Fix}}\n";
232 ost << "\\newcommand{\\fix}{{\\rm fix}}\n";
233 ost << "\\newcommand{\\Orbits}{{\\rm Orbits}}\n";
234 ost << "\\newcommand{\\PG}{{\\rm PG}}\n";
235 ost << "\\newcommand{\\AG}{{\\rm AG}}\n";
236 ost << "\\newcommand{\\SQS}{{\\rm SQS}}\n";
237 ost << "\\newcommand{\\STS}{{\\rm STS}}\n";
238 //ost << "\\newcommand{\\Sp}{{\\rm Sp}}\n";
239 ost << "\\newcommand{\\PSL}{{\\rm PSL}}\n";
240 ost << "\\newcommand{\\PGL}{{\\rm PGL}}\n";
241 ost << "\\newcommand{\\PSSL}{{\\rm P\\Sigma L}}\n";
242 ost << "\\newcommand{\\PGGL}{{\\rm P\\Gamma L}}\n";
243 ost << "\\newcommand{\\SL}{{\\rm SL}}\n";
244 ost << "\\newcommand{\\GL}{{\\rm GL}}\n";
245 ost << "\\newcommand{\\SSL}{{\\rm \\Sigma L}}\n";
246 ost << "\\newcommand{\\GGL}{{\\rm \\Gamma L}}\n";
247 ost << "\\newcommand{\\ASL}{{\\rm ASL}}\n";
248 ost << "\\newcommand{\\AGL}{{\\rm AGL}}\n";
249 ost << "\\newcommand{\\ASSL}{{\\rm A\\Sigma L}}\n";
250 ost << "\\newcommand{\\AGGL}{{\\rm A\\Gamma L}}\n";
251 ost << "\\newcommand{\\PSU}{{\\rm PSU}}\n";
252 ost << "\\newcommand{\\HS}{{\\rm HS}}\n";
253 ost << "\\newcommand{\\Hol}{{\\rm Hol}}\n";
254 ost << "\\newcommand{\\SO}{{\\rm SO}}\n";
255 ost << "\\newcommand{\\ASO}{{\\rm ASO}}\n";
256
257 ost << "\\newcommand{\\la}{\\langle}\n";
258 ost << "\\newcommand{\\ra}{\\rangle}\n";
259
260
261 ost << "\\newcommand{\\cA}{{\\cal A}}\n";
262 ost << "\\newcommand{\\cB}{{\\cal B}}\n";
263 ost << "\\newcommand{\\cC}{{\\cal C}}\n";
264 ost << "\\newcommand{\\cD}{{\\cal D}}\n";
265 ost << "\\newcommand{\\cE}{{\\cal E}}\n";
266 ost << "\\newcommand{\\cF}{{\\cal F}}\n";
267 ost << "\\newcommand{\\cG}{{\\cal G}}\n";
268 ost << "\\newcommand{\\cH}{{\\cal H}}\n";
269 ost << "\\newcommand{\\cI}{{\\cal I}}\n";
270 ost << "\\newcommand{\\cJ}{{\\cal J}}\n";
271 ost << "\\newcommand{\\cK}{{\\cal K}}\n";
272 ost << "\\newcommand{\\cL}{{\\cal L}}\n";
273 ost << "\\newcommand{\\cM}{{\\cal M}}\n";
274 ost << "\\newcommand{\\cN}{{\\cal N}}\n";
275 ost << "\\newcommand{\\cO}{{\\cal O}}\n";
276 ost << "\\newcommand{\\cP}{{\\cal P}}\n";
277 ost << "\\newcommand{\\cQ}{{\\cal Q}}\n";
278 ost << "\\newcommand{\\cR}{{\\cal R}}\n";
279 ost << "\\newcommand{\\cS}{{\\cal S}}\n";
280 ost << "\\newcommand{\\cT}{{\\cal T}}\n";
281 ost << "\\newcommand{\\cU}{{\\cal U}}\n";
282 ost << "\\newcommand{\\cV}{{\\cal V}}\n";
283 ost << "\\newcommand{\\cW}{{\\cal W}}\n";
284 ost << "\\newcommand{\\cX}{{\\cal X}}\n";
285 ost << "\\newcommand{\\cY}{{\\cal Y}}\n";
286 ost << "\\newcommand{\\cZ}{{\\cal Z}}\n";
287
288 ost << "\\newcommand{\\rmA}{{\\rm A}}\n";
289 ost << "\\newcommand{\\rmB}{{\\rm B}}\n";
290 ost << "\\newcommand{\\rmC}{{\\rm C}}\n";
291 ost << "\\newcommand{\\rmD}{{\\rm D}}\n";
292 ost << "\\newcommand{\\rmE}{{\\rm E}}\n";
293 ost << "\\newcommand{\\rmF}{{\\rm F}}\n";
294 ost << "\\newcommand{\\rmG}{{\\rm G}}\n";
295 ost << "\\newcommand{\\rmH}{{\\rm H}}\n";
296 ost << "\\newcommand{\\rmI}{{\\rm I}}\n";
297 ost << "\\newcommand{\\rmJ}{{\\rm J}}\n";
298 ost << "\\newcommand{\\rmK}{{\\rm K}}\n";
299 ost << "\\newcommand{\\rmL}{{\\rm L}}\n";
300 ost << "\\newcommand{\\rmM}{{\\rm M}}\n";
301 ost << "\\newcommand{\\rmN}{{\\rm N}}\n";
302 ost << "\\newcommand{\\rmO}{{\\rm O}}\n";
303 ost << "\\newcommand{\\rmP}{{\\rm P}}\n";
304 ost << "\\newcommand{\\rmQ}{{\\rm Q}}\n";
305 ost << "\\newcommand{\\rmR}{{\\rm R}}\n";
306 ost << "\\newcommand{\\rmS}{{\\rm S}}\n";
307 ost << "\\newcommand{\\rmT}{{\\rm T}}\n";
308 ost << "\\newcommand{\\rmU}{{\\rm U}}\n";
309 ost << "\\newcommand{\\rmV}{{\\rm V}}\n";
310 ost << "\\newcommand{\\rmW}{{\\rm W}}\n";
311 ost << "\\newcommand{\\rmX}{{\\rm X}}\n";
312 ost << "\\newcommand{\\rmY}{{\\rm Y}}\n";
313 ost << "\\newcommand{\\rmZ}{{\\rm Z}}\n";
314
315 ost << "\\newcommand{\\bA}{{\\bf A}}\n";
316 ost << "\\newcommand{\\bB}{{\\bf B}}\n";
317 ost << "\\newcommand{\\bC}{{\\bf C}}\n";
318 ost << "\\newcommand{\\bD}{{\\bf D}}\n";
319 ost << "\\newcommand{\\bE}{{\\bf E}}\n";
320 ost << "\\newcommand{\\bF}{{\\bf F}}\n";
321 ost << "\\newcommand{\\bG}{{\\bf G}}\n";
322 ost << "\\newcommand{\\bH}{{\\bf H}}\n";
323 ost << "\\newcommand{\\bI}{{\\bf I}}\n";
324 ost << "\\newcommand{\\bJ}{{\\bf J}}\n";
325 ost << "\\newcommand{\\bK}{{\\bf K}}\n";
326 ost << "\\newcommand{\\bL}{{\\bf L}}\n";
327 ost << "\\newcommand{\\bM}{{\\bf M}}\n";
328 ost << "\\newcommand{\\bN}{{\\bf N}}\n";
329 ost << "\\newcommand{\\bO}{{\\bf O}}\n";
330 ost << "\\newcommand{\\bP}{{\\bf P}}\n";
331 ost << "\\newcommand{\\bQ}{{\\bf Q}}\n";
332 ost << "\\newcommand{\\bR}{{\\bf R}}\n";
333 ost << "\\newcommand{\\bS}{{\\bf S}}\n";
334 ost << "\\newcommand{\\bT}{{\\bf T}}\n";
335 ost << "\\newcommand{\\bU}{{\\bf U}}\n";
336 ost << "\\newcommand{\\bV}{{\\bf V}}\n";
337 ost << "\\newcommand{\\bW}{{\\bf W}}\n";
338 ost << "\\newcommand{\\bX}{{\\bf X}}\n";
339 ost << "\\newcommand{\\bY}{{\\bf Y}}\n";
340 ost << "\\newcommand{\\bZ}{{\\bf Z}}\n";
341
342#if 0
343 ost << "\\newcommand{\\sA}{{\\mathscr A}}\n";
344 ost << "\\newcommand{\\sB}{{\\mathscr B}}\n";
345 ost << "\\newcommand{\\sC}{{\\mathscr C}}\n";
346 ost << "\\newcommand{\\sD}{{\\mathscr D}}\n";
347 ost << "\\newcommand{\\sE}{{\\mathscr E}}\n";
348 ost << "\\newcommand{\\sF}{{\\mathscr F}}\n";
349 ost << "\\newcommand{\\sG}{{\\mathscr G}}\n";
350 ost << "\\newcommand{\\sH}{{\\mathscr H}}\n";
351 ost << "\\newcommand{\\sI}{{\\mathscr I}}\n";
352 ost << "\\newcommand{\\sJ}{{\\mathscr J}}\n";
353 ost << "\\newcommand{\\sK}{{\\mathscr K}}\n";
354 ost << "\\newcommand{\\sL}{{\\mathscr L}}\n";
355 ost << "\\newcommand{\\sM}{{\\mathscr M}}\n";
356 ost << "\\newcommand{\\sN}{{\\mathscr N}}\n";
357 ost << "\\newcommand{\\sO}{{\\mathscr O}}\n";
358 ost << "\\newcommand{\\sP}{{\\mathscr P}}\n";
359 ost << "\\newcommand{\\sQ}{{\\mathscr Q}}\n";
360 ost << "\\newcommand{\\sR}{{\\mathscr R}}\n";
361 ost << "\\newcommand{\\sS}{{\\mathscr S}}\n";
362 ost << "\\newcommand{\\sT}{{\\mathscr T}}\n";
363 ost << "\\newcommand{\\sU}{{\\mathscr U}}\n";
364 ost << "\\newcommand{\\sV}{{\\mathscr V}}\n";
365 ost << "\\newcommand{\\sW}{{\\mathscr W}}\n";
366 ost << "\\newcommand{\\sX}{{\\mathscr X}}\n";
367 ost << "\\newcommand{\\sY}{{\\mathscr Y}}\n";
368 ost << "\\newcommand{\\sZ}{{\\mathscr Z}}\n";
369#else
370 ost << "\\newcommand{\\sA}{{\\cal A}}\n";
371 ost << "\\newcommand{\\sB}{{\\cal B}}\n";
372 ost << "\\newcommand{\\sC}{{\\cal C}}\n";
373 ost << "\\newcommand{\\sD}{{\\cal D}}\n";
374 ost << "\\newcommand{\\sE}{{\\cal E}}\n";
375 ost << "\\newcommand{\\sF}{{\\cal F}}\n";
376 ost << "\\newcommand{\\sG}{{\\cal G}}\n";
377 ost << "\\newcommand{\\sH}{{\\cal H}}\n";
378 ost << "\\newcommand{\\sI}{{\\cal I}}\n";
379 ost << "\\newcommand{\\sJ}{{\\cal J}}\n";
380 ost << "\\newcommand{\\sK}{{\\cal K}}\n";
381 ost << "\\newcommand{\\sL}{{\\cal L}}\n";
382 ost << "\\newcommand{\\sM}{{\\cal M}}\n";
383 ost << "\\newcommand{\\sN}{{\\cal N}}\n";
384 ost << "\\newcommand{\\sO}{{\\cal O}}\n";
385 ost << "\\newcommand{\\sP}{{\\cal P}}\n";
386 ost << "\\newcommand{\\sQ}{{\\cal Q}}\n";
387 ost << "\\newcommand{\\sR}{{\\cal R}}\n";
388 ost << "\\newcommand{\\sS}{{\\cal S}}\n";
389 ost << "\\newcommand{\\sT}{{\\cal T}}\n";
390 ost << "\\newcommand{\\sU}{{\\cal U}}\n";
391 ost << "\\newcommand{\\sV}{{\\cal V}}\n";
392 ost << "\\newcommand{\\sW}{{\\cal W}}\n";
393 ost << "\\newcommand{\\sX}{{\\cal X}}\n";
394 ost << "\\newcommand{\\sY}{{\\cal Y}}\n";
395 ost << "\\newcommand{\\sZ}{{\\cal Z}}\n";
396#endif
397
398 ost << "\\newcommand{\\frakA}{{\\mathfrak A}}\n";
399 ost << "\\newcommand{\\frakB}{{\\mathfrak B}}\n";
400 ost << "\\newcommand{\\frakC}{{\\mathfrak C}}\n";
401 ost << "\\newcommand{\\frakD}{{\\mathfrak D}}\n";
402 ost << "\\newcommand{\\frakE}{{\\mathfrak E}}\n";
403 ost << "\\newcommand{\\frakF}{{\\mathfrak F}}\n";
404 ost << "\\newcommand{\\frakG}{{\\mathfrak G}}\n";
405 ost << "\\newcommand{\\frakH}{{\\mathfrak H}}\n";
406 ost << "\\newcommand{\\frakI}{{\\mathfrak I}}\n";
407 ost << "\\newcommand{\\frakJ}{{\\mathfrak J}}\n";
408 ost << "\\newcommand{\\frakK}{{\\mathfrak K}}\n";
409 ost << "\\newcommand{\\frakL}{{\\mathfrak L}}\n";
410 ost << "\\newcommand{\\frakM}{{\\mathfrak M}}\n";
411 ost << "\\newcommand{\\frakN}{{\\mathfrak N}}\n";
412 ost << "\\newcommand{\\frakO}{{\\mathfrak O}}\n";
413 ost << "\\newcommand{\\frakP}{{\\mathfrak P}}\n";
414 ost << "\\newcommand{\\frakQ}{{\\mathfrak Q}}\n";
415 ost << "\\newcommand{\\frakR}{{\\mathfrak R}}\n";
416 ost << "\\newcommand{\\frakS}{{\\mathfrak S}}\n";
417 ost << "\\newcommand{\\frakT}{{\\mathfrak T}}\n";
418 ost << "\\newcommand{\\frakU}{{\\mathfrak U}}\n";
419 ost << "\\newcommand{\\frakV}{{\\mathfrak V}}\n";
420 ost << "\\newcommand{\\frakW}{{\\mathfrak W}}\n";
421 ost << "\\newcommand{\\frakX}{{\\mathfrak X}}\n";
422 ost << "\\newcommand{\\frakY}{{\\mathfrak Y}}\n";
423 ost << "\\newcommand{\\frakZ}{{\\mathfrak Z}}\n";
424
425 ost << "\\newcommand{\\fraka}{{\\mathfrak a}}\n";
426 ost << "\\newcommand{\\frakb}{{\\mathfrak b}}\n";
427 ost << "\\newcommand{\\frakc}{{\\mathfrak c}}\n";
428 ost << "\\newcommand{\\frakd}{{\\mathfrak d}}\n";
429 ost << "\\newcommand{\\frake}{{\\mathfrak e}}\n";
430 ost << "\\newcommand{\\frakf}{{\\mathfrak f}}\n";
431 ost << "\\newcommand{\\frakg}{{\\mathfrak g}}\n";
432 ost << "\\newcommand{\\frakh}{{\\mathfrak h}}\n";
433 ost << "\\newcommand{\\fraki}{{\\mathfrak i}}\n";
434 ost << "\\newcommand{\\frakj}{{\\mathfrak j}}\n";
435 ost << "\\newcommand{\\frakk}{{\\mathfrak k}}\n";
436 ost << "\\newcommand{\\frakl}{{\\mathfrak l}}\n";
437 ost << "\\newcommand{\\frakm}{{\\mathfrak m}}\n";
438 ost << "\\newcommand{\\frakn}{{\\mathfrak n}}\n";
439 ost << "\\newcommand{\\frako}{{\\mathfrak o}}\n";
440 ost << "\\newcommand{\\frakp}{{\\mathfrak p}}\n";
441 ost << "\\newcommand{\\frakq}{{\\mathfrak q}}\n";
442 ost << "\\newcommand{\\frakr}{{\\mathfrak r}}\n";
443 ost << "\\newcommand{\\fraks}{{\\mathfrak s}}\n";
444 ost << "\\newcommand{\\frakt}{{\\mathfrak t}}\n";
445 ost << "\\newcommand{\\fraku}{{\\mathfrak u}}\n";
446 ost << "\\newcommand{\\frakv}{{\\mathfrak v}}\n";
447 ost << "\\newcommand{\\frakw}{{\\mathfrak w}}\n";
448 ost << "\\newcommand{\\frakx}{{\\mathfrak x}}\n";
449 ost << "\\newcommand{\\fraky}{{\\mathfrak y}}\n";
450 ost << "\\newcommand{\\frakz}{{\\mathfrak z}}\n";
451
452
453 ost << "\\newcommand{\\Tetra}{{\\mathfrak Tetra}}\n";
454 ost << "\\newcommand{\\Cube}{{\\mathfrak Cube}}\n";
455 ost << "\\newcommand{\\Octa}{{\\mathfrak Octa}}\n";
456 ost << "\\newcommand{\\Dode}{{\\mathfrak Dode}}\n";
457 ost << "\\newcommand{\\Ico}{{\\mathfrak Ico}}\n";
458
459 ost << "\\newcommand{\\bbF}{{\\mathbb F}}\n";
460 ost << "\\newcommand{\\bbQ}{{\\mathbb Q}}\n";
461 ost << "\\newcommand{\\bbC}{{\\mathbb C}}\n";
462 ost << "\\newcommand{\\bbR}{{\\mathbb R}}\n";
463
464 ost << endl;
465 ost << endl;
466 ost << endl;
467 ost << "%\\makeindex\n";
468 ost << endl;
469 ost << "\\begin{document} \n";
470 ost << "\\setTBstruts" << endl;
471 ost << endl;
472 ost << "\\bibliographystyle{plain}\n";
473 if (!f_pagenumbers) {
474 ost << "\\pagestyle{empty}\n";
475 }
476 ost << "%\\large\n";
477 ost << endl;
478 ost << "{\\allowdisplaybreaks%\n";
479 ost << endl;
480 ost << endl;
481 ost << endl;
482 ost << endl;
483 ost << "%\\makeindex\n";
484 ost << endl;
485 ost << "%\\renewcommand{\\labelenumi}{(\\roman{enumi})}\n";
486 ost << endl;
487
488 if (f_title) {
489 ost << "\\title{" << title << "}\n";
490 ost << "\\author{" << author << "}%end author\n";
491 ost << "%\\date{}\n";
492 ost << "\\maketitle%\n";
493 }
494 ost << "%\\pagenumbering{roman}\n";
495 ost << "%\\thispagestyle{empty}\n";
496 if (f_toc) {
497 ost << "\\tableofcontents\n";
498 }
499 ost << "%\\input et.tex%\n";
500 ost << "%\\thispagestyle{empty}%\\phantom{page2}%\\clearpage%\n";
501 ost << "%\\addcontentsline{toc}{chapter}{Inhaltsverzeichnis}%\n";
502 ost << "%\\tableofcontents\n";
503 ost << "%\\listofsymbols\n";
504 if (f_toc){
505 ost << "\\clearpage\n";
506 ost << endl;
507 }
508 ost << "%\\pagenumbering{arabic}\n";
509 ost << "%\\pagenumbering{roman}\n";
510 ost << endl;
511 ost << endl;
512 ost << endl;
513}
514
515
516void latex_interface::foot(std::ostream& ost)
517{
518 ost << endl;
519 ost << endl;
520 ost << "%\\bibliographystyle{gerplain}% wird oben eingestellt\n";
521 ost << "%\\addcontentsline{toc}{section}{References}\n";
522 ost << "%\\bibliography{../MY_BIBLIOGRAPHY/anton}\n";
523 ost << "% ACHTUNG: nicht vergessen:\n";
524 ost << "% die Zeile\n";
525 ost << "%\\addcontentsline{toc}{chapter}{Literaturverzeichnis}\n";
526 ost << "% muss per Hand in d.bbl eingefuegt werden !\n";
527 ost << "% nach \\begin{thebibliography}{100}\n";
528 ost << endl;
529 ost << "%\\begin{theindex}\n";
530 ost << endl;
531 ost << "%\\clearpage\n";
532 ost << "%\\addcontentsline{toc}{chapter}{Index}\n";
533 ost << "%\\input{apd.ind}\n";
534 ost << endl;
535 ost << "%\\printindex\n";
536 ost << "%\\end{theindex}\n";
537 ost << endl;
538 ost << "}% allowdisplaybreaks\n";
539 ost << endl;
540 ost << "\\end{document}\n";
541 ost << endl;
542 ost << endl;
543}
544
545
546
547
548// two functions from DISCRETA1:
549// adapted to use ostream instead of FILE pointer
550
553 int v, int b,
554 int V, int B, int *Vi, int *Bj,
555 int *incma,
556 int f_labelling_points, std::string *point_labels,
557 int f_labelling_blocks, std::string *block_labels,
558 int verbose_level)
559// width for one box in 0.1mm
560// width_10 is 1 10th of width
561// example: width = 40, width_10 = 4
562{
563 int f_v = (verbose_level >= 1);
564
565 if (f_v) {
566 cout << "latex_interface::incma_latex_with_text_labels" << endl;
567 }
568 int w, h, w1, h1;
569 int i, j, k, a;
570 int x0, y0, x1, y1;
571 int X0, Y0, X1, Y1;
572 int width_8, width_5;
573
574
575 string tdo_line_width;
576 string line_width;
577
578
579 tdo_line_width.assign(Descr->thick_lines);
580
581 line_width.assign(Descr->thin_lines);
582 // char *geo_line_width = "0.25mm";
583
584#if 0
585 if (!Descr->f_width) {
586 cout << "latex_interface::incma_latex_with_text_labels please give -width <width>" << endl;
587 exit(1);
588 }
589 if (!Descr->f_width_10) {
590 cout << "latex_interface::incma_latex_with_text_labels please give -width_10 <width_10>" << endl;
591 exit(1);
592 }
593#endif
594
595 width_8 = Descr->width - 2 * Descr->width_10;
596 width_5 = Descr->width >> 1;
597 fp << "\\unitlength" << Descr->unit_length << endl;
598 w = b * Descr->width;
599 h = v * Descr->width;
600 w1 = w;
601 h1 = h;
602 if (f_labelling_points) {
603 w1 += 2 * Descr->width;
604 }
605 if (f_labelling_blocks) {
606 h1 += 2 * Descr->width;
607 }
608 fp << "\\begin{picture}(" << w1 << "," << h1 << ")" << endl;
609
610 // the grid:
611 fp << "\\linethickness{" << tdo_line_width << "}" << endl;
612 k = 0;
613 for (i = -1; i < B; i++) {
614 if (i >= 0) {
615 a = Bj[i];
616 k += a;
617 }
618 if (Descr->f_outline_thin) {
619 if (i == -1 || i == B - 1) {
620 continue;
621 }
622 }
623 fp << "\\put(" << k * Descr->width << ",0){\\line(0,1){"
624 << h << "}}" << endl;
625 }
626 if (k != b) {
627 cout << "incma_latex_picture: k != b" << endl;
628 exit(1);
629 }
630 k = 0;
631 for (i = -1; i < V; i++) {
632 if (i >= 0) {
633 a = Vi[i];
634 k += a;
635 }
636 if (Descr->f_outline_thin) {
637 if (i == -1 || i == V - 1) {
638 continue;
639 }
640 }
641 fp << "\\put(0," << h - k * Descr->width << "){\\line(1,0){"
642 << w << "}}" << endl;
643 }
644 if (k != v) {
645 cout << "incma_latex_picture: k != v" << endl;
646 exit(1);
647 }
648
649 // labeling of points:
650 if (f_labelling_points) {
651 for (i = 0; i < v; i++) {
652 fp << "\\put(0," << h - i * Descr->width - width_5
653 << "){\\makebox(0,0)[r]{"
654 << point_labels[i] << "$\\,$}}" << endl;
655 }
656 }
657 else {
658 for (i = 0; i < v; i++) {
659 fp << "\\put(0," << h - i * Descr->width - width_5
660 << "){\\makebox(0,0)[r]{}}" << endl;
661 }
662 }
663
664 // labeling of blocks:
665 if (f_labelling_blocks) {
666 for (i = 0; i < b; i++) {
667 fp << "\\put(" << i * Descr->width + width_5 << "," << h + width_5
668 << "){\\makebox(0,0)[b]{"
669 << block_labels[i] << "}}" << endl;
670 }
671 }
672 else {
673 for (i = 0; i < b; i++) {
674 fp << "\\put(" << i * Descr->width + width_5 << "," << h + width_5
675 << "){\\makebox(0,0)[b]{}}" << endl;
676 }
677 }
678
679 // the grid:
680 fp << "\\linethickness{" << line_width << "}" << endl;
681 fp << "\\multiput(0,0)(" << Descr->width << ",0){" << b + 1
682 << "}{\\line(0,1){" << h
683 << "}}" << endl;
684 fp << "\\multiput(0,0)(0," << Descr->width << "){" << v + 1
685 << "}{\\line(1,0){" << w << "}}" << endl;
686
687 // the incidence matrix itself:
688 fp << "\\linethickness{" << Descr->geo_line_width << "}" << endl;
689 for (i = 0; i < v; i++) {
690 y0 = h - i * Descr->width;
691 y1 = h - (i + 1) * Descr->width;
692 Y0 = y0 - Descr->width_10;
693 Y1 = y1 + Descr->width_10;
694 for (j = 0; j < b; j++) {
695 if (incma[i * b + j] == 0) {
696 continue;
697 }
698 // printf("%d ", j);
699 x0 = j * Descr->width;
700 x1 = (j + 1) * Descr->width;
701 X0 = x0 + Descr->width_10;
702 X1 = x1 - Descr->width_10;
703 // hor. lines:
704 fp << "\\put(" << X0 << "," << Y0 << "){\\line(1,0){"
705 << width_8 << "}}" << endl;
706 fp << "\\put(" << X0 << "," << Y1 << "){\\line(1,0){"
707 << width_8 << "}}" << endl;
708
709 // vert. lines:
710 fp << "\\put(" << X0 << "," << Y1 << "){\\line(0,1){"
711 << width_8 << "}}" << endl;
712 fp << "\\put(" << X1 << "," << Y1 << "){\\line(0,1){"
713 << width_8 << "}}" << endl;
714
715 }
716 // printf("\n");
717 }
718
719 fp << "\\end{picture}" << endl;
720 if (f_v) {
721 cout << "latex_interface::incma_latex_with_text_labels done" << endl;
722 }
723}
724
725
726
727
728void latex_interface::incma_latex(std::ostream &fp,
729 int v, int b,
730 int V, int B, int *Vi, int *Bj,
731 int *incma,
732 int verbose_level)
733// used in incidence_structure::latex_it
734{
735 int f_v = (verbose_level >= 1);
736
737 if (f_v) {
738 cout << "latex_interface::incma_latex" << endl;
739 }
741
743
744 if (f_v) {
745 cout << "latex_interface::incma_latex before incma_latex_with_text_labels" << endl;
746 }
748 Descr,
749 v, b, V, B, Vi, Bj, incma,
750 FALSE /* f_labelling_points */, NULL,
751 FALSE /* f_labelling_blocks */, NULL,
752 verbose_level);
753 if (f_v) {
754 cout << "latex_interface::incma_latex after incma_latex_with_text_labels" << endl;
755 }
756
757 if (f_v) {
758 cout << "latex_interface::incma_latex done" << endl;
759 }
760}
761
763 int v, int b,
764 int V, int B, int *Vi, int *Bj,
765 int *row_labels_int,
766 int *col_labels_int,
767 int *incma,
768 int verbose_level)
769// used in incidence_structure::latex_it
770{
771 int f_v = (verbose_level >= 1);
772
773 if (f_v) {
774 cout << "latex_interface::incma_latex" << endl;
775 }
777
779
780 std::string *point_labels;
781 std::string *block_labels;
782
783
784 point_labels = new string [v];
785 block_labels = new string [b];
786
787 int i, j;
788
789 char str[1000];
790
791
792 for (i = 0; i < v; i++) {
793 sprintf(str, "%d", row_labels_int[i]);
794 point_labels[i].assign(str);
795 }
796 for (j = 0; j < b; j++) {
797 sprintf(str, "%d", col_labels_int[j]);
798 block_labels[j].assign(str);
799 }
800
801 if (f_v) {
802 cout << "latex_interface::incma_latex before incma_latex_with_text_labels" << endl;
803 }
805 Descr,
806 v, b, V, B, Vi, Bj, incma,
807 TRUE /* f_labelling_points */, point_labels,
808 TRUE /* f_labelling_blocks */, block_labels,
809 verbose_level);
810 if (f_v) {
811 cout << "latex_interface::incma_latex after incma_latex_with_text_labels" << endl;
812 }
813
814 delete [] point_labels;
815 delete [] block_labels;
816
817 if (f_v) {
818 cout << "latex_interface::incma_latex done" << endl;
819 }
820}
821
822
823
825 int *p, int m, int n)
826{
827 int i, j;
828
829 for (i = 0; i < m; i++) {
830 cout << "\t\"";
831 for (j = 0; j < n; j++) {
832 ost << p[i * n + j];
833 }
834 ost << "\"" << endl;
835 }
836}
837
839 int *p, int m, int n)
840{
841 int i, j;
842
843 ost << "\\begin{array}{*{" << n << "}c}" << endl;
844 for (i = 0; i < m; i++) {
845 for (j = 0; j < n; j++) {
846 ost << p[i * n + j];
847 if (j < n - 1) {
848 ost << " & ";
849 }
850 }
851 ost << "\\\\" << endl;
852 }
853 ost << "\\end{array}" << endl;
854}
855
857 long int *p, int m, int n)
858{
859 int i, j;
860
861 ost << "\\begin{array}{*{" << n << "}c}" << endl;
862 for (i = 0; i < m; i++) {
863 for (j = 0; j < n; j++) {
864 ost << p[i * n + j];
865 if (j < n - 1) {
866 ost << " & ";
867 }
868 }
869 ost << "\\\\" << endl;
870 }
871 ost << "\\end{array}" << endl;
872}
873
875 ring_theory::longinteger_object *p, int m, int n)
876{
877 int i, j;
878
879 ost << "\\begin{array}{*{" << n << "}r}" << endl;
880 for (i = 0; i < m; i++) {
881 for (j = 0; j < n; j++) {
882 ost << p[i * n + j];
883 if (j < n - 1) {
884 ost << " & ";
885 }
886 }
887 ost << "\\\\" << endl;
888 }
889 ost << "\\end{array}" << endl;
890}
891
893 int *p, int m, int n, int *row_labels, int *col_labels,
894 int f_tex)
895{
896 int i, j;
897
898 if (f_tex) {
899 ost << "\\begin{array}{r|*{" << n << "}r}" << endl;
900 }
901
902 for (j = 0; j < n; j++) {
903 if (f_tex) {
904 ost << " & ";
905 }
906 else {
907 ost << " ";
908 }
909 ost << col_labels[j];
910 }
911 if (f_tex) {
912 ost << "\\\\" << endl;
913 ost << "\\hline" << endl;
914 }
915 else {
916 ost << endl;
917 }
918 for (i = 0; i < m; i++) {
919 ost << row_labels[i];
920 for (j = 0; j < n; j++) {
921 if (f_tex) {
922 ost << " & ";
923 }
924 else {
925 ost << " ";
926 }
927 ost << p[i * n + j];
928 }
929 if (f_tex) {
930 ost << "\\\\";
931 }
932 ost << endl;
933 }
934 if (f_tex) {
935 ost << "\\end{array}" << endl;
936 }
937}
938
940 long int *p, int m, int n, long int *row_labels, long int *col_labels,
941 int f_tex)
942{
943 int i, j;
944
945 if (f_tex) {
946 ost << "\\begin{array}{r|*{" << n << "}r}" << endl;
947 }
948
949 for (j = 0; j < n; j++) {
950 if (f_tex) {
951 ost << " & ";
952 }
953 else {
954 ost << " ";
955 }
956 ost << col_labels[j];
957 }
958 if (f_tex) {
959 ost << "\\\\" << endl;
960 ost << "\\hline" << endl;
961 }
962 else {
963 ost << endl;
964 }
965 for (i = 0; i < m; i++) {
966 ost << row_labels[i];
967 for (j = 0; j < n; j++) {
968 if (f_tex) {
969 ost << " & ";
970 }
971 else {
972 ost << " ";
973 }
974 ost << p[i * n + j];
975 }
976 if (f_tex) {
977 ost << "\\\\";
978 }
979 ost << endl;
980 }
981 if (f_tex) {
982 ost << "\\end{array}" << endl;
983 }
984}
985
987 int *p, int m, int n, int f_tex)
988{
990 p, m, n, 0, 0, f_tex);
991
992}
993
995 long int *p, int m, int n, int f_tex)
996{
998 p, m, n, 0, 0, f_tex);
999
1000}
1001
1003 int *p, int m, int n, int m_offset, int n_offset, int f_tex)
1004{
1005 if (f_tex) {
1007 ost, p, m, n, m_offset, n_offset);
1008 }
1009 else {
1011 ost, p, m, n, m_offset, n_offset);
1012 }
1013}
1014
1016 long int *p, int m, int n, int m_offset, int n_offset, int f_tex)
1017{
1018 if (f_tex) {
1020 ost, p, m, n, m_offset, n_offset);
1021 }
1022 else {
1024 ost, p, m, n, m_offset, n_offset);
1025 }
1026}
1027
1029 std::ostream &ost, int *p, int m, int n, int m_offset, int n_offset)
1030{
1031 int i, j, w;
1032
1034
1035 for (j = 0; j < w; j++) {
1036 ost << " ";
1037 }
1038 for (j = 0; j < n; j++) {
1039 ost << " " << setw(w) << n_offset + j;
1040 }
1041 ost << endl;
1042 for (i = 0; i < m; i++) {
1043 ost << setw(w) << m_offset + i;
1044 for (j = 0; j < n; j++) {
1045 ost << " " << setw(w) << p[i * n + j];
1046 }
1047 ost << endl;
1048 }
1049}
1050
1052 std::ostream &ost, long int *p, int m, int n, int m_offset, int n_offset)
1053{
1054 int i, j, w;
1055
1057
1058 for (j = 0; j < w; j++) {
1059 ost << " ";
1060 }
1061 for (j = 0; j < n; j++) {
1062 ost << " " << setw(w) << n_offset + j;
1063 }
1064 ost << endl;
1065 for (i = 0; i < m; i++) {
1066 ost << setw(w) << m_offset + i;
1067 for (j = 0; j < n; j++) {
1068 ost << " " << setw(w) << p[i * n + j];
1069 }
1070 ost << endl;
1071 }
1072}
1073
1075 std::ostream &ost, int *p, int m, int n,
1076 int m_offset, int n_offset)
1077{
1078 int i, j;
1079
1080 ost << "\\begin{array}{r|*{" << n << "}{r}}" << endl;
1081
1082 for (j = 0; j < n; j++) {
1083 ost << " & " << n_offset + j;
1084 }
1085 ost << "\\\\" << endl;
1086 ost << "\\hline" << endl;
1087 for (i = 0; i < m; i++) {
1088 ost << m_offset + i;
1089 for (j = 0; j < n; j++) {
1090 ost << " & " << p[i * n + j];
1091 }
1092 ost << "\\\\";
1093 ost << endl;
1094 }
1095 ost << "\\end{array}" << endl;
1096}
1097
1099 std::ostream &ost, long int *p, int m, int n,
1100 int m_offset, int n_offset)
1101{
1102 int i, j;
1103
1104 ost << "\\begin{array}{r|*{" << n << "}{r}}" << endl;
1105
1106 for (j = 0; j < n; j++) {
1107 ost << " & " << n_offset + j;
1108 }
1109 ost << "\\\\" << endl;
1110 ost << "\\hline" << endl;
1111 for (i = 0; i < m; i++) {
1112 ost << m_offset + i;
1113 for (j = 0; j < n; j++) {
1114 ost << " & " << p[i * n + j];
1115 }
1116 ost << "\\\\";
1117 ost << endl;
1118 }
1119 ost << "\\end{array}" << endl;
1120}
1121
1123 int *p, int m, int n, int block_width)
1124{
1125 int i, j, I, J, nb_row_blocks, nb_col_blocks, v, w;
1126 int *M;
1127
1128 nb_row_blocks = (m + block_width - 1) / block_width;
1129 nb_col_blocks = (n + block_width - 1) / block_width;
1130 M = NEW_int(block_width * block_width);
1131 for (I = 0; I < nb_row_blocks; I++) {
1132 for (J = 0; J < nb_col_blocks; J++) {
1133 ost << "$$" << endl;
1134 w = block_width;
1135 if ((J + 1) * block_width > n) {
1136 w = n - J * block_width;
1137 }
1138 v = block_width;
1139 if ((I + 1) * block_width > m) {
1140 v = m - I * block_width;
1141 }
1142 for (i = 0; i < v; i++) {
1143 for (j = 0; j < w; j++) {
1144 M[i * w + j] =
1145 p[(I * block_width + i) * n +
1146 J * block_width + j];
1147 }
1148 }
1149 cout << "print_integer_matrix_tex_block_by_block I="
1150 << I << " J=" << J << " v=" << v
1151 << " w=" << w << " M=" << endl;
1152 Orbiter->Int_vec->matrix_print(M, v, w);
1154 ost, M, v, w,
1155 I * block_width,
1156 J * block_width,
1157 TRUE /* f_tex*/);
1158#if 0
1159 ost << "\\begin{array}{*{" << w << "}{r}}" << endl;
1160 for (i = 0; i < block_width; i++) {
1161 if (I * block_width + i > m) {
1162 continue;
1163 }
1164 for (j = 0; j < w; j++) {
1165 ost << p[i * n + J * block_width + j];
1166 if (j < w - 1) {
1167 ost << " & ";
1168 }
1169 }
1170 ost << "\\\\" << endl;
1171 }
1172 ost << "\\end{array}" << endl;
1173#endif
1174 ost << "$$" << endl;
1175 } // next J
1176 } // next I
1177 FREE_int(M);
1178}
1179
1181 int *p, int m, int n)
1182{
1183 int i, j;
1184
1185 for (i = 0; i < m; i++) {
1186 for (j = 0; j < n; j++) {
1187 ost << p[i * n + j];
1188 }
1189 ost << "\\\\" << endl;
1190 }
1191}
1192
1194 int *v, int len, int width, int f_tex)
1195{
1196 int *w;
1197 int i;
1198
1199 w = NEW_int(len + width - 1);
1200 Int_vec_copy(v, w, len);
1201 for (i = 0; i < width - 1; i++) {
1202 w[len + i] = 0;
1203 }
1204
1206 w, (len + width - 1) / width, width, f_tex);
1207
1208 FREE_int(w);
1209}
1210
1212 long int *v, int len, int width, int f_tex)
1213{
1214 long int *w;
1215 int i;
1216
1217 w = NEW_lint(len + width - 1);
1218 Lint_vec_copy(v, w, len);
1219 for (i = 0; i < width - 1; i++) {
1220 w[len + i] = 0;
1221 }
1222
1224 w, (len + width - 1) / width, width, f_tex);
1225
1226 FREE_lint(w);
1227}
1228
1229
1231 int *p, int m, int n,
1232 int *row_labels, int *col_labels,
1233 int *row_part_first, int *row_part_len, int nb_row_parts,
1234 int *col_part_first, int *col_part_len, int nb_col_parts,
1235 void (*process_function_or_NULL)(int *p, int m, int n,
1236 int i, int j, int val, std::string &output, void *data),
1237 void *data,
1238 int f_tex)
1239{
1240 int i, j, I, J, u, v;
1241 string output;
1242
1243 if (f_tex) {
1244 ost << "\\begin{array}{r|";
1245 for (J = 0; J < nb_col_parts; J++) {
1246 ost << "*{" << col_part_len[J] << "}{r}|";
1247 }
1248 ost << "}" << endl;
1249 }
1250
1251 for (j = 0; j < n; j++) {
1252 if (f_tex) {
1253 ost << " & ";
1254 }
1255 else {
1256 ost << " ";
1257 }
1258 output.assign("");
1259 if (process_function_or_NULL) {
1260 (*process_function_or_NULL)(
1261 p, m, n, -1, j,
1262 col_labels[j], output, data);
1263 ost << output;
1264 }
1265 else {
1266 ost << col_labels[j];
1267 }
1268 }
1269 if (f_tex) {
1270 ost << "\\\\" << endl;
1271 ost << "\\hline" << endl;
1272 }
1273 else {
1274 ost << endl;
1275 }
1276 for (I = 0; I < nb_row_parts; I++) {
1277 for (u = 0; u < row_part_len[I]; u++) {
1278 i = row_part_first[I] + u;
1279
1280 output.assign("");
1281 if (process_function_or_NULL) {
1282 (*process_function_or_NULL)(
1283 p, m, n, i, -1,
1284 row_labels[i], output, data);
1285 ost << output;
1286 }
1287 else {
1288 ost << row_labels[i];
1289 }
1290
1291 for (J = 0; J < nb_col_parts; J++) {
1292 for (v = 0; v < col_part_len[J]; v++) {
1293 j = col_part_first[J] + v;
1294 if (f_tex) {
1295 ost << " & ";
1296 }
1297 else {
1298 ost << " ";
1299 }
1300 output.assign("");
1301 if (process_function_or_NULL) {
1302 (*process_function_or_NULL)(
1303 p, m, n, i, j, p[i * n + j],
1304 output, data);
1305 ost << output;
1306 }
1307 else {
1308 ost << p[i * n + j];
1309 }
1310 }
1311 }
1312 if (f_tex) {
1313 ost << "\\\\";
1314 }
1315 ost << endl;
1316 }
1317 if (f_tex) {
1318 ost << "\\hline";
1319 }
1320 ost << endl;
1321 }
1322 if (f_tex) {
1323 ost << "\\end{array}" << endl;
1324 }
1325}
1326
1328 long int *p, int m, int n,
1329 int *row_labels, int *col_labels,
1330 int *row_part_first, int *row_part_len, int nb_row_parts,
1331 int *col_part_first, int *col_part_len, int nb_col_parts,
1332 void (*process_function_or_NULL)(long int *p, int m, int n,
1333 int i, int j, int val, std::string &output, void *data),
1334 void *data,
1335 int f_tex)
1336{
1337 int i, j, I, J, u, v;
1338 string output;
1339
1340 if (f_tex) {
1341 ost << "\\begin{array}{r|";
1342 for (J = 0; J < nb_col_parts; J++) {
1343 ost << "*{" << col_part_len[J] << "}{r}|";
1344 }
1345 ost << "}" << endl;
1346 }
1347
1348 for (j = 0; j < n; j++) {
1349 if (f_tex) {
1350 ost << " & ";
1351 }
1352 else {
1353 ost << " ";
1354 }
1355 output.assign("");
1356 if (process_function_or_NULL) {
1357 (*process_function_or_NULL)(
1358 p, m, n, -1, j,
1359 col_labels[j], output, data);
1360 ost << output;
1361 }
1362 else {
1363 ost << col_labels[j];
1364 }
1365 }
1366 if (f_tex) {
1367 ost << "\\\\" << endl;
1368 ost << "\\hline" << endl;
1369 }
1370 else {
1371 ost << endl;
1372 }
1373 for (I = 0; I < nb_row_parts; I++) {
1374 for (u = 0; u < row_part_len[I]; u++) {
1375 i = row_part_first[I] + u;
1376
1377 output.assign("");
1378 if (process_function_or_NULL) {
1379 (*process_function_or_NULL)(
1380 p, m, n, i, -1,
1381 row_labels[i], output, data);
1382 ost << output;
1383 }
1384 else {
1385 ost << row_labels[i];
1386 }
1387
1388 for (J = 0; J < nb_col_parts; J++) {
1389 for (v = 0; v < col_part_len[J]; v++) {
1390 j = col_part_first[J] + v;
1391 if (f_tex) {
1392 ost << " & ";
1393 }
1394 else {
1395 ost << " ";
1396 }
1397 output.assign("");
1398 if (process_function_or_NULL) {
1399 (*process_function_or_NULL)(
1400 p, m, n, i, j, p[i * n + j],
1401 output, data);
1402 ost << output;
1403 }
1404 else {
1405 ost << p[i * n + j];
1406 }
1407 }
1408 }
1409 if (f_tex) {
1410 ost << "\\\\";
1411 }
1412 ost << endl;
1413 }
1414 if (f_tex) {
1415 ost << "\\hline";
1416 }
1417 ost << endl;
1418 }
1419 if (f_tex) {
1420 ost << "\\end{array}" << endl;
1421 }
1422}
1423
1424void latex_interface::int_matrix_print_tex(std::ostream &ost, int *p, int m, int n)
1425{
1426 int i, j;
1427
1428 ost << "\\begin{array}{*{" << n << "}{c}}" << endl;
1429 for (i = 0; i < m; i++) {
1430 for (j = 0; j < n; j++) {
1431 ost << p[i * n + j];
1432 if (j < n - 1) {
1433 ost << " & ";
1434 }
1435 }
1436 ost << "\\\\" << endl;
1437 }
1438 ost << "\\end{array}" << endl;
1439}
1440
1441void latex_interface::lint_matrix_print_tex(std::ostream &ost, long int *p, int m, int n)
1442{
1443 int i, j;
1444
1445 ost << "\\begin{array}{*{" << n << "}{c}}" << endl;
1446 for (i = 0; i < m; i++) {
1447 for (j = 0; j < n; j++) {
1448 ost << p[i * n + j];
1449 if (j < n - 1) {
1450 ost << " & ";
1451 }
1452 }
1453 ost << "\\\\" << endl;
1454 }
1455 ost << "\\end{array}" << endl;
1456}
1457
1459 std::ostream &ost, int *pts, int nb_pts,
1460 void (*point_label)(std::stringstream &sstr, int pt, void *data),
1461 void *point_label_data)
1462{
1463 int i, pt;
1464
1465 ost << "(";
1466 for (i = 0; i < nb_pts; i++) {
1467 pt = pts[i];
1468 stringstream sstr;
1469 (*point_label)(sstr, pt, point_label_data);
1470 ost << sstr.str();
1471 if (i < nb_pts - 1) {
1472 ost << ", ";
1473 }
1474 }
1475 ost << ")";
1476}
1477
1478void latex_interface::int_set_print_tex(std::ostream &ost, int *v, int len)
1479{
1480 int i;
1481
1482 ost << "\\{ ";
1483 for (i = 0; i < len; i++) {
1484 ost << v[i];
1485 if (i < len - 1)
1486 ost << ", ";
1487 }
1488 ost << " \\}";
1489}
1490
1491void latex_interface::lint_set_print_tex(std::ostream &ost, long int *v, int len)
1492{
1493 int i;
1494
1495 ost << "\\{ ";
1496 for (i = 0; i < len; i++) {
1497 ost << v[i];
1498 if (i < len - 1)
1499 ost << ", ";
1500 }
1501 ost << " \\}";
1502}
1503
1504void latex_interface::lint_set_print_tex_text_mode(std::ostream &ost, long int *v, int len)
1505{
1506 int i;
1507
1508 ost << "$\\{$ ";
1509 for (i = 0; i < len; i++) {
1510 ost << v[i];
1511 if (i < len - 1)
1512 ost << ", ";
1513 }
1514 ost << " $\\}$";
1515}
1516
1517void latex_interface::print_type_vector_tex(std::ostream &ost, int *v, int len)
1518// v[len + 1]
1519{
1520 int i, a;
1521 int f_first = TRUE;
1522
1523
1524 for (i = len; i >= 0; i--) {
1525 a = v[i];
1526 //ost << "$" << a;
1527 if (a == 0) {
1528 continue;
1529 }
1530 if (f_first) {
1531 f_first = FALSE;
1532 }
1533 else {
1534 ost << ",\\,";
1535 }
1536 ost << i;
1537 if (a > 9) {
1538 ost << "^{" << a << "}";
1539 }
1540 else if (a > 1) {
1541 ost << "^" << a;
1542 }
1543 }
1544}
1545
1547 int *v, int len,
1548 const char *mask_begin,
1549 const char *mask_end)
1550{
1551 int i;
1552
1553 ost << "\\{ ";
1554 for (i = 0; i < len; i++) {
1555 ost << mask_begin << v[i] << mask_end;
1556 if (i < len - 1)
1557 ost << ", ";
1558 }
1559 ost << " \\}";
1560}
1561
1562
1564 long int *v, int len,
1565 const char *mask_begin,
1566 const char *mask_end)
1567{
1568 int i;
1569
1570 ost << "\\{ ";
1571 for (i = 0; i < len; i++) {
1572 ost << mask_begin << v[i] << mask_end;
1573 if (i < len - 1)
1574 ost << ", ";
1575 }
1576 ost << " \\}";
1577}
1578
1579
1581 int *v, int len)
1582{
1583 int i;
1584
1585 ost << "\\{ ";
1586 for (i = 0; i < len; i++) {
1587 ost << v[i];
1588 if (i < len - 1)
1589 ost << ",$ $";
1590 }
1591 ost << " \\}";
1592}
1593
1595 long int *v, int len)
1596{
1597 int i;
1598
1599 ost << "\\{ ";
1600 for (i = 0; i < len; i++) {
1601 ost << v[i];
1602 if (i < len - 1)
1603 ost << ",$ $";
1604 }
1605 ost << " \\}";
1606}
1607
1609 const char *p, int max_len, int line_skip)
1610{
1611 const char *q = p;
1612 char c;
1613 int len = 0;
1614
1615 while ((c = *q) != 0) {
1616 if (c == '\t') {
1617 str << "\\>";
1618 len += 2;
1619 }
1620 else if (c == ' ') {
1621 str << "\\ ";
1622 len++;
1623 }
1624 else if (c == '\\') {
1625 str << "\\symbol{92}";
1626 len++;
1627 }
1628 else if (c == '\'') {
1629 str << "\\symbol{19}";
1630 len++;
1631 }
1632 else if (c == ',') {
1633 str << "\\symbol{44}";
1634 len++;
1635 }
1636 else if (c == '!') {
1637 str << "\\symbol{33}";
1638 len++;
1639 }
1640 else if (c == '"') {
1641 str << "\\symbol{34}";
1642 len++;
1643 }
1644 else if (c == '.') {
1645 str << ".";
1646 //str << "\\symbol{46}";
1647 len++;
1648 }
1649 else if (c == '-') {
1650 str << "\\symbol{45}";
1651 len++;
1652 }
1653 else if (c == '#') {
1654 str << "\\symbol{35}";
1655 len++;
1656 }
1657 else if (c == '$') {
1658 str << "\\symbol{36}";
1659 len++;
1660 }
1661 else if (c == '&') {
1662 str << "\\symbol{38}";
1663 len++;
1664 }
1665 else if (c == '~') {
1666 str << "\\symbol{126}";
1667 len++;
1668 }
1669 else if (c == '_') {
1670 str << "\\_";
1671 len++;
1672 }
1673 else if (c == '^') {
1674 str << "\\symbol{94}";
1675 len++;
1676 }
1677 else if (c == '%') {
1678 str << "\\symbol{37}";
1679 len++;
1680 }
1681 else if (c == '{') {
1682 str << "\\symbol{123}";
1683 len++;
1684 }
1685 else if (c == '}') {
1686 str << "\\symbol{125}";
1687 len++;
1688 }
1689 else if (c == '\n') {
1690 str << "\\\\[" << line_skip << "pt]\n";
1691 len = 0;
1692 }
1693 else {
1694 str << c;
1695 len++;
1696 }
1697 if (len > max_len) {
1698 str << "\n";
1699 len = 0;
1700 }
1701 q++;
1702 }
1703}
1704
1706 std::ostream &ost, int f_enter_math_mode,
1707 long int *row_class_size, int nb_row_classes,
1708 long int *col_class_size, int nb_col_classes,
1709 long int *row_scheme)
1710{
1711 int i, j;
1712
1713 ost << "%{\\renewcommand{\\arraycolsep}{1pt}" << endl;
1714 if (f_enter_math_mode) {
1715 ost << "$$" << endl;
1716 }
1717 ost << "\\begin{array}{r|*{" << nb_col_classes << "}{r}}" << endl;
1718 ost << "\\rightarrow ";
1719 for (j = 0; j < nb_col_classes; j++) {
1720 ost << " & ";
1721 ost << setw(6) << col_class_size[j];
1722 }
1723 ost << "\\\\" << endl;
1724 ost << "\\hline" << endl;
1725 for (i = 0; i < nb_row_classes; i++) {
1726 ost << setw(6) << row_class_size[i];
1727 for (j = 0; j < nb_col_classes; j++) {
1728 ost << " & " << setw(12) << row_scheme[i * nb_col_classes + j];
1729 }
1730 ost << "\\\\" << endl;
1731 }
1732 ost << "\\end{array}" << endl;
1733 if (f_enter_math_mode) {
1734 ost << "$$" << endl;
1735 }
1736 ost << "%}" << endl;
1737}
1738
1740 std::ostream &ost, int f_enter_math_mode,
1741 long int *row_class_size, int nb_row_classes,
1742 long int *col_class_size, int nb_col_classes,
1743 long int *col_scheme)
1744{
1745 int i, j;
1746
1747 ost << "%{\\renewcommand{\\arraycolsep}{1pt}" << endl;
1748 if (f_enter_math_mode) {
1749 ost << "$$" << endl;
1750 }
1751 ost << "\\begin{array}{r|*{" << nb_col_classes << "}{r}}" << endl;
1752 ost << "\\downarrow ";
1753 for (j = 0; j < nb_col_classes; j++) {
1754 ost << " & ";
1755 ost << setw(6) << col_class_size[j];
1756 }
1757 ost << "\\\\" << endl;
1758 ost << "\\hline" << endl;
1759 for (i = 0; i < nb_row_classes; i++) {
1760 ost << setw(6) << row_class_size[i];
1761 for (j = 0; j < nb_col_classes; j++) {
1762 ost << " & " << setw(12) << col_scheme[i * nb_col_classes + j];
1763 }
1764 ost << "\\\\" << endl;
1765 }
1766 ost << "\\end{array}" << endl;
1767 if (f_enter_math_mode) {
1768 ost << "$$" << endl;
1769 }
1770 ost << "%}" << endl;
1771}
1772
1773
1774}}}
1775
1776
int matrix_max_log_of_entries(long int *p, int m, int n)
Definition: lint_vec.cpp:176
void print_lint_matrix_with_labels(std::ostream &ost, long int *p, int m, int n, long int *row_labels, long int *col_labels, int f_tex)
void print_integer_matrix_tex_block_by_block(std::ostream &ost, int *p, int m, int n, int block_width)
void print_row_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math_mode, long int *row_class_size, int nb_row_classes, long int *col_class_size, int nb_col_classes, long int *row_scheme)
void latexable_string(std::stringstream &str, const char *p, int max_len, int line_skip)
void lint_matrix_print_with_labels_and_partition(std::ostream &ost, long int *p, int m, int n, int *row_labels, int *col_labels, int *row_part_first, int *row_part_len, int nb_row_parts, int *col_part_first, int *col_part_len, int nb_col_parts, void(*process_function_or_NULL)(long int *p, int m, int n, int i, int j, int val, std::string &output, void *data), void *data, int f_tex)
void print_lint_matrix_with_standard_labels(std::ostream &ost, long int *p, int m, int n, int f_tex)
void print_column_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math_mode, long int *row_class_size, int nb_row_classes, long int *col_class_size, int nb_col_classes, long int *col_scheme)
void print_integer_matrix_with_standard_labels_and_offset_text(std::ostream &ost, int *p, int m, int n, int m_offset, int n_offset)
void print_lint_matrix_with_standard_labels_and_offset(std::ostream &ost, long int *p, int m, int n, int m_offset, int n_offset, int f_tex)
void incma_latex_with_labels(std::ostream &fp, int v, int b, int V, int B, int *Vi, int *Bj, int *row_labels_int, int *col_labels_int, int *incma, int verbose_level)
void lint_set_print_masked_tex(std::ostream &ost, long int *v, int len, const char *mask_begin, const char *mask_end)
void print_cycle_tex_with_special_point_labels(std::ostream &ost, int *pts, int nb_pts, void(*point_label)(std::stringstream &sstr, int pt, void *data), void *point_label_data)
void int_matrix_print_tex(std::ostream &ost, int *p, int m, int n)
void print_lint_matrix_with_standard_labels_and_offset_tex(std::ostream &ost, long int *p, int m, int n, int m_offset, int n_offset)
void incma_latex(std::ostream &fp, int v, int b, int V, int B, int *Vi, int *Bj, int *incma, int verbose_level)
void print_lint_matrix_tex(std::ostream &ost, long int *p, int m, int n)
void lint_set_print_tex_for_inline_text(std::ostream &ost, long int *v, int len)
void lint_vec_print_as_matrix(std::ostream &ost, long int *v, int len, int width, int f_tex)
void print_integer_matrix_tex(std::ostream &ost, int *p, int m, int n)
void print_01_matrix_tex(std::ostream &ost, int *p, int m, int n)
void int_matrix_print_with_labels_and_partition(std::ostream &ost, int *p, int m, int n, int *row_labels, int *col_labels, int *row_part_first, int *row_part_len, int nb_row_parts, int *col_part_first, int *col_part_len, int nb_col_parts, void(*process_function_or_NULL)(int *p, int m, int n, int i, int j, int val, std::string &output, void *data), void *data, int f_tex)
void print_big_integer_matrix_tex(std::ostream &ost, int *p, int m, int n)
void lint_set_print_tex_text_mode(std::ostream &ost, long int *v, int len)
void int_set_print_tex_for_inline_text(std::ostream &ost, int *v, int len)
void lint_set_print_tex(std::ostream &ost, long int *v, int len)
void head(std::ostream &ost, int f_book, int f_title, const char *title, const char *author, int f_toc, int f_landscape, int f_12pt, int f_enlarged_page, int f_pagenumbers, const char *extras_for_preamble)
void print_integer_matrix_with_standard_labels(std::ostream &ost, int *p, int m, int n, int f_tex)
void print_integer_matrix_with_standard_labels_and_offset(std::ostream &ost, int *p, int m, int n, int m_offset, int n_offset, int f_tex)
void int_set_print_masked_tex(std::ostream &ost, int *v, int len, const char *mask_begin, const char *mask_end)
void head_easy_with_extras_in_the_praeamble(std::ostream &ost, const char *extras)
void print_integer_matrix_with_standard_labels_and_offset_tex(std::ostream &ost, int *p, int m, int n, int m_offset, int n_offset)
void incma_latex_with_text_labels(std::ostream &fp, graphics::draw_incidence_structure_description *Descr, int v, int b, int V, int B, int *Vi, int *Bj, int *incma, int f_labelling_points, std::string *point_labels, int f_labelling_blocks, std::string *block_labels, int verbose_level)
void print_longinteger_matrix_tex(std::ostream &ost, ring_theory::longinteger_object *p, int m, int n)
void print_lint_matrix_with_standard_labels_and_offset_text(std::ostream &ost, long int *p, int m, int n, int m_offset, int n_offset)
void lint_matrix_print_tex(std::ostream &ost, long int *p, int m, int n)
void print_integer_matrix_with_labels(std::ostream &ost, int *p, int m, int n, int *row_labels, int *col_labels, int f_tex)
void int_vec_print_as_matrix(std::ostream &ost, int *v, int len, int width, int f_tex)
graphics::draw_incidence_structure_description * Draw_incidence_structure_description
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_int(n)
Definition: foundations.h:625
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects