[R] Force Sweave to add figure filename extension

Duncan Murdoch murdoch.duncan at gmail.com
Wed Jun 1 16:18:29 CEST 2011


On 01/06/2011 10:13 AM, Renaud Gaujoux wrote:
> Hi,
>
> is there a way to force Sweave to add the extension (say .pdf) to the
> image names included by \includegraphics.
> I understand that the objective of not putting the extension is to allow
> the compilation with both latex or pdflatex.
> However, when option eps=false, the extension could optionally be forced
> to .pdf.
> I am having troubles submitting a paper to a journal, whose latex system
> does not compile the file properly if the extensions are not explicitly
> given.
> Thank you.

Name the chunk and use include=false, then put in your own 
\includegrpahics call.  For example

<<figname, fig=true, include=false>>=
plot(1:10)
@

\includegraphics{figname.pdf}

Duncan Murdoch

> Renaud
>
>
>
>
> ###
> UNIVERSITY OF CAPE TOWN
>
> This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:5}}
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list