Having this code in a test.md file
$$
\begin{aligned}
20x 1 \leqt 70
\end{aligned}
$$
When I use RStudio button Preview Html the equation is well formatted using Mathjax.
But when I try to do it using markdownToHTML function:
for example
markdownToHTML('test.md', 'test.html'),
the equation is not formatted.
The bug is due to the extra blank line after my equation( I can’t remove it because the equation is generated using an R chunk and the cat command)
Does Rstudio does any post-processing on .md files to remove blank lines between $$ ?
For RStudio, we actually have our own version of the markdown package embedded which does the conversion from .md to .html. I tried your scenario and was able to reproduce as well. I recommend reporting this to Jeff Horner to see if there is a bug here that he can fix:
http://cran.r-project.org/web/packages/markdown/index.html
https://github.com/rstudio/markdown
Josh
Product Manager – RStudio