From: Guenter Milde <milde@us...>  20110627 21:04:51

On 20110627, <michael.abbott@...> wrote: > I'm trying to figure out the options for writing equations in reST, and > the possibilities appear to be to use either itex2MML or the latexmath > plugin from http://docutils.sourceforge.net/sandbox/jensj/latex_math/ You can also use a recent snapshot of the upcoming release 0.8 that includes math support into the core (incorporating and extending Jens Jörgens latex_math). > However, it seems that the latex generated by rst2latexmath.py (in the > tools directory of the link above) is incomplete. For example, running > the commands (latex_math.txt from the docs directory): > rst2latexmath.py latex_math.txt latex_math.tex > pdflatex latex_math.tex > complains about undefined symbols. To get latex_math.tex to build I > have to apply this patch: >  latex_math.tex.original 20110627 09:18:18.000000000 +0100 > +++ latex_math.tex 20110627 09:18:43.000000000 +0100 > @@ 14,9 +14,19 @@ > %%% Custom LaTeX preamble > % PDF Standard Fonts > \usepackage{mathptmx} % Times > +\usepackage{amsmath} > +\usepackage{amsfonts} > +\usepackage{amssymb} > \usepackage[scaled=.90]{helvet} > \usepackage{courier} I suppose it is documented somewhere that you need to add amsmath and amssymb to the list of stylesheets. The builtin "math" directive and role will automatically load the amsmath package but still requires you to specify amssymb (or an alternative like txfonts) in the stylesheet argument, say :: rst2latex stylesheet=amssymb mathexample.txt mathexample.tex > +\let\amalg=\undefined > +\let\coprod=\undefined > +\DeclareSymbolFont{cmsymbols}{OMS}{cmsy}{m}{n} > +\DeclareSymbolFont{cmlargesymbols}{OMX}{cmex}{m}{n} > +\DeclareMathSymbol{\amalg}{\mathbin}{cmsymbols}{"71} > +\DeclareMathSymbol{\coprod}{\mathop}{cmlargesymbols}{"60} What is the intention of these redefinitions? Are these fixes or defining variants? > Unfortunately, of course, I'm patching completely the wrong file here! > So two questions: > 1. How do I modify rst2latexmath.py so that the changes above occur in > the generated .tex file? I'm wholly unfamiliar with the docutils > plugin mechanism, so pointers to relevant documents will be > gratefully received. Dont, use the development version of Docutils (SVN checkout or daily snapshot). > 2. What's the state of play with equation support in reST, in > particular, should I pay more attention to the latexmath plugin or > to itex2MML? Or am I missing more recent work? Yes. > I'm not subscribed to this list, so *please* CC me. I am not sure whether this works via the Gmane usenet interface... Günter 