Description Usage Arguments Details Value Author(s) Examples
Functions for defining how listings prints R and Rd source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | lstset(taglist, LineLength = getOption("width"), startS = "\\lstset{")
lstsetR(Rset = NULL, LineLength = getOption("width"),
add = getSweaveListingOption("addRset"),
startS = "\\lstset{", append = TRUE, withRstyle = FALSE)
lstsetRd(Rdset = NULL, LineLength = getOption("width"),
add = getSweaveListingOption("addRdset"),
startS = "\\lstset{",
append = TRUE)
lstsetRin(Rinset = NULL, LineLength = getOption("width"),
add = getSweaveListingOption("addRinset"),
startS = "\\lstdefinestyle{Rinstyle}{",
append = TRUE)
lstsetRout(Routset = NULL, LineLength = getOption("width"),
add = getSweaveListingOption("addRoutset"),
startS = "\\lstdefinestyle{Routstyle}{",
append = TRUE)
lstsetRcode(Rcodeset = NULL, LineLength = getOption("width"),
add = getSweaveListingOption("addRcodeset"),
startS = "\\lstdefinestyle{Rcodestyle}{",
append = TRUE)
lstsetRall(Rallset = NULL, LineLength = getOption("width"),
add = c("in" = getSweaveListingOption("addRinset"),
"out" = getSweaveListingOption("addRoutset"),
"code" = getSweaveListingOption("addRcodeset")),
startS = c("in" = "\\lstdefinestyle{Rinstyle}{",
"out" = "\\lstdefinestyle{Routstyle}{",
"code" = "\\lstdefinestyle{Rcodestyle}{"),
append = c("in" = TRUE, "out" = TRUE, "code" = TRUE),
withOptionsDefAppend = TRUE)
lstdefRstyle(Rset = NULL, LineLength = getOption("width"),
add = TRUE)
|
LineLength |
|
taglist |
S3-object of class |
Rset |
object of S3-class |
Rinset |
object of S3-class |
Routset |
object of S3-class |
Rcodeset |
object of S3-class |
Rallset |
object of S3-class |
Rdset |
object of S3-class |
add |
boolean; defaults to |
startS |
character; defaults to |
append |
logical; if |
withRstyle |
logical; if |
withOptionsDefAppend |
logical: shall definitions from global options
(see |
lstset
writes out to stdout a call to TeX command
\lstset{arg1 = val1, arg2 = val2, .....}
and doing so respects a maximal number of characters per line and does not
break arg=val
tags.
lstsetR
and lstsetRd
expect either
objects of S3 class taglist
, or lists
of named characters as
first arguments, which in the latter case are then converted to taglist
;
both lstsetR
and lstsetRd
use particular default values to
define R resp. Rd output format. More
specifically for R code, it uses
getSweaveListingOption("Rset"),
and for Rd code, it
getSweaveListingOption("Rdset");
lstsetRin
, lstsetRout
, and lstsetRcode
are corresponding specialized commands for 'listings' environments
Sinput
, Soutput
, and Scode
, respectively.
lstsetRall
simultaneously sets/modifies settings for
'listings' environments
Sinput
, Soutput
, and Scode
.
lstsetdefRstyle
redefines listings style
definition for Rstyle
.
The output to stdout can be captured in an ‘.Rnw’ file as
1 2 3 |
to insert the corresponding \lstset
command to the produced
TeX file.
invisible()
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.