Issues with latex math in markdown files, for display on Github Pages (using jekyll)
Our solution: use kramdown parser, with GFM option (Github flavored Markdown). In the .Rmd, use $$
for display math and $
for inline math. then have a script which turns the inline math demarkation in the .md file from $
into $$
when appropriate (avoiding data frame usage), before uploading the .md to Github. This way, RStudio preview looks the same as the Github Pages version.
- doesn't respect
$
or$$
(will parse characters within these, such as_
), but has workarounds: - has a useful option,
no_intra_emphasis
, so underscores between ascii characters are not converted to<em>
tags, so$x_1$
is fine - need to escape underscores after non-ascii characters, for example
$\mathbf{x}\_1$
- need to double escape curly bracket:
\\{