Skip to contents

Print a matrix for LaTeX.

Usage

mattex(mat, type = "pmatrix", round = 3)

Arguments

mat

A matrix.

type

[character(1): "pmatrix"]: Matrix environment to use, e.g. bmatrix for []-enclosed (brackets) or pmatrix for () (parentheses).

round

[integer(1): 3]

Value

Nothing, output is cated.

Examples

mat <- matrix(1:9, ncol = 3)
mattex(mat)
#> \[\begin{pmatrix}
#> 1 & 4 & 7 \\ 
#>  2 & 5 & 8 \\ 
#>  3 & 6 & 9
#> \end{pmatrix}\]