@@ -318,6 +318,10 @@ pandocToHtml opts (Pandoc meta blocks) = do
318318 defField "mathjaxurl"
319319 (T.takeWhile (/='?') u)
320320 _ -> defField "mathjax" False) $
321+ (case writerHTMLMathMethod opts of
322+ PlainMath -> defField "displaymath-css" True
323+ WebTeX _ -> defField "displaymath-css" True
324+ _ -> id) $
321325 defField "quotes" (stQuotes st) $
322326 -- for backwards compatibility we populate toc
323327 -- with the contents of the toc, rather than a
@@ -1108,14 +1112,11 @@ inlineToHtml opts inline = do
11081112 let s = case t of
11091113 InlineMath -> "\\textstyle "
11101114 DisplayMath -> "\\displaystyle "
1111− let m = imtag ! A.style "vertical-align:middle"
1112− ! A.src (toValue $ url <> T.pack (urlEncode (T.unpack $ s <> str)))
1113− ! A.alt (toValue str)
1114− ! A.title (toValue str)
1115− let brtag = if html5 then H5.br else H.br
1116− return $ case t of
1117− InlineMath -> m
1118− DisplayMath -> brtag >> m >> brtag
1115+ return $ imtag ! A.style "vertical-align:middle"
1116+ ! A.src (toValue $ url <> T.pack (urlEncode (T.unpack $ s <> str)))
1117+ ! A.alt (toValue str)
1118+ ! A.title (toValue str)
1119+ ! A.class_ mathClass
11191120 GladTeX ->
11201121 return $
11211122 customParent (textTag "eq") !
@@ -1142,11 +1143,7 @@ inlineToHtml opts inline = do
11421143 DisplayMath -> str
11431144 PlainMath -> do
11441145 x <- lift (texMathToInlines t str) >>= inlineListToHtml opts
1145− let m = H.span ! A.class_ mathClass $ x
1146− let brtag = if html5 then H5.br else H.br
1147− return $ case t of
1148− InlineMath -> m
1149− DisplayMath -> brtag >> m >> brtag
1146+ return $ H.span ! A.class_ mathClass $ x
11501147 (RawInline f str) -> do
11511148 ishtml <- isRawHtml f
11521149 if ishtml