Alexindata Alexindata - 1 month ago 4
Markdown Question

What does $$ do in Rstudio markdown document?

I accidentally typed

somewhere in the markdown portion of my Rstudio markdown document and found that all downstream markdown coding had been turned off. It took me a while to trace the problem to the
, which appeared in dark-red color.

My question is what does
do? I have looked in markdown documentations and have not found any references to


$$ is a markup for math. See the relevant section in the pandoc manual. Everything written between two $$ markup will be interpreted as tex math (here is some documentation). Note that you can also use a single $ sign. $$ will produce a block element (a paragraph) while $ will produce an inline element. Thus, $$ is often used for equations.

Try for instance:

Here is an inline formula: $\frac{\alpha}{n}$ that shows...

Here is a standalone equation: $$x \approx \frac{\alpha}{n}$$