Discussion:
[hakyll] Troubles with MathJax rendering
Cliff Harvey
2015-04-10 13:41:15 UTC
Permalink
I'm pretty new to Hakyll, and liking it a lot so far overall.

But I'm having real trouble with the formula rendering. It uses unicode
symbols for most formulas, which is not sufficient for my purposes.
Interestingly, it does switch to MathJax for formulas involving matrices,
but then the dinky unicode formulas look even more silly next to the
proper-looking MathJax-formatted ones. Some blog posts I've googled up on
the subject (this
<http://jdreaver.com/posts/2014-06-22-math-programming-blog-hakyll.html>,
this <http://qnikst.github.io/posts/2013-02-04-hakyll-latex.html>)
mentioned setting the writer option: writerHTMLMathMethod = MathJax "".
But this hasn't had any affect at all that I can see.

Another problem I have is that, while MathJax wraps each equation in <p>
... </p> tags, the formulas I get from using $$ ... $$ in markdown files
actually surrounds the math with both <p> and a pair of <br> tags. The
result is quite an unnecessary amount of space surrounding each formula
when they do render with MathJax (I suppose this choice was made with the
unicode rendering in mind).

Both of these issues make me wonder if there isn't some way I could just
define my own delimiters, like say triple dollar signs, that could skip
markdown processing altogether and just surround that content with \[ ... \]
so that MathJax could work on it unimpeded. Does that sound possible?
Another hacky solution suggested here
<http://travis.athougies.net/posts/2013-08-13-using-math-on-your-hakyll-blog.html>
is simply to double up all the slashes in my latex code, which does produce
the desired result, but since Latex involves tons of slashes this will end
up being a frustratingly large amount of additional typing for something
that is supposed to be making life easier. So if there could be some
systematic way to bypass the markdown processing for certain blocks, maybe
that would do the trick. I tried using <pre> tags, by the way, but this
also caused MathJax to ignore these sections too, so that doesn't work.

So any help on this would be appreciated.
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...