Make Sweave or knitr put graphics suffix in `\includegraphics{}`

Viewed 1226

I just run into the (curious) problem that when submitting a (pdf)LaTeX manuscript to some Elsevier journal the filenames of figures needed to be complete in order to found by their pdf building and checking syste, i.e.:

\includegraphics{picture.pdf}

Is there any easy and convenient way to tell Sweave or knitr to do that?

Edit:

  • I'm familiar with sweave's include=FALSE option
  • I also feel quite capable to patch utils:::RweaveLatexRuncode

However, for the moment I'm hoping that there's something more convenient and elegant.

It's also about handing out the .Rnw files as supplementary material or vignettes. From a didactic point of view I don't like these tweaks that make the source code much more complicated for the new users of whom I hope they read it.

(Which is also why I really appreciate the recently introduced print=TRUE in Sweave)

2 Answers
Related