summaryrefslogtreecommitdiff
path: root/sandbox/cben
diff options
context:
space:
mode:
authorcben <cben@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2003-11-14 14:11:06 +0000
committercben <cben@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2003-11-14 14:11:06 +0000
commit7f8ce5e47646c4b11bf1fbb02bfbf544330e693c (patch)
tree33ac4f496239f65d0a167d320ac087c6f82a4f50 /sandbox/cben
parent330dd3602aef7b5d2af9dd18e3ab40909ec1c186 (diff)
downloaddocutils-7f8ce5e47646c4b11bf1fbb02bfbf544330e693c.tar.gz
- Added :class: and :alt: attributes.
- Doc fixes. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@1736 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'sandbox/cben')
-rwxr-xr-xsandbox/cben/rolehack/imgmathhack.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/sandbox/cben/rolehack/imgmathhack.py b/sandbox/cben/rolehack/imgmathhack.py
index fb014aa2e..feb8d179e 100755
--- a/sandbox/cben/rolehack/imgmathhack.py
+++ b/sandbox/cben/rolehack/imgmathhack.py
@@ -8,13 +8,14 @@ inline LaTeX math and the ``texmath::`` directive as display latex math.
running time when images are not changed and to reuse images for equal
fomulas, image names are md5 of the formula (hoping that no collisions
will happen) and images that already exist are not rebuilt. You should
- clean the ``imgmath``
+ purge the ``imgmath`` subdirectory manually to get rid of unused formulas.
You'll need:
- - ``tex_to_images`` (part of ``festival``, does anybody know a tool that
- is more commonly availiable? It's a Perl script which could be asily
- recoded in Python but I'm too lazy...). It, in turn, relies upon:
+ - ``tex_to_images``, part of ``speech_tools`` package, last version seems
+ to live at:
+ http://cvs.sourceforge.net/viewcvs.py/*checkout*/emu/speech_tools/scripts/tex_to_images.prl?rev=HEAD
+ It, in turn, relies upon:
- LaTeX
- ``dviselect`` (part of ``dviutils``)
@@ -61,9 +62,21 @@ class Tex_to_images(object):
os.remove(fpath + '.tmp')
return fpath + extension
def texmath(self, text):
- return 'image:: %s\n :align: middle\n' % (self.process(text),)
+ src = self.process(text)
+ return '''\
+image:: %(src)s
+ :align: middle
+ :class: texmath
+ :alt: %(text)s
+''' % locals()
def texdisplay(self, text):
- return 'image:: %s\n :align: center\n' % (self.process(text),)
+ src = self.process(text)
+ return '''\
+image:: %(src)s
+ :align: center
+ :class: texdisplay
+ :alt: %(text)s
+''' % locals()
child = Tex_to_images()
texmath = child.texmath