[Rd] SweaveInput + keep.source = TRUE trouble

Duncan Murdoch murdoch.duncan at gmail.com
Tue Oct 5 13:16:52 CEST 2010


On 05/10/2010 5:38 AM, Claudia Beleites wrote:
> Dear all,
> 
> I have trouble with R-beta sweaving files that include definitions with
> \SweaveInput in combination with keep.source = TRUE

Thanks for the report.  I'll take a look.

Duncan Murdoch

> 
> Symptom:
> SInput is taken from too far down the input file (the shift is the number of
> lines of the included file). Is that known? Searching didn't turn up anything, 
> yet I think there are more people than just me using keep.source.
> 
> Example:
> $ ~/tmp/R-beta/bin/R CMD Sweave baseline.Rnw &&
> mv baseline.tex baseline.devel.tex &&
> R CMD Sweave baseline.Rnw &&
> mv baseline.tex baseline.2.11.tex &&
> diff -u baseline.2.11.tex baseline.devel.tex
> 
> gives:
> --- baseline.2.11.tex	2010-10-05 11:33:49.000000000 +0200
> +++ baseline.devel.tex	2010-10-05 11:33:49.000000000 +0200
> @@ -83,7 +83,7 @@
>   \verb+\SweaveOpts{keep.source = TRUE}+
>   \begin{Schunk}
>   \begin{Sinput}
> -> 12
> +> line 54
>   \end{Sinput}
>   \begin{Soutput}
>   [1] 12
> @@ -106,7 +106,7 @@
>   line 63 chunk option keep.source = TRUE
>   \begin{Schunk}
>   \begin{Sinput}
> -> 14
> +> line 67
>   \end{Sinput}
>   \begin{Soutput}
>   [1] 14
> 
> I used yesterday's R-beta, and my system is Ubuntu 9.10 64 bit (though that 
> probably doesn't matter).
> 
> Building the example file I also found that \SweaveInput{} cannot be followed by 
> anything else on the line(not even a LaTeX comment).
> 
> \SweaveInput{x}y
> complains that file xy is not found.
> 
> Best regards,
> 
> Claudia Beleites
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list