Dear Group: After struggling with escape sequences using the LaTeX listings package (used by the R SweaveListingUtils package), I have come to the conclusing that listings' interaction with the LaTeX fancyvrb package prevents escapes such as plot(x) # See Figure \ref{my.plot} The only way I could solve the problem in general is to use a Perl script to pretty-print the R code, and to let Perl handle escapes. I have posted information about this at http://biostat.mc.vanderbilt.edu/SweaveTemplate along with an example pdf file. This involves the use of a modification of Sweave.sty which I've called Sweavel.sty, which also incorporates colors and boxes the R output. This process involves more user setup but ultimately allows much more control. Luckily latex and pdflatex implement the --shell-escape option to allow Perl and other programs to be executed on chunks of LaTeX code. Note that the Perl script s2latx.pl will be improved and replaced in the next few days to handle escapes with more generality. Regarding the issue of preventing Sweave from issuing the Gin option to set all graphics output to have a width of 0.8\textwidth, it's as easy as using \usepackage[nogin]{Sweave} or \usepackage[nogin]{Sweavel}. To force black and white output I implemented \usepackage[bw]{Sweavel}. The motive behind all this is to make Sweave produce output nice enough for a book. Our template page also has a concise way to use \figure environments. Frank -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University