Have it for now ... \preformatted{ .. }
does the job. On Wed, Nov 28, 2012 at 9:21 PM, Ulrich Staudinger <ustaudin...@gmail.com> wrote: > Hi everyone, > > following the gentle advice from this list, I write a package > description Rd file. > > I have a section in there. In this section, I have a subsection. In > this subsection, I want to have a code fragment. This code fragment > should include several commands, spanning several lines. > > Example: > ========== > \name{aqr-package} > \alias{aqr-package} > \alias{aqr} > \docType{package} > \title{Package level introduction} > \description{description goes here.} > > \section{sec1}{ > > some text. > > \subsection{subsec1}{ > some text. > > \code{ > require(aqr) > require(quantmod) > # fetch them via quantmod > getSymbols(c("MSFT", "SAP")) > ... > } > } > } > ========== > > The problem is, everything in \code{} gets printed into one line. > If I add \cr at the end of every line in \code, it gets broken > properly, but a warning says "Tag \cr is invalid in a \code block" > > What's the right way to include code (same problem with verbatim) in a > subsection? > > Thanks > Ulrich > > > > > -- > Ulrich Staudinger > > http://www.activequant.org > Connect online: https://www.xing.com/profile/Ulrich_Staudinger -- Ulrich Staudinger http://www.activequant.org Connect online: https://www.xing.com/profile/Ulrich_Staudinger ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.