latexToken: Process Latex Token

View source: R/latex.R

latexTokenR Documentation

Process Latex Token

Description

Pre-processes a latex token not recognized as spork. Escapes the common names for Greek letters and escapes latex metacharacters.

Usage

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),
  ...
)

Arguments

x

character

token_open, token_close

these wrap the entire token (used once); by default the token is text-like

math_open, math_close

these wrap math-like portions of the token; the defaults try to give upright characters (non-italic) which may not work for Greek symbols

label_open, label_close

these re-wrap math-like portions of the token if enforce_math is TRUE; defaults invoke traditional math mode

enforce_math

whether to enforce math mode for nested expression

...

ignored arguments

Value

latex

See Also

Other latex: [.latex(), [[.latex(), as_latex.default(), as_latex.spar(), as_latex.spork(), as_latex(), concatenate.latex()

Other interface: as.expression.plotmath(), as_html.spar(), as_html.spork(), as_latex.default(), as_latex.spar(), as_latex.spork(), as_plotmath.spar(), as_plotmath.spork(), as_previews.spork(), as_spork.character(), htmlToken(), plotmathToken()

Examples

latexToken('foo')
latexToken('alpha')
latexToken('Alpha')

spork documentation built on Sept. 16, 2023, 9:06 a.m.

Related to latexToken in spork...