Re: [R] [Rd] Sweave processes \Sexpr in commented LaTeX source (2.3.1patched and 2.4.0)

From: Antonio, Fabio Di Narzo <antonio.fabio_at_gmail.com>
Date: Wed 20 Sep 2006 - 07:09:44 GMT

Hi.

2006/9/20, Marc Schwartz <MSchwartz@mn.rr.com>:
> Hi all,
>
> On FC5, using:
>
> Version 2.3.1 Patched (2006-08-06 r38829)
>
> and today's
>
> R version 2.4.0 alpha (2006-09-19 r39397)
>
> with the following .Rnw file:
>
>
> \documentclass[10pt]{article}
> \begin{document}
>
> This line should print '2': \Sexpr{1 + 1}
> %% This line should NOT print '2': \Sexpr{1 + 1}

If it's just a comment, why don't use something like: % \ Sexpr (del the space)
or
%\sexpr (change 'sexpr' with 'Sexpr')
or
%...the 'Sexpr' command (add a backslash in latex code) ?

Antonio.

>
> \end{document}
>
>
> The \Sexpr in the second line is processed even though the line is
> commented. This results in the following .tex file content (in the case
> of R 2.4.0):
>
>
> \documentclass[10pt]{article}
> \usepackage{/home/marcs/R.Files/SourceCode/R-alpha/share/texmf/Sweave}
> \begin{document}
>
> This line should print '2': 2
> %% This line should NOT print '2': 2
>
> \end{document}
>
>
>
> Shouldn't Sweave just generally ignore commented LaTeX code? In
> reviewing Sweave.R I did not see a check for this, so perhaps there are
> circumstances where one wants a \Sexpr in commented LaTeX code
> processed. An example escapes me at the moment however.
>
> HTH,
>
> Marc Schwartz
>
> ______________________________________________
> R-devel@r-project.org mailing list
>
https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-help@stat.math.ethz.ch 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. Received on Wed Sep 20 17:11:49 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 20 Sep 2006 - 16:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.