Displaying 2 results from an estimated 2 matches for "commandchars".
2009 Jun 26
0
Modifying Sweave.sty to allow escapes with fancyvrb package in LaTeX
Dear Colleagues:
In an attempt to have things like # See page \pageref{this} inside
comments in R code chunks I have modified Sweave.sty as below. I have
followed fancyvrb's manual with regard to the use of the commandchars
argument. But when compiling with LaTeX (using attached test file) I
get a LaTeX error
(/usr/share/texmf-texlive/tex/latex/ae/t1aett.fd)
! Missing \endcsname inserted.
<to be read again>
\global
l.25 } else y <- 4
The line in question is
\DefineVerbatimEnvironmen...
2009 Mar 17
1
Combining Sweave and fancyvrb
...cond what I tried but didn't work.
\documentclass[12pt]{article}
\usepackage{/usr/local/R-2.7.0-inst/share/texmf/Sweave}
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{Rcode}{Verbatim}{%
commentchar=@,
frame=lines, label=\textrm{\bf R code}, numbers=left,
framesep=10pt, fontshape=sl, commandchars=\\\{\}}
\SweaveOpts{keep.source = TRUE}
\begin{document}
I would like to produce something like the following, but using Sweave. Note
the label on line \ref{Rcode:sum}.
\begin{Rcode}
> y <- c(53, 57, 66, 67, 72) # count data
> n <- length(y)
> s <- sum(y) \label{Rcode:sum}
\end{...