Why math notation in R markdown?


What notation system does R markdown use?


How to write math inline

Including math in a sentence involves wrapping the symbols in $ symbols. For example if you write this in an R markdown file:

“The intercept was estimated as $\hat{\alpha} = 4$

Then you get the following text after running knit2html or slidify on your document.

“The intercept was estimated as \( \hat{\alpha} = 4 \)”


How to write math on a separate line

Sometimes you have several equations you would like to line up. The way that you do that is with a double dollar sign \\[ and the align command. For example if you write Then you get the following text after running _knit2html_ or _slidify_ on your document. \] \begin{aligned} y &= \beta_0 + \beta_1 + x_1 + \epsilon\ x &= \gamma z \ z &\sim N(0,1) \end{aligned} $$


Common symbols


For more information