[R] including r code in a latex file

Ben Bolker ben at zoo.ufl.edu
Mon May 1 23:59:03 CEST 2000


\begin{verbatim}
R code
\end{verbatim}

Or, to do inline R code: you can put R expressions such as
\verb| x <- function(y)y^2| in your code.

By default, all the "verbatim" stuff comes out in typewriter
(Courier/cmtt) font.

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.
> 
>                                   Thanks, Faheem.
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 
> 

-- 
Ben Bolker                                  bolker at zoo.ufl.edu
Zoology Department, University of Florida   http://www.zoo.ufl.edu/bolker
318 Carr Hall/Box 118525                    tel: (352) 392-5697
Gainesville, FL 32611-8525                  fax: (352) 392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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