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.
commit01a52e2300779ed411f9db3bc039656bac1d4699
authorPhilip Pesca <ppesca@ucsd.edu>
dateWed 24 Jul 2019, 10:10 (7 years ago)
parent060141b
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -1064,7 +1064,7 @@ inlineToHtml opts inline = do
10641064 let imtag = if html5 then H5.img else H.img
10651065 let s = case t of
10661066 InlineMath -> "\\textstyle "
1067− DisplayMath -> ""
1067+ DisplayMath -> "\\displaystyle "
10681068 let m = imtag ! A.style "vertical-align:middle"
10691069 ! A.src (toValue $ url ++ urlEncode (s ++ str))
10701070 ! A.alt (toValue str)
test/command/5655.md+1−1
@@ -9,6 +9,6 @@ $T_n={n+1 \choose 2}$
99% pandoc --webtex
1010$$T_n={n+1 \choose 2}$$
1111^D
12−<p><br /><img style="vertical-align:middle" src="https://latex.codecogs.com/png.latex?T_n%3D%7Bn%2B1%20%5Cchoose%202%7D" alt="T_n={n+1 \choose 2}" title="T_n={n+1 \choose 2}" /><br /></p>
12+<p><br /><img style="vertical-align:middle" src="https://latex.codecogs.com/png.latex?%5Cdisplaystyle%20T_n%3D%7Bn%2B1%20%5Cchoose%202%7D" alt="T_n={n+1 \choose 2}" title="T_n={n+1 \choose 2}" /><br /></p>
1313````
1414