Closed locallycompact closed 4 years ago
Not positive, but I suspect the issue is with the Reader, not the writer. You'll probably need to enable one or more of the tex extensions.
You can edit ReaderOptions
to include extra extensions then pass them into the markdown reader.
Hopefully that'll sort you out :+1:, the default markdown reader is basically just for Github Markdown, so if you want more extensions you just need to pass them as options 😄
@locallycompact You need something like this:
readerOptions :: ReaderOptions
readerOptions = def { readerExtensions = exts }
where
exts = mconcat
[extensionsFromList [Ext_tex_math_single_backslash], pandocExtensions]
writerOptions :: WriterOptions
writerOptions = def { writerExtensions = exts
, writerHTMLMathMethod = KaTeX defaultKaTeXURL
, writerSectionDivs = True
, writerTemplate = Just $ T.unpack tmpl
}
where
exts = mconcat [extensionsFromList [Ext_smart], getDefaultExtensions "html5"]
Here I've used KaTeX
rather than MathJax
, but the idea is the same. (You'll want to use defaultMathJaxURL
rather than defaultKaTeXURL
, as well.)
You can ignore the writerTemplate
and writerSectionDivs
; I needed those to get the Tufte CSS Pandoc stuff to render properly.
Hi, I've been experimenting with a fork of this for gitlab here. I thought that this commit might work to enable MathJax, but it doesn't (output here). What's the right idea?