[Rd] Sweave processes comments incorrectly (PR#9073)

From: <krc_at_mdacc.tmc.edu>
Date: Tue 11 Jul 2006 - 14:46:02 GMT


Full_Name: Kevin R. Coombes
Version: 2.1.0
OS: Windows XP
Submission from: (NULL) (143.111.22.24)

I have a source file "devel.Rnw" that uses the LaTeX foils class and ppower4 to produce a PDF presentation file. It starts with a commented note to myself as follows:

%%%% begin source example %%%%
%
% Remember to update the hypersetup to include individual lecture
% titles, change the leftheader to include the lecture title, and
% then start at \begin{document} ....
% Also, produce a printable (black and white version) according
% to the cues immediately following \begin{document}.
% Compile this document with:
% pdflatex <filename>.tex
% and then:
% ppower4pb <filename>.pdf <filename>.pdf
%

\documentclass[Screen4to3,25pt,headrule,footrule]{foils}
\usepackage[pdftex]{color}                  %for colors
\definecolor{Teal}{rgb}{0.0,0.47,0.46}

%% more colors and packages omitted from bug report
\begin{document}
\hypersetup{pdfpagetransition=Replace}

%%%% end source example %%%%

When processed using Sweave, the \begin{document} comments are expanded to actual LaTeX commands, causing a later latex to fail. That is, the output of running Sweave() on this file begins:

%%%% begin source example %%%%
%
% Remember to update the hypersetup to include individual lecture
% titles, change the leftheader to include the lecture title, and
% then start at \usepackage{c:/R/rw2010/share/texmf/Sweave}
\begin{document} ....
% Also, produce a printable (black and white version) according
% to the cues immediately following

\usepackage{c:/R/rw2010/share/texmf/Sweave} \begin{document}.
% Compile this document with:
% pdflatex <filename>.tex
% and then:
% ppower4pb <filename>.pdf <filename>.pdf
\documentclass[Screen4to3,25pt,headrule,footrule]{foils}

\usepackage[pdftex]{color}                  %for colors

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Jul 12 01:58:33 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 12 Jul 2006 - 10:27:26 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.