[Python-checkins] r63372 - in doctools/trunk: CHANGES sphinx/latexwriter.py

georg.brandl python-checkins at python.org
Fri May 16 15:36:49 CEST 2008


Author: georg.brandl
Date: Fri May 16 15:36:49 2008
New Revision: 63372

Log:
#2794: Handle figure directive in LaTeX.


Modified:
   doctools/trunk/CHANGES
   doctools/trunk/sphinx/latexwriter.py

Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES	(original)
+++ doctools/trunk/CHANGES	Fri May 16 15:36:49 2008
@@ -16,6 +16,8 @@
 
 * Fix the LaTeX output of description units with multiple signatures.
 
+* Handle the figure directive in LaTeX output.
+
 
 Release 0.3 (May 6, 2008)
 =========================

Modified: doctools/trunk/sphinx/latexwriter.py
==============================================================================
--- doctools/trunk/sphinx/latexwriter.py	(original)
+++ doctools/trunk/sphinx/latexwriter.py	Fri May 16 15:36:49 2008
@@ -626,6 +626,16 @@
     def depart_image(self, node):
         pass
 
+    def visit_figure(self, node):
+        self.body.append('\\begin{figure}\n')
+    def depart_figure(self, node):
+        self.body.append('\\end{figure}\n')
+
+    def visit_caption(self, node):
+        self.body.append('\\caption{')
+    def depart_caption(self, node):
+        self.body.append('}')
+
     def _make_visit_admonition(name):
         def visit_admonition(self, node):
             self.body.append('\n\\begin{notice}[%s]' % name)


More information about the Python-checkins mailing list