R/m22l.R

Defines functions m22l

Documented in m22l

## m22l converts a matrix into a matrix 
## without brackets or parentheses around the array of numbers.


m22l <- function(matrix) {
  printmrow <- function(x) {
    y <- paste(paste(x,collapse="&"),"\\")
    sprintf(y)
  }
  out <- apply(matrix,1,printmrow)
  out2 <- paste("\\\\begin{matrix}",paste(out,collapse= "\\\\\\ "),"\\\\end{matrix}")
  return(out2)
}

Try the Tex4exams package in your browser

Any scripts or data that you put into this service are public.

Tex4exams documentation built on May 31, 2023, 8:04 p.m.