Re: [R] inserting R code in a latex document

From: Frank E Harrell Jr <>
Date: Thu 12 May 2005 - 22:48:54 EST

I have been trying to use the listings package in LaTeX to do this but have not been fully happy with the result. Here is what I'm trying:

  xleftmargin=4ex,literate={<-}{{$\leftarrow$}}1 {~}{{$\sim$}}1}
\newcommand{\co}[1]{{\lstinline|#1|}} # for in-line S phrases


... S code ...

If anyone has a better setup please let me know. I'm trying to set comments in a smaller font and in roman style, and am changing <- to left arrows and ~ to $\sim$. This also requires the LaTeX relsize package.


Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Thu May 12 22:55:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:44 EST