@@ -34,6 +34,7 @@ import Text.Pandoc
3434import Text.Pandoc.ODT
3535import Text.Pandoc.Writers.S5 (s5HeaderIncludes)
3636import Text.Pandoc.Templates (getDefaultTemplate)
37+import Text.Pandoc.LaTeXMathML (latexMathMLScript)
3738import Text.Pandoc.Shared ( HTMLMathMethod (..), tabFilter, ObfuscationMethod (..) )
3839#ifdef _HIGHLIGHTING
3940import Text.Pandoc.Highlighting ( languages )
@@ -261,8 +262,8 @@ options =
261262
262263 , Option "m" ["latexmathml", "asciimathml"]
263264 (OptArg
264− (\arg opt -> return opt { optHTMLMathMethod =
265− LaTeXMathML arg })
265+ (\arg opt ->
266+ return opt { optHTMLMathMethod = LaTeXMathML arg })
266267 "URL")
267268 "" -- "Use LaTeXMathML script in html output"
268269
@@ -641,6 +642,12 @@ main = do
641642 variables
642643 else return variables
643644
645+ variables'' <- case mathMethod of
646+ LaTeXMathML (Just _) -> do
647+ s <- latexMathMLScript
648+ return $ ("latexmathml-script", s) : variables'
649+ _ -> return variables'
650+
644651 let startParserState =
645652 defaultParserState { stateParseRaw = parseRaw,
646653 stateTabStop = tabStop,
@@ -660,7 +667,7 @@ main = do
660667 writerTemplate = if null template
661668 then defaultTemplate
662669 else template,
663− writerVariables = variables',
670+ writerVariables = variables'',
664671 writerIncludeBefore = concat befores,
665672 writerIncludeAfter = concat afters,
666673 writerTabStop = tabStop,