Tag Info

New answers tagged


If you can not remove this (rather pointless) definition as it is being auto-generated, put \newcommand\mathplus{+} in your document preamble so that \mathplus expands to +.


I think this is the easiest option! ---- title: "Title" author: "Me" header-includes: - \usepackage{bbm} output: pdf_document ----


I have worked it out. In the character objects in R, the escape character also needs to be escaped. For example, using sanitize=FALSE (or omitted) in the knitr chunk, and using "\\$" works: <<fe, dev="tikz", fig.cap = "${}^{57}Fe spectrum$", echo=FALSE>>= plot(1:10, xlab="$\\lambda$", ylab="\\$", pch=20) @


I was getting this error too and it appeared to be because I had saved the .Rmd file in a different directory to R's default one. i.e, my default R directory is getwd() "C:/Users/Dave/Documents" When I create and run a .Rmd file from the default directory the maths symbols render fine. However, if I create and save a .Rmd file in a different directory ...

Top 50 recent answers are included