yihui/knitr — Issue #156: Possible Bug: fig.align = center + results = asis => Centered Text
Author: ramnathv
Created: 2012-02-29 14:53:25+00:00
State: open

Here is a reproducible document that illustrates the bug. Essentially, when you use `fig.align = center` and `results = asis`, the `centering` environment overflows to the text following the graph. I presume it happens because currently `knitr` wraps the figure as `\centering{}\includegraphics{...}`. A simple change to `{\centering \includegraphics{...}}` solves the issue.

```tex
\documentclass{article}

\begin{document}

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

\end{document}
```