[R] inserting R code in a latex document

From: Thibaut Jombart <jombart_at_biomserv.univ-lyon1.fr>
Date: Wed 11 May 2005 - 09:27:11 EST


I'm trying to insert R source code (functions) in an appendix of a latex document. I guess the easiest way to do so is to use the package Sweaved (file : Sweaved.sty) provided with the latest R version. Latex succeeds in loading the package, but my problem comes from the use of this very package. I tried to use the 'Schunk' environment, but '#' characters generate error (my R functions are annotated, and I want to keep those annotations). Under the 'Sinput' environment, no error is generated but the result is simply not different from what would be obtained under 'verbatim' environment : R code lines are cut as they don't fit in the page width.

I tried to find answers in the latest Sweaved User Manual, unsuccessfully. I'm a recent latex user and I doubt I can quickly find a solution by myself.

Thibaut Jombart

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed May 11 09:31:38 2005

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