[R] including r code in a latex file

gb gb at stat.umu.se
Mon May 1 23:39:36 CEST 2000


On Mon, 1 May 2000, Faheem Mitha wrote:

> Dear R people,
> 
> The header practically says it all. I was wanting to include r code in a
> Latex file. Since R code using{ and }, which are interpreted by Latex as
> control characters, I would expect it to get upset.
> 
> I believe that \{ would probably print as {, but I hoping I don't have to
> go through the code and add lots of \. I would rather use some global
> commannd, along the lines of \treatastext{R code}.
> 
> Is there something like this? I'm not that familiar with Latex.

You could try \begin{verbatim}...R-code ... \end{verbatim}

-- 
 Göran Broström, professor           tel: +46 90 786 5223
 Department of Statistics            fax: +46 90 786 6614
 Umeå University
 SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list