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)
}

Try the texPreview package in your browser

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

texPreview documentation built on May 29, 2024, 5:45 a.m.