knitr::opts_chunk$set(echo = TRUE)
library(matlib) Eqn <- function(...) { cat("$$\n") eval(...) cat("$$") }
Eqn(cat("X=U \\lambda V")) Eqn({ symbolicMatrix("u", "n", "k", lhs = '') symbolicMatrix("\\lambda", "k", "k", diag=TRUE) symbolicMatrix("v", "k", "p", transpose = TRUE) })
A <- matrix(paste0('a_', 1:9), 3, 3) b <- paste0("\\beta_", 1:3)
matrix2latex(cbind(A,b))
matrix2latex(cbind(A,b)) |> Eqn()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.