Tag Info

New answers tagged

1

Use results='tex'. If you switch from Sweave to knitr, you probably need to read this page: http://yihui.name/knitr/demo/sweave/


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



Top 50 recent answers are included