summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDebian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>2018-04-24 11:43:06 -0700
committerSean Whitton <spwhitton@spwhitton.name>2018-04-24 11:43:06 -0700
commit92bcf6e4b806a013e1889453468f2ed5565c3044 (patch)
tree6d070cfff74188da01aa1dfc066e32db17631021
parent209b2bd368a7b9287a1878a91e0cde54333eee9d (diff)
_online_latexmathml_default
Gbp-Pq: Name 1001_online_latexmathml_default.patch
-rw-r--r--man/pandoc.17
-rw-r--r--src/Text/Pandoc/App.hs11
-rw-r--r--src/Text/Pandoc/Options.hs2
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs2
4 files changed, 10 insertions, 12 deletions
diff --git a/man/pandoc.1 b/man/pandoc.1
index 7cac72e..d7f2290 100644
--- a/man/pandoc.1
+++ b/man/pandoc.1
@@ -1302,15 +1302,16 @@ Note that this option does not imply \f[C]\-\-katex\f[].
.RE
.TP
.B \f[C]\-m\f[] [\f[I]URL\f[]], \f[C]\-\-latexmathml\f[][\f[C]=\f[]\f[I]URL\f[]]
-\f[I]Deprecated.\f[] Use the LaTeXMathML script to display embedded TeX
+\f[I]Deprecated.\f[] Use LaTeXMathML to display embedded TeX
math in HTML output.
TeX math will be displayed between \f[C]$\f[] or \f[C]$$\f[] characters
and put in \f[C]<span>\f[] tags with class \f[C]LaTeX\f[].
The LaTeXMathML JavaScript will then change it to MathML.
Note that currently only Firefox and Safari (and select e\-book readers)
natively support MathML.
-To insert a link the \f[C]LaTeXMathML.js\f[] script, provide a
-\f[I]URL\f[].
+The \f[I]URL\f[] should point to the \f[C]LaTeXMathML.js\f[] load script.
+If a \f[I]URL\f[] is not provided, a link to LaTeXMathML.js at the
+Homepage of LaTeXMathML will be inserted.
.RS
.RE
.TP
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index 26c754c..b0f54b0 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -351,12 +351,6 @@ convertWithOpts opts = do
maybe return (addStringAsVariable "epub-cover-image")
(optEpubCoverImage opts)
>>=
- (\vars -> case optHTMLMathMethod opts of
- LaTeXMathML Nothing -> do
- s <- UTF8.toString <$> readDataFile "LaTeXMathML.js"
- return $ ("mathml-script", s) : vars
- _ -> return vars)
- >>=
(\vars -> if format == "dzslides"
then do
dztempl <- UTF8.toString <$> readDataFile
@@ -1396,7 +1390,10 @@ options =
(OptArg
(\arg opt -> do
deprecatedOption "--latexmathml, --asciimathml, -m" ""
- return opt { optHTMLMathMethod = LaTeXMathML arg })
+ let url' = case arg of
+ Just u -> u
+ Nothing -> "http://math.etsu.edu/LaTeXMathML/LaTeXMathML.js"
+ return opt { optHTMLMathMethod = LaTeXMathML url' })
"URL")
"" -- "Use LaTeXMathML script in html output"
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index bd4ab25..47ba262 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -104,7 +104,7 @@ defaultAbbrevs = Set.fromList
data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable, Generic)
data HTMLMathMethod = PlainMath
- | LaTeXMathML (Maybe String) -- url of LaTeXMathML.js
+ | LaTeXMathML String -- url of LaTeXMathML.js
| JsMath (Maybe String) -- url of jsMath load script
| GladTeX
| WebTeX String -- url of TeX->image script.
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 1647df7..6b9c433 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -259,7 +259,7 @@ pandocToHtml opts (Pandoc meta blocks) = do
notes <- footnoteSection opts (reverse (stNotes st))
let thebody = blocks' >> notes
let math = case writerHTMLMathMethod opts of
- LaTeXMathML (Just url) ->
+ LaTeXMathML url ->
H.script ! A.src (toValue url)
! A.type_ "text/javascript"
$ mempty