yihui/knitr — Issue #135: [BUG] Font search fails when document class exceeds one line
Author: pank
Created: 2012-02-14 00:34:29+00:00
State: open

When \documenclass[.]{class} exceeds one line knitr will not find font declaration. The following is valid in LaTeX, but figur text is off. To test replace line 1:3 with `\documentclass[10pt,a4]{article}.'

\documentclass[10pt,
a4]
{article}
\usepackage{gfsartemisia-euler} %% or some other font
\begin{document}
\SweaveOpts{cache= FALSE, dev=tikz, external=TRUE}

<>=
library(ggplot2)
@
<>=
df1 <- data.frame(y=rnorm(100), x=rnorm(100))
@

<>=
ggplot(df1, aes(x = x1, y = y)) + geom_smooth() +
scale_x_continuous("$\\beta\\gamma\\delta$ and some txt")
@
$\beta\gamma\delta$ and some txt
\end{document}

This result is (naturally) dependent on the external switch.

Here is a screenshot
> http://ompldr.org/vY3Rhcw

I use the latest github version of Knitr. I produce my pdfs using the knit CMD tool on a GNU/Linux system.

BTW: Thanks for knitr. This is by far the coolest thing in R for a really long time!