Dear R users, I have to include typical UNIX formated R commands and outputs into the article using LaTeX. What is the easiest way to include R prompt commands and text outputs (including messages) into LaTeX documents? Is there any template or library? So far I'm trying to produce R commands in LaTeX using LaTeX general format options. Thanks, Rado
Yes, there is a very good library called Sweave that allows for you to embed all R code, figures, tables into a LaTeX document. HCD -----Original Message----- From: Rado Bonk [mailto:rado.bonk at jrc.it] Sent: Monday, March 22, 2004 11:27 AM To: r-help at stat.math.ethz.ch Subject: [R] R commands formating for LaTeX Dear R users, I have to include typical UNIX formated R commands and outputs into the article using LaTeX. What is the easiest way to include R prompt commands and text outputs (including messages) into LaTeX documents? Is there any template or library? So far I'm trying to produce R commands in LaTeX using LaTeX general format options. Thanks, Rado ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Rado, a simple solution is to use the verbatim environment in LaTeX: \begin{verbatim} ... R input and output pasted here ... \end{verbatim} However, I very strongly recommend that you consider using Sweave instead. Good luck, Andrew On Monday 22 March 2004 08:27, Rado Bonk wrote:> Dear R users, > > I have to include typical UNIX formated R commands and outputs into the > article using LaTeX. > > What is the easiest way to include R prompt commands and text outputs > (including messages) into LaTeX documents? Is there any template or > library? > > So far I'm trying to produce R commands in LaTeX using LaTeX general > format options. > > Thanks, > > Rado > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html-- Andrew Robinson Ph: 208 885 7115 Department of Forest Resources Fa: 208 885 6226 University of Idaho E : andrewr at uidaho.edu PO Box 441133 W : http://www.uidaho.edu/~andrewr Moscow ID 83843 Or: http://www.biometrics.uidaho.edu No statement above necessarily represents my employer's opinion.
Hello, there is a latex package called listings: ---- from the README file ------------------------- Abstract -------- The `listings' package is a source code printer for LaTeX. You can typeset stand alone files as well as listings with an environment similar to `verbatim' as well as you can print code snippets using a command similar to \verb'. Many parameters control the output and if your preferred programming language isn't already supported, you can make your own definition. For more details read the documentation `listings.dvi'. ------------------------------------------------------ R is supported. best jan On Mon, 22 Mar 2004, Rado Bonk wrote:> Dear R users, > > I have to include typical UNIX formated R commands and outputs into the > article using LaTeX. > > What is the easiest way to include R prompt commands and text outputs > (including messages) into LaTeX documents? Is there any template or library? > > So far I'm trying to produce R commands in LaTeX using LaTeX general > format options. > > Thanks, > > Rado > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html-- +----------------------------------------- Jan Goebel j g o e b e l @ d i w . d e DIW Berlin German Socio-Economic Panel Study (GSOEP) K?nigin-Luise-Str. 5 D-14195 Berlin -- Germany -- phone: 49 30 89789-377 +-----------------------------------------
On Mon, 22 Mar 2004 17:27:21 +0100 Rado Bonk <rado.bonk at jrc.it> wrote:> Dear R users, > > I have to include typical UNIX formated R commands and outputs into the > article using LaTeX. > > What is the easiest way to include R prompt commands and text outputs > (including messages) into LaTeX documents? Is there any template or > library? > > So far I'm trying to produce R commands in LaTeX using LaTeX general > format options. > > Thanks, > > RadoSee http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/EmacsLaTeXTools -- the part about the s2latx.pl Perl script for use inside LaTeX. --- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University