git.iko.soy/typeable/pandoc
on master help sign in
`--mathml` and MathML in HTMLMathMethod longer take an argument.

The argument was for a bridge javascript that used to be necessary in 2004. We have removed the script already.

commit7018003811f2b606808ddecb5c1ce12e27ad7d51 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 30 Jan 2017, 11:31 (10 years ago) parent42257b9
7 files changed+15−26
MANUAL.txt+2−5 pandoc.hs+3−7 src/Text/Pandoc/Options.hs+1−1 src/Text/Pandoc/Writers/Docbook.hs+4−4 src/Text/Pandoc/Writers/EPUB.hs+1−1 src/Text/Pandoc/Writers/HTML.hs+2−6 src/Text/Pandoc/Writers/TEI.hs+2−2
MANUAL.txt+2−5
@@ -945,13 +945,10 @@ Math rendering in HTML
945945 several pages, it is much better to link to a copy of the script,
946946 so it can be cached.
947947
948−`--mathml`[`=`*URL*]
948+`--mathml`
949949
950950: Convert TeX math to [MathML] (in `docbook4`, `docbook5`,
951− `html4` and `html5`). In standalone HTML output, a small
952− JavaScript (or a link to such a script if a *URL* is
953− supplied) will be inserted that allows the MathML to be
954− viewed on some browsers.
951+ `html4` and `html5`).
955952
956953`--jsmath`[`=`*URL*]
957954
pandoc.hs+3−7
@@ -256,9 +256,6 @@ convertWithOpts opts args = do
256256 LaTeXMathML Nothing -> do
257257 s <- readDataFileUTF8 datadir "LaTeXMathML.js"
258258 return $ ("mathml-script", s) : variables
259− MathML Nothing -> do
260− s <- readDataFileUTF8 datadir "MathMLinHTML.js"
261− return $ ("mathml-script", s) : variables
262259 _ -> return variables
263260
264261 variables'' <- if format == "dzslides"
@@ -1110,10 +1107,9 @@ options =
11101107 "" -- "Use LaTeXMathML script in html output"
11111108
11121109 , Option "" ["mathml"]
1113− (OptArg
1114− (\arg opt ->
1115− return opt { optHTMLMathMethod = MathML arg })
1116− "URL")
1110+ (NoArg
1111+ (\opt ->
1112+ return opt { optHTMLMathMethod = MathML }))
11171113 "" -- "Use mathml for HTML math"
11181114
11191115 , Option "" ["mimetex"]
src/Text/Pandoc/Options.hs+1−1
@@ -89,7 +89,7 @@ data HTMLMathMethod = PlainMath
8989 | JsMath (Maybe String) -- url of jsMath load script
9090 | GladTeX
9191 | WebTeX String -- url of TeX->image script.
92− | MathML (Maybe String) -- url of MathMLinHTML.js
92+ | MathML
9393 | MathJax String -- url of MathJax.js
9494 | KaTeX String String -- url of stylesheet and katex.js
9595 deriving (Show, Read, Eq, Data, Typeable, Generic)
src/Text/Pandoc/Writers/Docbook.hs+4−4
@@ -117,8 +117,8 @@ writeDocbook opts (Pandoc meta blocks) = do
117117 main <- (render' . vcat) <$> (mapM (elementToDocbook opts' startLvl) elements)
118118 let context = defField "body" main
119119 $ defField "mathml" (case writerHTMLMathMethod opts of
120− MathML _ -> True
121− _ -> False)
120+ MathML -> True
121+ _ -> False)
122122 $ metadata
123123 return $ case writerTemplate opts of
124124 Nothing -> main
@@ -421,8 +421,8 @@ inlineToDocbook opts (Note contents) =
421421 inTagsIndented "footnote" <$> blocksToDocbook opts contents
422422
423423isMathML :: HTMLMathMethod -> Bool
424−isMathML (MathML _) = True
425−isMathML _ = False
424+isMathML MathML = True
425+isMathML _ = False
426426
427427idAndRole :: Attr -> [(String, String)]
428428idAndRole (id',cls,_) = ident ++ role
src/Text/Pandoc/Writers/EPUB.hs+1−1
@@ -382,7 +382,7 @@ pandocToEPUB version opts doc@(Pandoc meta _) = do
382382 , writerVariables = vars
383383 , writerHTMLMathMethod =
384384 if epub3
385− then MathML Nothing
385+ then MathML
386386 else writerHTMLMathMethod opts
387387 , writerWrapText = WrapAuto }
388388 metadata <- getEPUBMetadata opts' meta
src/Text/Pandoc/Writers/HTML.hs+2−6
@@ -230,10 +230,6 @@ pandocToHtml opts (Pandoc meta blocks) = do
230230 H.script ! A.src (toValue url)
231231 ! A.type_ "text/javascript"
232232 $ mempty
233− MathML (Just url) ->
234− H.script ! A.src (toValue url)
235− ! A.type_ "text/javascript"
236− $ mempty
237233 MathJax url ->
238234 H.script ! A.src (toValue url)
239235 ! A.type_ "text/javascript"
@@ -903,7 +899,7 @@ inlineToHtml opts inline = do
903899 return $ case t of
904900 InlineMath -> preEscapedString $ "<EQ ENV=\"math\">" ++ str ++ "</EQ>"
905901 DisplayMath -> preEscapedString $ "<EQ ENV=\"displaymath\">" ++ str ++ "</EQ>"
906− MathML _ -> do
902+ MathML -> do
907903 let conf = useShortEmptyTags (const False)
908904 defaultConfigPP
909905 res <- lift $ convertMath writeMathML t str
@@ -1061,6 +1057,6 @@ isMathEnvironment s = "\\begin{" `isPrefixOf` s &&
10611057
10621058allowsMathEnvironments :: HTMLMathMethod -> Bool
10631059allowsMathEnvironments (MathJax _) = True
1064−allowsMathEnvironments (MathML _) = True
1060+allowsMathEnvironments (MathML) = True
10651061allowsMathEnvironments (WebTeX _) = True
10661062allowsMathEnvironments _ = False
src/Text/Pandoc/Writers/TEI.hs+2−2
@@ -76,8 +76,8 @@ writeTEI opts (Pandoc meta blocks) = return $
7676 main = render' $ vcat (map (elementToTEI opts startLvl) elements)
7777 context = defField "body" main
7878 $ defField "mathml" (case writerHTMLMathMethod opts of
79− MathML _ -> True
80− _ -> False)
79+ MathML -> True
80+ _ -> False)
8181 $ metadata
8282 in case writerTemplate opts of
8383 Nothing -> main