TeX Matrix Polynomials
as_tex_matrixpoly.RdTeX Matrix Polynomials
Examples
coefs = array(round(rnorm(2*3*1), 1), dim = c(2,3,2))
as_tex_matrixpoly(coefs)
#> [1] "\\begin{pmatrix}\n -1.4 - 1.4z & 0 & 0.4 + 0.4z \\\\\n 1.4 + 1.4z & -0.1 - 0.1z & 0.1 + 0.1z \\\\\n\\end{pmatrix}"
as_tex_matrixpoly(coefs, x = 'x', as_matrix_of_polynomials = FALSE)
#> [1] " \\begin{pmatrix}\n -1.4 & 0 & 0.4 \\\\\n 1.4 & -0.1 & 0.1 \\\\\n\\end{pmatrix} +\n \\begin{pmatrix}\n -1.4 & 0 & 0.4 \\\\\n 1.4 & -0.1 & 0.1 \\\\\n\\end{pmatrix} x"