Rendering markdown for a Github Pages website
One problem I ran into trying to write posts for this website was that R Markdown uses Pandoc to render Markdown documents, but Github Pages only supports Kramdown. I learned this the hard way when I edited my config.yml
file to use Pandoc instead of Kramdown, based on this advice. You will be able to build your page locally with build exec jekyll serve
but once you push everything to Github the page will fail to build.
There are slight differences between Pandoc and Kramdown for writing math symbols and footnotes.
-
Kramdown doesn’t recognize single dollar signs for inline math i.e.
$...$
won’t work. You have to use$$...$$
. It does mean that when you Knit your html file the expression will be displayed in a new line, although it will still appear inline when you build the page locally. -
In Pandoc you can write inline footnotes with
^[My inline footnote]
, but Kramdown doesn’t parse that as a footnote. This isn’t too convenient; you can still use the usual footnote syntax.
Leave a Comment