From: Jens Mortensen <jensj@fy...>  20061220 13:10:26

On Tue, 20061219 at 15:34 0500, David Huard wrote: > If I understand correctly, I'd have to add the latexmath > role to rst/roles.py and the latexmath directive to the=20 > rst/directives directory and register it in the __init__. However, the > directives defined in Jens' sandbox are writer specific, so I'm a bit l= ost. You will have to merge the code from rst2mathml.py and rst2latexmath.py. I would start from the code in rst2mathml.py, where the node class (latex_math) will have to be changed to something like this: class latex_math(nodes.Element): tagname =3D '#latexmath' def __init__(self, rawsource, mathml_tree, latex): nodes.Element.__init__(self, rawsource) self.mathml_tree =3D mathml_tree self.latex =3D latex Also the latex_math_role function and the latex_math_directive class will have to be modified a bit to use the new node class. =20 And then the visit/depart methods should be added to the writers. Hope that helps, Jens J=C3=B8rgen > A little bit of context:=20 > The SciPy and NumPy folks are looking at the > various documentation systems out there to build the API documentation > and tutorials. Up to now, the combination epydoc+reST seems to most > powerful. However, Latex formulas are a must for those packages and the > raw role is a bit lowlevel for our needs, hence the interest in > including the latexmath role and directive in the trunk so that epydoc > can run smoothly using it. =20 