diff options
-rw-r--r-- | src/Text/Pandoc/LaTeXMathML.hs | 3 | ||||
-rw-r--r-- | src/pandoc.hs | 13 | ||||
-rw-r--r-- | templates/html.template | 8 | ||||
-rw-r--r-- | templates/latex.template | 2 |
4 files changed, 19 insertions, 7 deletions
diff --git a/src/Text/Pandoc/LaTeXMathML.hs b/src/Text/Pandoc/LaTeXMathML.hs index 8cdd3cd21..020d626c0 100644 --- a/src/Text/Pandoc/LaTeXMathML.hs +++ b/src/Text/Pandoc/LaTeXMathML.hs @@ -6,11 +6,8 @@ import Text.Pandoc.Shared (readDataFile) -- | String containing LaTeXMathML javascript. latexMathMLScript :: IO String -latexMathMLScript = undefined -{- latexMathMLScript = do jsCom <- readDataFile $ "data" </> "LaTeXMathML.js.comment" jsPacked <- readDataFile $ "data" </> "LaTeXMathML.js.packed" return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++ "</script>\n" --} diff --git a/src/pandoc.hs b/src/pandoc.hs index 431a41836..69c7ad895 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -34,6 +34,7 @@ import Text.Pandoc import Text.Pandoc.ODT import Text.Pandoc.Writers.S5 (s5HeaderIncludes) import Text.Pandoc.Templates (getDefaultTemplate) +import Text.Pandoc.LaTeXMathML (latexMathMLScript) import Text.Pandoc.Shared ( HTMLMathMethod (..), tabFilter, ObfuscationMethod (..) ) #ifdef _HIGHLIGHTING import Text.Pandoc.Highlighting ( languages ) @@ -261,8 +262,8 @@ options = , Option "m" ["latexmathml", "asciimathml"] (OptArg - (\arg opt -> return opt { optHTMLMathMethod = - LaTeXMathML arg }) + (\arg opt -> + return opt { optHTMLMathMethod = LaTeXMathML arg }) "URL") "" -- "Use LaTeXMathML script in html output" @@ -641,6 +642,12 @@ main = do variables else return variables + variables'' <- case mathMethod of + LaTeXMathML (Just _) -> do + s <- latexMathMLScript + return $ ("latexmathml-script", s) : variables' + _ -> return variables' + let startParserState = defaultParserState { stateParseRaw = parseRaw, stateTabStop = tabStop, @@ -660,7 +667,7 @@ main = do writerTemplate = if null template then defaultTemplate else template, - writerVariables = variables', + writerVariables = variables'', writerIncludeBefore = concat befores, writerIncludeAfter = concat afters, writerTabStop = tabStop, diff --git a/templates/html.template b/templates/html.template index 993115ab9..9a5f3ce95 100644 --- a/templates/html.template +++ b/templates/html.template @@ -7,7 +7,13 @@ /><meta name="generator" content="pandoc" /><meta name="author" content="$authors$" /><meta name="date" content="$date$" - />$header-includes$ + /> + $if(latexmathml-script)$ + $latexmathml-script$ + $endif$ + $if(header-includes)$ + $header-includes$ + $endif$ </head ><body > diff --git a/templates/latex.template b/templates/latex.template index d9dc8e5ff..82303f5e8 100644 --- a/templates/latex.template +++ b/templates/latex.template @@ -33,7 +33,9 @@ $if(numbersections)$ $else$ \setcounter{secnumdepth}{0} $endif$ +$if(header-includes)$ $header-includes$ +$endif$ $if(title)$ \title{$title$} |