gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/metacode latex.py latex2e.py umldoc.py umlr...


From: Asko Soukka
Subject: [Gzz-commits] gzz/metacode latex.py latex2e.py umldoc.py umlr...
Date: Thu, 13 Feb 2003 12:18:29 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    03/02/13 12:18:29

Modified files:
        metacode       : latex.py latex2e.py umldoc.py umlrst.py 

Log message:
        additional options

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/latex.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/latex2e.py.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umldoc.py.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umlrst.py.diff?tr1=1.36&tr2=1.37&r1=text&r2=text

Patches:
Index: gzz/metacode/latex.py
diff -u gzz/metacode/latex.py:1.1 gzz/metacode/latex.py:1.2
--- gzz/metacode/latex.py:1.1   Mon Feb  3 06:52:59 2003
+++ gzz/metacode/latex.py       Thu Feb 13 12:18:29 2003
@@ -1 +1,44 @@
+# 
+# Copyright (c) 2002, Asko Soukka, Benja Fallenstein
+# 
+# You may use and distribute under the terms of either the GNU Lesser
+# General Public License, either version 2 of the license or,
+# at your choice, any later version. Alternatively, you may use and
+# distribute under the terms of the XPL.
+# 
+# See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of
+# the licenses.
+# 
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the README
+# file for more details.
+# 
+
+import docutils
 from latex2e import Writer
+from docutils import nodes, utils
+from docutils.parsers.rst import directives
+from docutils.parsers.rst.directives import images
+
+align_values = ('top', 'middle', 'bottom', 'left', 'center', 'right')
+
+def align(argument):
+    return directives.choice(argument, align_values)
+
+def bibliography_directive(name, arguments, options, content, lineno,
+        content_offset, block_text, state, state_machine):
+    return [docutils.nodes.raw(
+        text='\n\\bibliographystyle{abbrv}\n\\bibliography{%s}\n' % 
','.join(arguments),
+        format='latex')]
+
+bibliography_directive.arguments = (1, 100, 0)
+bibliography_directive.options = {}
+bibliography_directive.content = 0
+directives._directives['bibliography'] = bibliography_directive
+
+#Some additional options and changes for latex2e.py
+images.image.options['height'] = directives.unchanged;
+images.image.options['width'] = directives.unchanged;
+images.image.options['label'] = directives.unchanged;
+images.image.options['option'] = directives.unchanged;
Index: gzz/metacode/latex2e.py
diff -u gzz/metacode/latex2e.py:1.28 gzz/metacode/latex2e.py:1.29
--- gzz/metacode/latex2e.py:1.28        Thu Feb 13 11:23:01 2003
+++ gzz/metacode/latex2e.py     Thu Feb 13 12:18:29 2003
@@ -3,8 +3,8 @@
 """
 :Author: Engelbert Gruber (hacked by the Gzz project)
 :Contact: address@hidden
-:Revision: $Revision: 1.28 $
-:Date: $Date: 2003/02/13 16:23:01 $
+:Revision: $Revision: 1.29 $
+:Date: $Date: 2003/02/13 17:18:29 $
 :Copyright: This module has been placed in the public domain.
 
 LaTeX2e document tree Writer.
@@ -426,8 +426,8 @@
     def visit_caption(self, node):
         self.body.append( '\\caption{\n' )
         for child in node.parent.children:
-            if child.attributes.has_key('alt'):
-                self.body.append('\\label{%s}\n' % child.attributes['alt'])
+            if child.attributes.has_key('label'):
+                self.body.append('\\label{%s}\n' % child.attributes['label'])
 
     def depart_caption(self, node):
         self.body.append('}')
@@ -762,10 +762,18 @@
             self.body.append(':]')
 
     def visit_figure(self, node):
-        self.body.append( '\\begin{figure}\n' )
+        self.body.append('\\begin{figure')
+        for child in node.children:
+            if child.attributes.has_key('option'):
+                self.body.append(child.attributes['option'])
+        self.body.append('}\n')
 
     def depart_figure(self, node):
-        self.body.append( "\n\\end{figure}\n" )
+        self.body.append('\n\\end{figure')
+        for child in node.children:
+            if child.attributes.has_key('option'):
+                self.body.append(child.attributes['option'])
+        self.body.append('}\n')
 
     def visit_footer(self, node):
         self.context.append(len(self.body))
Index: gzz/metacode/umldoc.py
diff -u gzz/metacode/umldoc.py:1.29 gzz/metacode/umldoc.py:1.30
--- gzz/metacode/umldoc.py:1.29 Mon Feb 10 08:54:13 2003
+++ gzz/metacode/umldoc.py      Thu Feb 13 12:18:29 2003
@@ -48,7 +48,7 @@
 """
 
 import sys, os.path
-import umltool, umlrst, mputils
+import umltool, umlrst, mputils, latex
 import docutils.core, docutils.parsers.rst
 
 # must be run in the main directory of gzz module
Index: gzz/metacode/umlrst.py
diff -u gzz/metacode/umlrst.py:1.36 gzz/metacode/umlrst.py:1.37
--- gzz/metacode/umlrst.py:1.36 Tue Feb 11 11:06:11 2003
+++ gzz/metacode/umlrst.py      Thu Feb 13 12:18:29 2003
@@ -40,19 +40,7 @@
     uml_refer_directive.content = 0
 
     docutils.parsers.rst.directives._directives['uml-refer'] = 
uml_refer_directive
-
-    bibliography_directive.arguments = (1, 100, 0)
-    bibliography_directive.options = {}
-    bibliography_directive.content = 0
     
-    docutils.parsers.rst.directives._directives['bibliography'] = 
bibliography_directive
-
-def bibliography_directive(name, arguments, options, content, lineno,
-        content_offset, block_text, state, state_machine):
-    return [docutils.nodes.raw(
-        text='\n\\bibliographystyle{abbrv}\n\\bibliography{%s}\n' % 
','.join(arguments),
-        format='latex')]
-
 def uml_directive(name, arguments, options, content, lineno,
         content_offset, block_text, state, state_machine):
     """




reply via email to

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