Export object to TeX

tex(x, zero_as_dot = FALSE, matstr = NULL, ...)

Arguments

x

A caracas_symbol

zero_as_dot

Print zero as dots

matstr

Replace \begin{matrix} with another environment, e.g. pmatrix. If vector of length two, the second element is an optional argument.

...

Other arguments passed along

Examples

if (has_sympy()) {
S <- matrix_sym_symmetric(3, "s")
S[1, 2] <- "1-x"
S
tex(S)
tex(S, matstr = "pmatrix")
tex(S, matstr = c("pmatrix", "r"))
}
#> [1] "\\left[\\begin{pmatrix}[r]s_{11} & 1 - x & s_{31}\\\\s_{21} & s_{22} & s_{32}\\\\s_{31} & s_{32} & s_{33}\\end{pmatrix}\\right]"