Pre-processes a latex token not recognized as spork. Escapes the common names for Greek letters and escapes latex metacharacters.
latexToken(
x,
token_open = getOption("latex_token_open", "\\textrm{"),
token_close = getOption("latex_token_close", "}"),
math_open = getOption("latex_math_open", "\\mathrm{"),
math_close = getOption("latex_math_close", "}"),
label_open = getOption("latex_label_open", "\\("),
label_close = getOption("latex_label_close", "\\)"),
enforce_math = getOption("latex_enforce_math", TRUE),
...
)latex
character
these wrap the entire token (used once); by default the token is text-like
these wrap math-like portions of the token; the defaults try to give upright characters (non-italic) which may not work for Greek symbols
these re-wrap math-like portions of the token if enforce_math is TRUE; defaults invoke traditional math mode
whether to enforce math mode for nested expression
ignored arguments
Other latex:
[.latex(),
[[.latex(),
as_latex(),
as_latex.default(),
as_latex.greek(),
as_latex.latex(),
as_latex.spar(),
as_latex.spork(),
concatenate.latex()
Other interface:
as.expression.plotmath(),
as_html.spar(),
as_html.spork(),
as_latex.spar(),
as_latex.spork(),
as_plotmath.spar(),
as_plotmath.spork(),
as_previews.spork(),
as_spork.character(),
htmlToken(),
plotmathToken()
latexToken('foo')
latexToken('alpha')
latexToken('Alpha')
Run the code above in your browser using DataLab