diff trunk/src/docgen/page/latexwriter.d @ 457:33a4cb255fcc

Cached images, small fixes, reorganizing.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Tue, 30 Oct 2007 15:41:30 +0200
parents
children db7e27b5c180
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/src/docgen/page/latexwriter.d	Tue Oct 30 15:41:30 2007 +0200
@@ -0,0 +1,39 @@
+/**
+ * Author: Jari-Matti Mäkelä
+ * License: GPL3
+ */
+module docgen.page.latexwriter;
+
+import docgen.page.writer;
+import tango.io.FileConduit : FileConduit;
+
+/**
+ * Writes a LaTeX document skeleton.
+ */
+class LaTeXWriter : AbstractPageWriter!(1, "latex") {
+  this(PageWriterFactory factory, OutputStream[] outputs) {
+    super(factory, outputs);
+  }
+
+  void generateFirstPage() {
+    print.format(
+      templates["firstpage"],
+      factory.options.templates.paperSize,
+      factory.options.templates.title,
+      factory.options.templates.versionString,
+      docgen_version,
+      timeNow(),
+      factory.options.listing.literateStyle ? "" : "%"
+    );
+  }
+
+  void addList(char[][] contents, bool ordered) {
+    foreach(item; contents) {
+      switch(item) {
+        case "(": print(ordered ? "\\begin{enumerate}" : "\\begin{itemize}"); continue;
+        case ")": print(ordered ? "\\end{enumerate}" : "\\end{itemize}"); continue;
+        default: print("\\item")(item)(\n);
+      }
+    }
+  }
+}