gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/metacode latex2e.py umlrst.py


From: Asko Soukka
Subject: [Gzz-commits] gzz/metacode latex2e.py umlrst.py
Date: Tue, 11 Feb 2003 11:06:12 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    03/02/11 11:06:11

Modified files:
        metacode       : latex2e.py umlrst.py 

Log message:
        labeling figures

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/latex2e.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umlrst.py.diff?tr1=1.35&tr2=1.36&r1=text&r2=text

Patches:
Index: gzz/metacode/latex2e.py
diff -u gzz/metacode/latex2e.py:1.14 gzz/metacode/latex2e.py:1.15
--- gzz/metacode/latex2e.py:1.14        Tue Feb 11 09:59:42 2003
+++ gzz/metacode/latex2e.py     Tue Feb 11 11:06:11 2003
@@ -3,8 +3,8 @@
 """
 :Author: Engelbert Gruber (hacked by the Gzz project)
 :Contact: address@hidden
-:Revision: $Revision: 1.14 $
-:Date: $Date: 2003/02/11 14:59:42 $
+:Revision: $Revision: 1.15 $
+:Date: $Date: 2003/02/11 16:06:11 $
 :Copyright: This module has been placed in the public domain.
 
 LaTeX2e document tree Writer.
@@ -759,7 +759,7 @@
         self.body.append( '\\begin{figure}\n' )
 
     def depart_figure(self, node):
-        self.body.append( '\\end{figure}\n' )
+        self.body.append( "n\\end{figure}\n" )
 
     def visit_footer(self, node):
         self.context.append(len(self.body))
@@ -837,11 +837,11 @@
     def visit_image(self, node):
         atts = node.attributes.copy()
         href = atts['uri']
-        self.body.append('\n\\centering\n')
-        if atts.has_key('width'):
-            self.body.append('\n\\includegraphics[width=%s]{%s}\n' % 
(atts['width'], href))
-        else:
-            self.body.append('\n\\includegraphics{%s}\n' % href)
+        self.body.append('\\centering\n')
+        if atts.has_key('alt'): self.body.append('\\label{%s}\n' % atts['alt'])
+        self.body.append('\\includegraphics')
+        if atts.has_key('width'): self.body.append('[width=%s]' % 
atts['width'])
+        self.body.append('{%s}\n' % href)
         ##self.body.append('\\end{center}\n')
 
     def depart_image(self, node):
Index: gzz/metacode/umlrst.py
diff -u gzz/metacode/umlrst.py:1.35 gzz/metacode/umlrst.py:1.36
--- gzz/metacode/umlrst.py:1.35 Tue Feb 11 08:26:47 2003
+++ gzz/metacode/umlrst.py      Tue Feb 11 11:06:11 2003
@@ -28,6 +28,8 @@
     uml_directive.arguments = (1, 0, 0)
     uml_directive.options = {'caption': 
docutils.parsers.rst.directives.unchanged,
                              'width': 
docutils.parsers.rst.directives.unchanged,
+                             'alt': docutils.parsers.rst.directives.unchanged,
+                             'label': 
docutils.parsers.rst.directives.unchanged,
                              }
     uml_directive.content = 1
 
@@ -64,7 +66,8 @@
     #print trans
     src = trans+attributes['name']+"_gen.eps"
     options['uri'] = src
-    options['alt'] = "UML: "+attributes['name']
+    if options.has_key('label'): options['alt'] = options['label']
+    if not options.has_key('alt'): options['alt'] = "UML: "+attributes['name']
     options['_uml'] = attributes['name']
     uml_node = docutils.nodes.image(src, **options)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]