We’ve just a made a change to the syntax for embedding MathJax equations in R Markdown documents. The change was made to eliminate some parsing ambiguities and to support future extensibility to additional formats.

The revised syntax adds a “latex” qualifier to the $ or $$ equation begin delimiter. It looks like this:

This change was the result of a few considerations:

Some users encountered situations where the $equation$ syntax recognized standard text as an equation. There was an escape sequence (\$) to avoid this but for users not explicitly aware of MathJax semantics this was too hard to discover.

The requirement to have no space between equation delimiters ($) and the equation body (intended to reduce parsing ambiguity) was also confusing for users.

We want to eventually support ASCIIMath and for this will require an additional qualifier to indicate the equation format.