Re: [R] [OT] Typesetting / highlighting R code in Latex

From: Vincent Goulet <vincent.goulet_at_act.ulaval.ca>
Date: Sun, 06 Apr 2008 17:54:16 -0400

Le dim. 6 avr. à 14:44, Dirk Eddelbuettel a écrit :
>
> On 6 April 2008 at 10:40, Dirk Eddelbuettel wrote:
> | Using Latex and the beamer class, I would like to highlight code
> snippets.
> | Does anybody know a suitable 'preprocessor' or 'filter' for R (and/
> or C/C++)
> | code ?
> |
> | I have been including it in simple \begin{verbatim} ...
> \end{verbatim} and I
> | know there is a better way -- in fact I saw it used a while back
> in some
> | package I looked at. And I didn't write that down...
> |
> | What I am looking for is the basic equivalent of 'everything in

> verbatim'
> | plus the ability to hightlight certain parts to stress the points
> I'd like to
> | make.
> |
> | There must be something. Pointers would be greatly appreciated!
>
> The listing class was what I was looking for -- thanks for the quick
> off-list
> reply. Basic synopis of listing is eg here
> http://en.wikibooks.org/wiki/LaTeX/Packages/Listings

The listing package is great. I used it for my "Introduction à la programmation en S" manual (on CRAN) to index the code sections automagically. That said, I had to add a few keywords to the list bundled with the package; you may want to have a look at my customizations in

        https://vgoulet.act.ulaval.ca/svn/documents/intro_S/trunk/introduction_programmation_S.tex

[Lines 96--113]

HTH Vincent

>
>
> Dirk
>
> --
> Three out of two people have difficulties with fractions.
>
> ______________________________________________
> 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. Received on Sun 06 Apr 2008 - 23:01:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 06 Apr 2008 - 23:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive