git.iko.soy/typeable/pandoc
on master help sign in
Support Sphinx-style math in RST writer.

http://sphinx.pocoo.org/latest/ext/math.html

commitc7f6f779089e0336a7070cd2a9b614a8e98e9515 authorJohn MacFarlane <fiddlosopher@gmail.com> dateFri 30 Dec 2011, 23:51 (15 years ago) parentd8272d0
1 file changed+3−2
src/Text/Pandoc/Writers/RST.hs+3−2
src/Text/Pandoc/Writers/RST.hs+3−2
@@ -286,8 +286,9 @@ inlineToRST (Str str) = return $ text $ escapeString str
286286inlineToRST (Math t str) = do
287287 modify $ \st -> st{ stHasMath = True }
288288 return $ if t == InlineMath
289− then ":math:`$" <> text str <> "$`"
290− else ":math:`$$" <> text str <> "$$`"
289+ then ":math:`" <> text str <> "`\\ "
290+ else blankline $$ ".. math::" $$ blankline $$
291+ nest 3 (text str) $$ blankline
291292inlineToRST (RawInline _ _) = return empty
292293inlineToRST (LineBreak) = return cr -- there's no line break in RST
293294inlineToRST Space = return space