From sfalcon at fhcrc.org  Wed Sep 20 17:35:37 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Wed, 20 Sep 2006 08:35:37 -0700
Subject: [Rd] Sweave processes \Sexpr in commented LaTeX
	source	(2.3.1patched	and 2.4.0)
In-Reply-To: <x2wt7y261y.fsf@viggo.kubism.ku.dk> (Peter Dalgaard's message of
	"20 Sep 2006 12:20:09 +0200")
References: <1158711280.5348.24.camel@localhost.localdomain>
	<17680.58131.594486.582029@celebrian.ci.tuwien.ac.at>
	<x2wt7y261y.fsf@viggo.kubism.ku.dk>
Message-ID: <m2psdq7dpy.fsf@ziti.local>

Peter Dalgaard <p.dalgaard at 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.
So ignoring LaTeX comment lines would solve two problems.

Best,

+ seth




[Rd] Sweave processes \Sexpr in commented LaTeX source (2.3.1patched and 2.4.0)
Seth Falcon