Hi, I'm using the Sweave and I would like include codes of the R in my LaTeX file. I extracts the R code with Stangle (), whose name is Relatorio.R but I can't include it in the Latex file as an appendix. Suggests? Thanks, -------------------------------------- Silvano Cesar da Costa Departamento de Estat?stica Universidade Estadual de Londrina Fone: 3371-4346
On 05/05/2010 07:21 AM, Silvano wrote:> Hi, > > I'm using the Sweave and I would like include codes of the R in my LaTeX > file. > > I extracts the R code with Stangle (), whose name is Relatorio.R but I > can't include it > in the Latex file as an appendix. > > Suggests? > > Thanks,Silvano, If you don't want to pretty-print the code and just want it included verbatim, try \usepackage{moreverb} ... {\small\verbatimtabinput{Stangleoutputfile whatever you call it}} Frank> > -------------------------------------- > Silvano Cesar da Costa > Departamento de Estat?stica > Universidade Estadual de Londrina > Fone: 3371-4346 > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Frank E Harrell Jr Professor and Chairman School of Medicine Department of Biostatistics Vanderbilt University
Hi, I suggest you use the listings package ... \usepackage{listings} .... \appendix \lstinputlisting[language=R]{Relatorio.R} .... Best, Ruihong On 05/05/2010 02:21 PM, Silvano wrote:> Hi, > > I'm using the Sweave and I would like include codes of the R in my > LaTeX file. > > I extracts the R code with Stangle (), whose name is Relatorio.R but I > can't include it > in the Latex file as an appendix. > > Suggests? > > Thanks, > > -------------------------------------- > Silvano Cesar da Costa > Departamento de Estat?stica > Universidade Estadual de Londrina > Fone: 3371-4346 > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi Silvano, I think you can enable automatic line breaking of long lines by \lstinputlisting[language=R, breaklines=true]{Relatorio.R} Best, Ruihong On 05/05/2010 11:12 PM, Silvano wrote:> Ruihong > > it very interesting, but the lines was very long. > > Thanks, > -------------------------------------- > Silvano Cesar da Costa > Departamento de Estat?stica > Universidade Estadual de Londrina > Fone: 3371-4346 > -------------------------------------- > ----- Original Message ----- From: "Ruihong Huang" > <ruihong.lang.r at googlemail.com> > To: <r-help at r-project.org> > Sent: Wednesday, May 05, 2010 1:09 PM > Subject: Re: [R] Latex and Stangle() > > > Hi, > > I suggest you use the listings package > ... > > \usepackage{listings} > > .... > \appendix > \lstinputlisting[language=R]{Relatorio.R} > > .... > > > Best, > Ruihong > > > On 05/05/2010 02:21 PM, Silvano wrote: >> Hi, >> >> I'm using the Sweave and I would like include codes of the R in my >> LaTeX file. >> >> I extracts the R code with Stangle (), whose name is Relatorio.R but >> I can't include it >> in the Latex file as an appendix. >> >> Suggests? >> >> Thanks, >> >> -------------------------------------- >> Silvano Cesar da Costa >> Departamento de Estat?stica >> Universidade Estadual de Londrina >> Fone: 3371-4346 >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >