yihui/knitr — pull request #320 by cmmp (2012-07-08 19:02:35+00:00)
Title: Work on reusable chunk options, knitr issue #316

Hi yihui,

Could you review this code?

This is my work on the reusable chunk options feature, as we discussed on https://github.com/yihui/knitr/issues/316

Here's an example file:

article.Rnw:
```tex
\documentclass[a4paper]{article}

\begin{document}

\title{Test}

\maketitle

\section{Test}
Test...

<>=
opts_template$set(list('sidebyside' = list(fig.height = 4, fig.width = 5)))
@

<>=
plot(1:10,1:10)
@

<>=
plot(1:10,1:10)
@

\end{document}
```

Makefile:

```make
all:
R --slave -e "require(knitr); knit('article.Rnw')"
pdflatex article.tex
clean:
rm -f *.aux *.log *.tex *.pdf
```

I think that a page should be added with examples, such as this one, and referenced in the documentation of opts_template.

Best,
Cássio