Skip to content
Prev 22041 / 63424 Next

Sweave processes \Sexpr in commented LaTeX source (2.3.1patched and 2.4.0)

Peter Dalgaard <p.dalgaard at biostat.ku.dk> writes:
+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