[R] SweaveListingUtils question

Peter Ruckdeschel peter.ruckdeschel at web.de
Thu Jul 16 14:46:31 CEST 2009


Hi Karsten,

as you will know, SweaveListingUtils is a contributed package,
so it is a good habit to address the package maintainer (which
is me in this case) directly.

I clearly do not mind discussing this on r-help, but maybe
this already quite busy mailing list should not be bothered
too much with packages (like mine) which are "only" contributed.

A note for future questions:

In case of SweaveListingUtils (and similarly for other contributed
packages I am the maintainer of), this package is developped under
   r-forge,   https://r-forge.r-project.org
and on this platform, I have set up an archieved mailing list
devoted to package development of SweaveListingUtils:
   distr-swvlistutils at lists.r-forge.r-project.org
Please address this list for future questions concerning this package.

> recently I read about the SweaveListingUtils package and now I would
> like to try it out. However I can not make it run...

Let's see why...

> Below is a minimal example. The problem seems the following line,
> generated by the package:
>
> \ifthenelse{\boolean{Sweave at gin}}{\setkeys{Gin}{width=0.6\textwidth}}{}%

Actually, this is part of the TeX style file Sweave.sty shipped
out with R;  now for our special definitions of environments Sinput,
Soutput, and Scode, we decided to only insert those parts of Sweave.sty
which still are necessary and issue these ourselves within the output
of SweaveListingPreparations().

So we need to prevent Sweave() (the R command) to insert
a "\usepackage{Sweave}" before \begin{docoment} in order to avoid
redefinitions (which caused your error).

This can be done by inserting

%
% this comment persuades Sweave not to insert \usepackage{Sweave}
%

to your .Rnw / .Rtex file. (Sweave() will find this and think
this is not in comments...)
Then everything should work; hopefully, at least.

Kind regards,
Peter




More information about the R-help mailing list