[R] How to nicely display R code with the LaTeX package 'listings'?

Yihui Xie xie at yihui.name
Thu Nov 1 19:35:48 CET 2012


Or see https://github.com/yihui/knitr-examples/blob/master/015-listings.Rnw
for a minimal example.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Nov 1, 2012 at 1:23 PM, Frank Harrell <f.harrell at vanderbilt.edu> wrote:
> The knitr package makes this relatively easy to do.  See for example
> http://biostat.mc.vanderbilt.edu/KnitrHowto
>
> Frank
>
>
> Marius Hofert-3 wrote
>> Dear expeRts,
>>
>> What's a 'good' (nice-looking, easy-to-read) setup for the LaTeX package
>> 'listings' to display R code?
>>
>> The two versions below are partly inspired by the settings of the package
>> SweaveListingUtils and
>> http://r.789695.n4.nabble.com/R-How-to-format-R-code-in-LaTex-documents-td816055.html
>>
>> Any suggestions, comments, or improvements are welcome.
>>
>> Cheers,
>>
>> Marius




More information about the R-help mailing list