I have discovered the listings package for including code in your latex documents. The default languages do not include R or Splus, but the definition is pretty simple, this is what I did for R: \lst at definelanguage{R}% {morekeywords={TRUE,FALSE,T,F,NA,NULL,Inf,NaN,library,% attach,detach,source,while,for,in,% repeat,switch,break,next,return,stop,function,% if,else,warning,error},% literate={<-}{{$\leftarrow$}}1{<<-}{{$\leftarrow \!\!\!\!\leftarrow$}}1 ,% sensitive=true,% morecomment=[l]\#,% morestring=[d]",% morestring=[d]'% }[keywords,directives,comments,strings] This is saved somewhere on your $TEXINPUTS path as lstlang0.sty. Probably someone has already done this, so I would be happy to see an improved version. I am sending this in the hope there are others find it useful. Robert Denham ************************************************************************ The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. ************************************************************************ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Winfried Theis (theis at statistik.uni-dortmund.de) has provided a definition for R for the listings package. AFAIK it is already included in the latest version of listings available from CTAN. detlef On 02-May-01 Robert.Denham at dnr.qld.gov.au wrote:> I have discovered the listings package for including code in your latex > documents. The default languages do not include R or Splus, but the > definition is pretty simple, this is what I did for R: >Detlef Steuer ** Universität der Bw ** 22043 Hamburg Tel: (0049) (0)40/6541-2819 steuer at unibw-hamburg.de There is more to life than increasing its speed. - Mahatma Gandhi -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear all, this mail gives me a good reason to let you know, that I wrote a language definition for R in listings. It is included in the package since version 0.2. So just get the latest from CTAN and test it! I had not propagated it up to now since I hadn't had the chance to test it thoroughly until recently. I also added some definitions for S-Plus as far as I knew them (It inherits most R keywords). And even a rudimentary SAS support has been done (though I don't use it...). So if you are missing keywords please do tell me, I will gladly add them and submit the changes to the maintainer and writer of the package! Cheers, Winfried ---------------------------------- E-Mail: Winfried Theis <theis at statistik.uni-dortmund.de> Date: 03-May-01 Time: 10:22:40 Dipl.-Math. Winfried Theis, Fachbereich Statistik, Graduiertenkolleg "Angewandte Statistik" Universität Dortmund, 44221 Dortmund Tel.: +49-231-755-5903 FAX: +49-231-755-4387 ---------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._