R/utils.R

Defines functions font_back_color

font_back_color <- function(x, fontcolor = NULL, backcolor = NULL) {
  if (!is.null(fontcolor)) {
    x <- paste0("\\textcolor{", fontcolor, "}{", x, "}")
  }
  if (!is.null(backcolor)) {
    if (isTRUE(backcolor)) {
      backcolor <- "shadecolor"
    }
    x <- paste0("\\colorbox{", backcolor, "}{", x, "}")
  }
  return(x)
}

Try the RTLknitr package in your browser

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

RTLknitr documentation built on Aug. 25, 2023, 9:06 a.m.