Sounds like it should be a common problem, but I didn’t find an obvious trick.
Consider the knitr Rnw file below,
\documentclass[twocolumn, 12pt]{article}
\usepackage{graphicx}
\begin{document}
%\SweaveOpts{dev=pdf, fig.align=center}
\begin{figure*}
<<aaa, fig.width=8, fig.height=5, fig.show=hold>>=
plot(1,1)
@
\end{figure*}
\end{document}
I would like this wide figure to span two columns, using a {figure*} LaTeX environment. Is there a hook for that?
EDIT: wrapping the chunk in figure* gives the following output.

Two facts:
knitrmakes everything accessible for you, so LaTeX tricks are often unnecessary;chunkhook with which you can wrap your chunk results;A simple-minded solutions is:
I leave the rest of work to you to take care of more details in
options(e.g. whenoptions$fig.keep == 'none', you should not wrap the output infigure*). You may want to see how the defaultchunkhook for LaTeX is defined inknitrto know better how thechunkhook works.However, in this case, I tend to write the LaTeX code by myself in the document instead of automatically creating it. After you have got
figure*, you may start to think about\caption{}and\label{}(not hard, but I still want to see them in LaTeX).