@@ -457,8 +457,13 @@ blockToHtml opts (Div attr@(_,classes,_) bs) = do
457457 NoSlides -> addAttrs opts' attr $ H.div $ contents'
458458 _ -> mempty
459459 else addAttrs opts attr $ H.div $ contents'
460−blockToHtml _ (RawBlock f str)
460+blockToHtml opts (RawBlock f str)
461461 | f == Format "html" = return $ preEscapedString str
462+ | f == Format "latex" =
463+ case writerHTMLMathMethod opts of
464+ MathJax _ -> do modify (\st -> st{ stMath = True })
465+ return $ toHtml str
466+ _ -> return mempty
462467 | otherwise = return mempty
463468blockToHtml opts (HorizontalRule) = return $ if writerHtml5 opts then H5.hr else H.hr
464469blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
@@ -769,6 +774,8 @@ inlineToHtml opts inline =
769774 case writerHTMLMathMethod opts of
770775 LaTeXMathML _ -> do modify (\st -> st {stMath = True})
771776 return $ toHtml str
777+ MathJax _ -> do modify (\st -> st {stMath = True})
778+ return $ toHtml str
772779 _ -> return mempty
773780 | f == Format "html" -> return $ preEscapedString str
774781 | otherwise -> return mempty