From 01a52e2300779ed411f9db3bc039656bac1d4699 Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Wed, 24 Jul 2019 10:10:36 -0700 Subject: HTML writer: ensure TeX formulas are rendered correctly (#5658) The web service passed in to `--webtex` may render formulas using inline or display style by default. Prefixing formulas with the appropriate command ensures they are rendered correctly. This is a followup to the discussion in #5656. --- src/Text/Pandoc/Writers/HTML.hs | 2 +- test/command/5655.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 84fd404b1..5484ebba9 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1064,7 +1064,7 @@ inlineToHtml opts inline = do let imtag = if html5 then H5.img else H.img let s = case t of InlineMath -> "\\textstyle " - DisplayMath -> "" + DisplayMath -> "\\displaystyle " let m = imtag ! A.style "vertical-align:middle" ! A.src (toValue $ url ++ urlEncode (s ++ str)) ! A.alt (toValue str) diff --git a/test/command/5655.md b/test/command/5655.md index de5a923ae..35987c10a 100644 --- a/test/command/5655.md +++ b/test/command/5655.md @@ -9,6 +9,6 @@ $T_n={n+1 \choose 2}$ % pandoc --webtex $$T_n={n+1 \choose 2}$$ ^D -


T_n={n+1 \choose 2}

+


T_n={n+1 \choose 2}

```` -- cgit v1.2.3