@@ -79,6 +79,7 @@ import Text.Pandoc.Class (PandocIO, extractMedia, fillMediaBag, getLog,
7979 setResourcePath, withMediaBag)
8080import Text.Pandoc.Highlighting (highlightingStyles)
8181import Text.Pandoc.Lua (runLuaFilter)
82+import Text.Pandoc.Writers.Math (defaultMathJaxURL, defaultKaTeXURL)
8283import Text.Pandoc.PDF (makePDF)
8384import Text.Pandoc.Process (pipeProcess)
8485import Text.Pandoc.SelfContained (makeDataURI, makeSelfContained)
@@ -133,11 +134,11 @@ convertWithOpts opts = do
133134 Nothing -> return Nothing
134135 Just fp -> Just <$> UTF8.readFile fp
135136
136− let csscdn = "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css"
137137 let mathMethod =
138138 case (optKaTeXJS opts, optKaTeXStylesheet opts) of
139139 (Nothing, _) -> optHTMLMathMethod opts
140− (Just js, ss) -> KaTeX js (fromMaybe csscdn ss)
140+ (Just js, ss) -> KaTeX js (fromMaybe
141+ (defaultKaTeXURL ++ "katex.min.css") ss)
141142
142143
143144 -- --bibliography implies -F pandoc-citeproc for backwards compatibility:
@@ -1355,7 +1356,8 @@ options =
13551356 , Option "" ["mathjax"]
13561357 (OptArg
13571358 (\arg opt -> do
1358− let url' = fromMaybe "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_CHTML-full" arg
1359+ let url' = fromMaybe (defaultMathJaxURL ++
1360+ "MathJax.js?config=TeX-AMS_CHTML-full") arg
13591361 return opt { optHTMLMathMethod = MathJax url'})
13601362 "URL")
13611363 "" -- "Use MathJax for HTML math"
@@ -1364,7 +1366,7 @@ options =
13641366 (\arg opt ->
13651367 return opt
13661368 { optKaTeXJS =
1367− arg <|> Just "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js"})
1369+ arg <|> Just (defaultKaTeXURL ++ "katex.min.js")})
13681370 "URL")
13691371 "" -- Use KaTeX for HTML Math
13701372