Closed GoogleCodeExporter closed 8 years ago
What syntax did you use to include the inline math? There is no standard
syntax for math in RST (to my knowledge -- this may be out of date), so the RST
reader doesn't read anything as math. (In particular, it doesn't assume that
text between $$ is math, as the pandoc markdown reader does.)
In the RST writer, we render math as follows:
:math:`$e=mc^2$`
It wouldn't be hard to adapt the RST reader to accept this kind of syntax, if
that would be useful.
It requires definition of the math role elsewhere in the document:
.. role:: math(raw)
:format: html latex
Original comment by fiddloso...@gmail.com
on 20 Jul 2010 at 5:39
Maybe I'm misunderstanding the spirit of the inline Math feature, but the
user's guide says, "Anything between two $ characters will be treated as TeX
math. The opening $ must have a character immediately to its right, while the
closing $ must have a character immediately to its left." To me, that says
that I should be able to write "$x$" in any input document format and have it
result in an Inline in the Pandoc AST representing an InlineMath object. Am I
off my rocker here?
In my RST document I used the "$...$" form. My modification to the RST parser
just copies the Markdown parser's behavior when parsing "$...$" and "$$...$$".
Original comment by drcyg...@gmail.com
on 20 Jul 2010 at 5:46
You're looking at the part of the README entitled "Pandoc's markdown vs.
standard markdown". It isn't meant to apply to RST, only to markdown.
Original comment by fiddloso...@gmail.com
on 20 Jul 2010 at 6:20
Ahh, fair enough. I didn't even notice that. In that case, I'll try (extended)
Markdown as my input format. I'm an RST fan but the math parsing is a must. :)
Sorry!
Original comment by drcyg...@gmail.com
on 20 Jul 2010 at 6:25
I suppose one could write an "extended RST" reader that parses "$...$"-style
math, although I'm not excited about opening that can of worms for every input
format. In any case, my motivation for wanting "$...$" is mostly that it's
easier to type that than the RST 'math' role repeatedly.
Original comment by drcyg...@gmail.com
on 20 Jul 2010 at 6:29
Original comment by fiddloso...@gmail.com
on 7 Dec 2010 at 4:43
Was the issue addressed in any way in the meantime?
Just defining a math role as proposed in comment 1 does not do the trick here
with me. The above example gives me a mere ":math:`\$e=mc\^{}2\$`" in the TeX
file.
I'd really appreciate math support in the ReST reader.
Regards,
Stefan
Original comment by s...@gmx.net
on 26 Sep 2011 at 2:52
There are quite a lot of Sphinx documents around, which use :math:`E = m c^2`
notations. See http://sphinx.pocoo.org/latest/ext/math.html
rst2latex supports such documents, but pandoc (1.8.2) does not (it deletes
displayed math altogether, and leaves inline math verbatim.
Original comment by s.astanin
on 26 Oct 2011 at 2:28
Math is now supported in RST reader & writer.
Original comment by fiddloso...@gmail.com
on 31 Dec 2011 at 7:43
Original issue reported on code.google.com by
drcyg...@gmail.com
on 19 Jul 2010 at 5:34