[R] Getting Rmarkdown to generate custom LaTEX environment

Huan Truong _ at tnhh.net
Wed Feb 25 03:28:26 CET 2015


Hi all,

I was struggling trying to make my Rmarkdown document to generate

\begin{figure*}

instead of

\begin{figure}

So that the figure spans on two columns (I'm using a custom template).

in my figure. I have read the Rmarkdown Reference Guide, and searched
for it on StackOverflow, and the general idea seems to be that I could
somehow pass the fig.env variable to the figure, but I have tried it
with no success: Something like this still doesn't have any effect
whatsoever on the latex code generated:

```{r test-plot, echo=FALSE, fig.cap = "Test
plot.\\label{fig:test-plot}", fig.env='figure*' }
options(fig.env='figure*')
plot(blah)
```

I know I must have missed something but couldn't figure out what I'm
missing after hours of struggling. Any help is much appreciated.

I have a smaller problem where I want to customize the [htbp] option
of the figure, and facing the same problem.

Cheers,
- Huan.






-- 

Eccentric Graduate Student
Google Talk/Jabber huant at tnhh.net - Website tnhh.net - Phone 1-858-848-ROFL



More information about the R-help mailing list