Re: [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 - 16:47:33 GMT

2006/9/20, Seth Falcon <sfalcon@fhcrc.org>:
> Peter Dalgaard <p.dalgaard@biostat.ku.dk> writes:
> > ..not to mention TeX comments inside Sexpr (e.g. %*%...). Skipping
> > lines with % as the first character might be a viable compromise
> > though.
>
> +1. You could probably ignore any lines where the first
> non-whitespace char is '%'. But if that seems to risky, then only
> recognizing first-char-is-% seems a worthwhile heuristic.
>
> Another place where this has bitten people is when they do:
>
> %\usepackage{Sweave}
>
> Sweave picks that up and doesn't insert the usepackage line itself.

I've found that extremely useful for sweaving Stex files which aren't "master" files (i.e., only files to include in a main latex file). Inserting '\usepackage{Sweave}' in each would result in a latex error. So commenting it out is a useful workaround.

Antonio.

> So ignoring LaTeX comment lines would solve two problems.
>
> Best,
>
> + seth
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Sep 21 02:58:41 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 - 17:30:08 GMT.

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