[Distr-commits] r473 - in branches/distr-2.2/pkg/SweaveListingUtils: R inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 15 00:29:52 CEST 2009

Author: ruckdeschel
Date: 2009-06-15 00:29:51 +0200 (Mon, 15 Jun 2009)
New Revision: 473

yet another literate programming with listings -- ~,^,<=, >= as suggested by Frank Harrell

Modified: branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingOptions.R
--- branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingOptions.R	2009-06-07 08:52:27 UTC (rev 472)
+++ branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingOptions.R	2009-06-14 22:29:51 UTC (rev 473)
@@ -9,7 +9,8 @@
         "language" = "R", "basicstyle" = "{\\color{Rcolor}\\small}",
         "keywordstyle" = "{\\bf\\color{Rcolor}}",
         "commentstyle" = "{\\color{Rcomment}\\ttfamily\\itshape}",
-        "literate" = "{<-}{{$\\leftarrow$}}2{<<-}{{$\\twoheadleftarrow$}}2",
+        "literate" = "{<-}{{$\\leftarrow$}}2{<<-}{{$\\twoheadleftarrow$}}2{~}{{$\\sim$}}1{<=}{{$\\leq$}}2{>=}{{$\\geq$}}2{^}{{$^\\wedge$}}1",
+                     ## ~,^,<=, >= as suggested by Frank Harrell
         "alsoother" = "{$}", "alsoletter" = "{.<-}",
         "otherkeywords" = "{!,!=,~,$,*,\\&,\\%/\\%,\\%*\\%,\\%\\%,<-,<<-,/}"        

Modified: branches/distr-2.2/pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw
--- branches/distr-2.2/pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw	2009-06-07 08:52:27 UTC (rev 472)
+++ branches/distr-2.2/pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw	2009-06-14 22:29:51 UTC (rev 473)
@@ -277,10 +277,11 @@
 you may force \TeX to typeset (parts of) your comments in \TeX style,
 which is handy for mathematical formula.
-In an e-mail, Frank Harrell was suggesting to use named colors as usual
-in {\sf R}. As in \TeX we are just using the command \lstinline[language=tex]{\color}
+In an e-mail, Frank Harrell suggested to use {\sf R} color names
+to assign markup colors as \code{Rcolor}.
+As in \TeX we are just using the command \lstinline[language=tex]{\color}
 which expects a comma-separated list of the three rgb coordinates (scaled to be
-in $[0,1]$, a good way to do use {\sf R} colornames is, as Frank suggested,
+in $[0,1]$), a good way to do this is, as Frank suggested,
 to use \code{col2rgb(...)/255} to transform them to \TeX-digestible format.
 \paragraph{Changing the markup settings without changing defaults at startup: }
@@ -334,7 +335,7 @@
 in the chunks; \code{stangle} will work just fine --- the chunks are just output 
 by \TeX\ in a somewhat transformed way.
-A considerable part of {\sf R} would rather prefer to see the code output
+A considerable part of {\sf R} users would rather prefer to see the code output
 ``as you type it''; if you tend to think like this, you are free of course
 to change the default markup as described in the previous section. 

More information about the Distr-commits mailing list