lstset
lstset and friends
Functions for defining how listings prints R and Rd source code
- Keywords
- utilities
Usage
lstset(taglist, LineLength = 80, startS = "\\lstset{")
lstsetR(Rset = NULL, LineLength = 80, add = TRUE, startS = "\\lstset{")
lstsetRd(Rdset = NULL, LineLength = 80, add = TRUE, startS = "\\lstset{")
Arguments
- LineLength
numeric
number of characters per line for lstset and friends; defaults to 80- taglist
- S3-object of class
taglist
; arguments for\lstset of TeX package listings. - Rset
- object of S3-class
taglist
or namedlist
ofcharacter
s; the listings settings for R-code (for\lstset); defaults to NULL
. - Rdset
- object of S3-class
taglist
or namedlist
ofcharacter
s; the listings settings for Rd-code (for\lstset); defaults to NULL
. - add
- boolean; defaults to
TRUE
; ifTRUE
, argument listRset
resp.Rdset
will be appended to default value listsgetSweaveListingOption("Rset")
resp. - startS
- character; defaults to
"\\lstset{"
; what to do by default we use\lstset
; an alternative is to use\lstdefinestyle
which amounts to"\\lstdefinestyle{"
.
Details
lstset
writes out to stdout a call to TeX command
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"),
The output to stdout can be captured in an
Value
invisible()
Examples
lstset(taglist(A="H", b=2, 3),30)
lstset(taglist(A="H", b=2, 3),30, startS = "\\lstdefinestyle{Rstyle}{")
lstsetR()
lstsetRd()