bits

MathJax with Kramdown

Last week, GitHub Pages upgraded to Jekyll 3.0. One major consequence of the upgrade is that, for Jekyll sites hosted on GitHub Pages, only the kramdown engine is supported.

This broke my existing MathJax setup — I was using the redcarpet Markdown engine before, which understood math with the delimiters \\( \LaTeX \\) and \\[ \LaTeX \\] for inline and displayed math, respectively.

kramdown only recognizes $ \LaTeX $ for both inline and displayed math. This means that it will automatically infer whether you want inline or displayed math.

Here’s the live demo with inline LaTeX\LaTeX and displayed

LaTeX\LaTeX

This is an easy fix unless you have a lot of old posts with LaTeX to convert, in which case you should probably write a small converter script to switch your math delimiters to $$.

Keyboard

gh
go to home
gw
go to writing
gb
go to bits
gp
go to projects
j/k
move focus down/up in list
o
open focused item
t
toggle light/dark theme
?
show this help