Discussion:
[hakyll] Trouble with MathJax
Cliff Harvey
2015-04-10 14:38:27 UTC
Permalink
*[Second attempt sending this; hope it gets through]*

I've recently started using Hakyll, and I like it a lot so far overall.

However I'm having some serious trouble with the formula-rendering
behavior. First of all, the fact that it usually renders to unicode instead
of MathJax is a problem, since it's not sufficient for my purposes. I've
noticed it renders using MathJax when matrices are involved, but not
otherwise. Some blogs I've googled up have mentioned using the
writer option writerHTMLMathMethod = MathJax "", but it does not seem to
have any effect.

A second problem is that, while MathJax surrounds formulae with only a
single paragraph tag, Hakyll/Pandoc inserts a paragraph tag plus a pair of
br tags on either side. It looks like this was done based on what looks
good with unicode formula rendering, but with proper MathJax formulas, it
results in far too much space around the formulas.

One post
<http://travis.athougies.net/posts/2013-08-13-using-math-on-your-hakyll-blog.html>
suggested that I simply invoke MathJax in the usual way, except to double
up all slashes. While this does result in the correct output, it requires a
frustratingly large amount of extra typing for something that's supposed to
be making life easier. Writing latex code requires quite a lot of slashes,
after all.

These two related problems make me wonder if there isn't just some
systematic way I could implement my own delimiters to use instead of $$'s,
that would cause the surrounded text to skip markdown processing and
instead simply have \[ ... \] inserted, so that MathJax could work on it
unimpeded. Does that sound plausible? Or is there a better solution, like
making the $$'s behave this way, as they should anyway?

It seems that Pandoc/Hakyll is really working against me here, creating an
unnecessary problem where one doesn't have to exist. I'd very much like to
use Hakyll if I can figure out a solution to this. So I'd appreciate any
suggestions on how to address this. Thanks.
--
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.
Deepak Jois
2015-04-10 15:13:51 UTC
Permalink
Post by Cliff Harvey
t seems that Pandoc/Hakyll is really working against me here, creating an
unnecessary problem where one doesn't have to exist. I'd very much like to
use Hakyll if I can figure out a solution to this. So I'd appreciate any
suggestions on how to address this. Thanks.
I just finished setting up MathJax on by site. Here is a page[1]
containing some inline math, and here is the source[2]. I use '$'
(single dollar) as a delimiter for inline math.

[1]: http://www.deepak.jois.name/MOOCs/Cryptography
[2]: https://raw.githubusercontent.com/deepakjois/website/master/source/MOOCs/Cryptography.md

Here [3] is the modified pandoc compiler I am using to render the
output correctly.

[3]: https://github.com/deepakjois/website/blob/master/src/Site.hs#L110

Hope that helps.

Deepak
--
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.
Cliff Harvey
2015-04-10 17:14:25 UTC
Permalink
Thanks a lot! That does indeed do exactly what I need.

(Sorry for the double post. The first one didn't show up for a couple hours
so I assumed it was lost.)
--
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...