Dear all,
I have trouble with R-beta sweaving files that include definitions with
\SweaveInput in combination with keep.source = TRUE
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
--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Universit? degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste
phone: +39 0 40 5 58-37 68
email: cbeleites at units.it
-------------- next part --------------
A non-text attachment was scrubbed...
Name: baseline.devel.pdf
Type: application/pdf
Size: 52300 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-devel/attachments/20101005/1fce35b4/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: baseline.2.11.tex
Type: text/x-tex
Size: 1768 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-devel/attachments/20101005/1fce35b4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: baseline.devel.tex
Type: text/x-tex
Size: 1779 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-devel/attachments/20101005/1fce35b4/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: baseline.Rnw
URL:
<https://stat.ethz.ch/pipermail/r-devel/attachments/20101005/1fce35b4/attachment.pl>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vignettes.defs
URL:
<https://stat.ethz.ch/pipermail/r-devel/attachments/20101005/1fce35b4/attachment-0001.pl>
Sorry, I forgot the sessionInfos: devel: R version 2.12.0 beta (2010-10-03 r53154) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base 2.11: R version 2.11.1 (2010-05-31) x86_64-pc-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base Claudia Beleites wrote:> Dear all, > > I have trouble with R-beta sweaving files that include definitions with > \SweaveInput in combination with keep.source = TRUE > > 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-- Claudia Beleites Dipartimento dei Materiali e delle Risorse Naturali Universit? degli Studi di Trieste Via Alfonso Valerio 6/a I-34127 Trieste phone: +39 0 40 5 58-37 68 email: cbeleites at units.it
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 = TRUEThanks 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
This is fixed now in R-devel and the beta version. The fix isn't perfect: if you use \SweaveInput, you lose the error reporting that gives line numbers from the original file. It should be possible to have both, but I think the changes to implement that are too large to consider in a beta. Duncan Murdoch 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 > > 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