Fix display math with --webtex in markdown output.

Closes #3298.
This commit is contained in:
John MacFarlane
2016-12-11 17:00:58 +01:00
parent 0c029e8258
commit 7caaa5b2b6
+13 -9
View File
@@ -979,15 +979,19 @@ inlineToMarkdown opts (Math InlineMath str) =
inlineListToMarkdown opts $
(if plain then makeMathPlainer else id) $
texMathToInlines InlineMath str
inlineToMarkdown opts (Math DisplayMath str)
| isEnabled Ext_tex_math_dollars opts =
return $ "$$" <> text str <> "$$"
| isEnabled Ext_tex_math_single_backslash opts =
return $ "\\[" <> text str <> "\\]"
| isEnabled Ext_tex_math_double_backslash opts =
return $ "\\\\[" <> text str <> "\\\\]"
| otherwise = (\x -> cr <> x <> cr) `fmap`
inlineListToMarkdown opts (texMathToInlines DisplayMath str)
inlineToMarkdown opts (Math DisplayMath str) =
case writerHTMLMathMethod opts of
WebTeX url -> (\x -> blankline <> x <> blankline) `fmap`
inlineToMarkdown opts (Image nullAttr [Str str]
(url ++ urlEncode str, str))
_ | isEnabled Ext_tex_math_dollars opts ->
return $ "$$" <> text str <> "$$"
| isEnabled Ext_tex_math_single_backslash opts ->
return $ "\\[" <> text str <> "\\]"
| isEnabled Ext_tex_math_double_backslash opts ->
return $ "\\\\[" <> text str <> "\\\\]"
| otherwise -> (\x -> cr <> x <> cr) `fmap`
inlineListToMarkdown opts (texMathToInlines DisplayMath str)
inlineToMarkdown opts (RawInline f str) = do
plain <- asks envPlain
if not plain &&