@@ -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