as_latex.spar | R Documentation |
Converts one spork to latex.
See description for as_spork
.
By default, unrecognized tokens are returned
literally. However, Greek symbols and latex
metacharacters are escaped.
See latexToken
.
## S3 method for class 'spar'
as_latex(
x,
newline = getOption("latex_newline", "\n"),
unrecognized = getOption("latex_unrecognized", "latexToken"),
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),
...
)
x |
spar |
newline |
value to replace |
unrecognized |
function to process unrecognized tokens: default |
token_open, token_close |
these wrap text-like portions of the label; the defaults try to give upright characters (non-italic); also passed to |
math_open, math_close |
these wrap math-like portions of the label; the defaults try to give upright characters (non-italic) which may not work for Greek symbols; also passed to |
label_open, label_close |
these wrap the entire label; defaults invoke traditional math mode |
enforce_math |
whether to enforce math mode for nested expression: |
... |
passed to |
Experimental support is implemented for
the newline character ('\n'
).
Default behavior is to introduce literal
newline characters into the resulting
tex. This may have no effect on the
typeset result. It may be possible
to achieve other effects by using
non-default values of helper arguments
and perhaps additional latex packages.
latex
Other interface:
as.expression.plotmath()
,
as_html.spar()
,
as_html.spork()
,
as_latex.default()
,
as_latex.spork()
,
as_plotmath.spar()
,
as_plotmath.spork()
,
as_previews.spork()
,
as_spork.character()
,
htmlToken()
,
latexToken()
,
plotmathToken()
Other latex:
[.latex()
,
[[.latex()
,
as_latex.default()
,
as_latex.spork()
,
as_latex()
,
concatenate.latex()
,
latexToken()
library(magrittr)
'V_c./F' %>% as_spork %>% as_latex
'AUC_ss' %>% as_spork %>% as_latex
'C_max_ss' %>% as_spork %>% as_latex
'var^eta_j' %>% as_spork %>% as_latex
'& % $ # \\_ { } ~ \\^ \\' %>% as_spork %>% as_latex
'one joule (Omega) ~ 1 kg*m^2./s^2' %>% as_spork %>% as_latex
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.