Create, print and turn to string objects of class latex_symb
Description
The class latex_symb
is simply a wrapper for a string with LaTeX
code. lsymb
creates the wrapper, as.character
and print
extract the string.
Usage
lsymb(...) ## S3 method for class 'latex_symb' print(x, ...) ## S3 method for class 'latex_symb' as.character(x, ...)
lsymb(...) ## S3 method for class 'latex_symb' print(x, ...) ## S3 method for class 'latex_symb' as.character(x, ...)
Arguments
... |
Objects that can be passed to |
x |
An object of class |
Value
-
lsymb
returns an object of classlatex_symb
. It is an S3 class, whose objects are lists with a single component calledrepr
.repr
is theLaTeX
code for the object, which is obtained by pasting the character representations of all the arguments. -
print.lsymb
passes therepr
of its first argument, plus additional arguments, toprint
. The returned value is whateverprint
returns. -
as.character.lsymb
passes therepr
of its first argument, plus additional arguments, toas.character
. The returned value is whateveras.character
returns.
Examples
al <- lsymb("\\alpha") print(al) as.character(al)
al <- lsymb("\\alpha") print(al) as.character(al)