expr2latex {simsalapar} | R Documentation |
Translate 'plotmath' expressions to LaTeX
Description
expr2latex()
translates a “R graphics annotation”
expression to the corresponding LaTeX one.
escapeLatex()
, very similar to its original,
escape_latex()
from fortunes, escapes certain character
combinations, such that the result can be used in LaTeX.
Usage
expr2latex(expr)
escapeLatex(x)
Arguments
expr |
an R object of |
x |
a |
Details
The expr2latex()
function is recursively rendering (sub)
expressions, until it uses the internal renderAtom()
for simple
symbols (is.symbol
).
We currently work with some tables of math annotation expressions,
lifted from the corresponding C source of R itself. (Hidden in
simsalpar's namespace, we have AccentTable
,
BinTable
, RelTable
, Lgreek
and Ugreek
,
currently.)
The current implementation is still incomplete.
Value
a character
string with the LaTeX
expression corresponding to “R graphics annotation” expression
expr
.
Author(s)
Martin Maechler.
See Also
plotmath
for mathematical expressions to annotate R
graphics.
toLatex()
and its ftable
method,
toLatex()
.
Examples
expr2latex( quote( N[sim] ) )
expr2latex( quote( N[sim] ~ O(n) ) )
expr2latex( quote(x %notin% N) )
expr2latex( quote(x %+-% epsilon) )
expr2latex( quote(N[s*m^2]) )
expr2latex( quote( 2^{N[sim] - 3} ~~~ O(n^{n^2}) ) )
escapeLatex(c("#{positives}", "A | B"))