Mercurial > projects > dil
annotate src/docgen/page/latexwriter.d @ 806:bcb74c9b895c
Moved out files in the trunk folder to the root.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sun, 09 Mar 2008 00:12:19 +0100 |
parents | trunk/src/docgen/page/latexwriter.d@db7e27b5c180 |
children |
rev | line source |
---|---|
457
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
1 /** |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
2 * Author: Jari-Matti Mäkelä |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
3 * License: GPL3 |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
4 */ |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
5 module docgen.page.latexwriter; |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
6 |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
7 import docgen.page.writer; |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
8 import tango.io.FileConduit : FileConduit; |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
9 |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
10 /** |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
11 * Writes a LaTeX document skeleton. |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
12 */ |
466
db7e27b5c180
Fixed parts of HTML output, some reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
457
diff
changeset
|
13 class LaTeXWriter : AbstractPageWriter!("latex", 1) { |
457
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
14 this(PageWriterFactory factory, OutputStream[] outputs) { |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
15 super(factory, outputs); |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
16 } |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
17 |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
18 void generateFirstPage() { |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
19 print.format( |
466
db7e27b5c180
Fixed parts of HTML output, some reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
457
diff
changeset
|
20 getTemplate("firstpage"), |
457
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
21 factory.options.templates.paperSize, |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
22 factory.options.templates.title, |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
23 factory.options.templates.versionString, |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
24 docgen_version, |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
25 timeNow(), |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
26 factory.options.listing.literateStyle ? "" : "%" |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
27 ); |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
28 } |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
29 |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
30 void addList(char[][] contents, bool ordered) { |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
31 foreach(item; contents) { |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
32 switch(item) { |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
33 case "(": print(ordered ? "\\begin{enumerate}" : "\\begin{itemize}"); continue; |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
34 case ")": print(ordered ? "\\end{enumerate}" : "\\end{itemize}"); continue; |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
35 default: print("\\item")(item)(\n); |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
36 } |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
37 } |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
38 } |
33a4cb255fcc
Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff
changeset
|
39 } |