Skip to content
Prev 156615 / 398506 Next

[R-gui] Tinn-R/Latex output

Mike Prager wrote:
The following is how I set up the listings package usage for R.  If you 
have improvements to this please pass them along. -Frank

\usepackage{listings,relsize}
%Setup for listings package
\lstloadlanguages{R}
\lstset{language=R,basicstyle=\smaller[2],commentstyle=\rmfamily\smaller,
  showstringspaces=false,%
  xleftmargin=4ex,literate={<-}{{$\leftarrow$}}1 {~}{{$\sim$}}1}
\lstset{escapeinside={(*}{*)}}   % for (*\ref{ }*) inside lstlistings (S 
code)