Tag Info

New answers tagged

4

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 +.


0

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


3

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) @


1

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