@@ -31,7 +31,6 @@ writers.
3131module Main where
3232import Text.Pandoc
3333import Text.Pandoc.UTF8
34−import Text.Pandoc.ASCIIMathML
3534import Text.Pandoc.Shared ( joinWithSep, tabsToSpaces )
3635import Text.Regex ( mkRegex, matchRegex )
3736import System.Environment ( getArgs, getProgName, getEnvironment )
@@ -102,7 +101,8 @@ data Opt = Opt
102101 , optNumberSections :: Bool -- ^ Number sections in LaTeX
103102 , optIncremental :: Bool -- ^ Use incremental lists in S5
104103 , optSmart :: Bool -- ^ Use smart typography
105− , optASCIIMathML :: Bool -- ^ Use ASCIIMathML in HTML
104+ , optUseASCIIMathML :: Bool -- ^ Use ASCIIMathML
105+ , optASCIIMathMLURL :: Maybe String -- ^ URL to ASCIIMathML.js
106106 , optDumpArgs :: Bool -- ^ Output command-line arguments
107107 , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
108108 , optStrict :: Bool -- ^ Use strict markdown syntax
@@ -129,7 +129,8 @@ defaultOpts = Opt
129129 , optNumberSections = False
130130 , optIncremental = False
131131 , optSmart = False
132− , optASCIIMathML = False
132+ , optUseASCIIMathML = False
133+ , optASCIIMathMLURL = Nothing
133134 , optDumpArgs = False
134135 , optIgnoreArgs = False
135136 , optStrict = False
@@ -195,9 +196,11 @@ options =
195196 "" -- "Use smart quotes, dashes, and ellipses"
196197
197198 , Option "m" ["asciimathml"]
198− (NoArg
199− (\opt -> return opt { optASCIIMathML = True,
200− optStandalone = True }))
199+ (OptArg
200+ (\arg opt -> return opt { optUseASCIIMathML = True,
201+ optASCIIMathMLURL = arg,
202+ optStandalone = True })
203+ "URL")
201204 "" -- "Use ASCIIMathML script in html output"
202205
203206 , Option "i" ["incremental"]
@@ -399,7 +402,8 @@ main = do
399402 , optNumberSections = numberSections
400403 , optIncremental = incremental
401404 , optSmart = smart
402− , optASCIIMathML = math
405+ , optUseASCIIMathML = useAsciiMathML
406+ , optASCIIMathMLURL = asciiMathMLURL
403407 , optDumpArgs = dumpArgs
404408 , optIgnoreArgs = ignoreArgs
405409 , optStrict = strict
@@ -455,11 +459,9 @@ main = do
455459 then ""
456460 else "<link rel=\"stylesheet\" href=\"" ++ css ++
457461 "\" type=\"text/css\" media=\"all\" />\n"
458− let asciiMathML = if math then asciiMathMLScript else ""
459462 let header = (if (customHeader == "DEFAULT")
460463 then defaultHeader
461− else customHeader) ++
462− csslink ++ asciiMathML ++ includeHeader
464+ else customHeader) ++ csslink ++ includeHeader
463465 let writerOptions = WriterOptions { writerStandalone = standalone &&
464466 (not strict),
465467 writerHeader = header,
@@ -468,6 +470,8 @@ main = do
468470 writerTableOfContents = toc &&
469471 (not strict) &&
470472 writerName/="s5",
473+ writerUseASCIIMathML = useAsciiMathML,
474+ writerASCIIMathMLURL = asciiMathMLURL,
471475 writerS5 = (writerName=="s5"),
472476 writerIgnoreNotes = False,
473477 writerIncremental = incremental,