[Formed-commits] r363 - in trunk: . formed/formed/plugins/export

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon May 17 12:56:37 CEST 2010


Author: frank
Date: 2010-05-17 12:56:36 +0200 (Mon, 17 May 2010)
New Revision: 363

Modified:
   trunk/ChangeLog
   trunk/formed/formed/plugins/export/latex.py
Log:
Improved section labeling.

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-05-12 15:26:44 UTC (rev 362)
+++ trunk/ChangeLog	2010-05-17 10:56:36 UTC (rev 363)
@@ -1,4 +1,7 @@
-<<<<<<< .mine
+2010-05-17	Frank Koormann <frank.koormann at intevation.de>
+
+	* formed/formed/plugins/export/latex.py: Improved section labeling.
+
 2010-04-30  Torsten Irländer <torsten.irlaender at intevation.de>
 
 	* formed/formed/plugins/modify/rules.py (VariableType.substitute): Do
@@ -7,9 +10,9 @@
 2010-04-28	Roland Geider <roland.geider at intevation.de>
 
 	* formed/plugins/export/xls.py: Radiogroups are exported
-        * formed/plugins/export/xsd.py: WASKA formedtree.xml validates XSD
-        JMD formedtree.xml validates XSD
-        
+	* formed/plugins/export/xsd.py: WASKA formedtree.xml validates XSD
+	  JMD formedtree.xml validates XSD
+
 2010-04-08  Torsten Irländer <torsten.irlaender at intevation.de>
 
 	* formed/formed/plugins/modify/rules.py

Modified: trunk/formed/formed/plugins/export/latex.py
===================================================================
--- trunk/formed/formed/plugins/export/latex.py	2010-05-12 15:26:44 UTC (rev 362)
+++ trunk/formed/formed/plugins/export/latex.py	2010-05-17 10:56:36 UTC (rev 363)
@@ -86,7 +86,7 @@
     data.ChoiceNode:   "Auswahlliste"
 }
 
-SECTION_LEVEL = ["\\section", "\\subsection", "\\subsubsection", "\\paragraph"]
+SECTION_LEVEL = ["section", "subsection", "subsubsection", "paragraph"]
 
 class RecursiveExporter(ModeChecker):
 
@@ -95,8 +95,10 @@
         if not nc.isInvisible():
             d = min(4, d+1)
             print >> out, TABLE_FOOTER
-            print >> out, texize('%s{%s}\n%s' % (
-                SECTION_LEVEL[d-1], esc(nc.getDescription()), 
+            print >> out, texize('\\%s*{%s}\n' % (
+                            SECTION_LEVEL[d-1], esc(nc.getDescription())))
+            print >> out, texize('\\addcontentsline{toc}{%s}{%s}\n%s' % (
+                            SECTION_LEVEL[d-1], esc(nc.getDescription()), 
                                   esc(nc.getAnnotation())))
             print >> out, TABLE_HEADER
         return d
@@ -105,9 +107,11 @@
     def _matchPage(self, nc, out, d):
         d = min(4, d+1)
         print >> out, TABLE_FOOTER
-        print >> out, texize('%s{%s}\n%s' % (
-            SECTION_LEVEL[d-1], esc(nc.getDescription()), 
-                              esc(nc.getAnnotation())))
+        print >> out, texize('\\%s*{%s}\n' % (
+                           SECTION_LEVEL[d-1], esc(nc.getDescription())))
+        print >> out, texize('\\addcontentsline{toc}{%s}{%s}\n%s' % (
+                           SECTION_LEVEL[d-1], esc(nc.getDescription()), 
+                                 esc(nc.getAnnotation())))
         print >> out, TABLE_HEADER
         return d
 



More information about the Formed-commits mailing list