LaTeX
Environments
environments.Rd
Equations and symbols in LaTeX
can be either inline or on their own. il
wraps expressions for the former, lenv
for the latter.
Arguments
- x
An object of class
latex_symb
- name
The name of the
LaTeX
environment. For instance,align
orgather
.
Value
For
il
,x
'srepr
surrounded by dollar signs.For
lenv
, a multiline string whose lines are: 1. A\begin
statement forname
; 2. The character representation of each row; 3. An\end
statement forname
Examples
al <- lsymb("\\alpha")
be <- lsymb("\\beta")
il(al)
#> [1] "$\\alpha$"
lenv("align",
c(
lsymb(al^2 - be^2, "&=", 0, "\\\\"),
lsymb(pths(al - be)*pths(al + be), "&=", 0)
)
)
#> [1] "\\begin{align}\\alpha ^{ 2 } - \\beta ^{ 2 } &= 0 \\\\\\left( \\alpha - \\beta \\right) \\left( \\alpha + \\beta \\right) &= 0\\end{align}"