R/print.R

Defines functions print.texpreview_input print.texpreview_tex print.texpreview_viewer knit_print.texpreview_input knit_print.texpreview_tex

#' @export
#' @importFrom knitr knit_print
knit_print.texpreview_tex <- function(x,...){
  x <- paste0(x,collapse = '\n')
  class(x) <- 'knit_asis'
  x
  
}

#' @export
#' @importFrom knitr knit_print
knit_print.texpreview_input <- function(x,...){
  x <- paste0(x,collapse = '\n')
  class(x) <- 'knit_asis'
  x
  
}

#' @export
print.texpreview_viewer <- function(x,...){
  x <- as.null(x)
  invisible(x)
}

#' @export
print.texpreview_tex <- function(x,...){
  x <- paste0(x,collapse = '\n')
  class(x) <- 'character'
  cat(x)
}

#' @export
print.texpreview_input <- function(x,...){
  x <- paste0(x,collapse = '\n')
  class(x) <- 'character'
  cat(x)
}
metrumresearchgroup/texPreview documentation built on Feb. 4, 2024, 6:33 p.m.