diff --git a/R/style_tt.R b/R/style_tt.R index 23adc45d..742c4d00 100644 --- a/R/style_tt.R +++ b/R/style_tt.R @@ -49,7 +49,6 @@ #' @param output Apply style only to the output format specified by this argument. `NULL` means that we apply to all formats. #' @param ... extra arguments are ignored #' @return An object of class `tt` representing the table. -#' @template latex_preamble #' @export #' @examplesIf knitr::is_html_output() #' @examples diff --git a/man-roxygen/latex_preamble.R b/man-roxygen/latex_preamble.R index c662fc9b..0f668692 100644 --- a/man-roxygen/latex_preamble.R +++ b/man-roxygen/latex_preamble.R @@ -4,7 +4,9 @@ #' #' `tinytable` uses the `tabularray` package from your LaTeX distribution to draw tables. `tabularray`, in turn, uses the special `tblr`, `talltblr`, and `longtblr` environments. #' -#' When rendering a document from Quarto or Rmarkdown directly to PDF, `tinytable` will populate the LaTeX preamble automatically with all the required packages (except when code chunks are cached). For standalone LaTeX documents, these commands should be inserted in the preamble manually: +#' When rendering a document from Quarto or Rmarkdown directly to PDF, `tinytable` will populate the LaTeX preamble automatically with all the required packages. For standalone LaTeX documents, these commands should be inserted in the preamble manually: +#' +#' Note: Your document will fail to compile to PDF in Quarto if you enable caching and you use tinytable due to missing LaTeX headers. To avoid this problem, set the option `#| cache: false` for the chunk(s) where you use tinytable. #' #' ```latex #' \usepackage{tabularray} diff --git a/man/style_tt.Rd b/man/style_tt.Rd index 14e18a31..f6c48004 100644 --- a/man/style_tt.Rd +++ b/man/style_tt.Rd @@ -126,26 +126,6 @@ This function applies styling to a table created by \code{tt()}. It allows custo Note: Markdown and Word tables only support these styles: italic, bold, strikeout. Moreover, the \code{style_tt()} function cannot be used to style headers inserted by the \code{group_tt()} function; instead, you should style the headers directly in the header definition using markdown syntax: \code{group_tt(i = list("*italic header*" = 2))}. These limitations are due to the fact that there is no markdown syntax for the other options, and that we create Word documents by converting a markdown table to .docx via the Pandoc software. } -\section{LaTeX preamble}{ - - -\code{tinytable} uses the \code{tabularray} package from your LaTeX distribution to draw tables. \code{tabularray}, in turn, uses the special \code{tblr}, \code{talltblr}, and \code{longtblr} environments. - -When rendering a document from Quarto or Rmarkdown directly to PDF, \code{tinytable} will populate the LaTeX preamble automatically with all the required packages (except when code chunks are cached). For standalone LaTeX documents, these commands should be inserted in the preamble manually: - -\if{html}{\out{
}}\preformatted{\\usepackage\{tabularray\} -\\usepackage\{float\} -\\usepackage\{graphicx\} -\\usepackage\{rotating\} -\\usepackage[normalem]\{ulem\} -\\UseTblrLibrary\{booktabs\} -\\UseTblrLibrary\{siunitx\} -\newcommand{\tinytableTabularrayUnderline}[1]\{\\underline\{#1\}\} -\newcommand{\tinytableTabularrayStrikeout}[1]\{\\sout\{#1\}\} -\\NewTableCommand\{\\tinytableDefineColor\}[3]\{\\definecolor\{#1\}\{#2\}\{#3\}\} -}\if{html}{\out{
}} -} - \examples{ \dontshow{if (knitr::is_html_output()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \dontshow{\}) # examplesIf} diff --git a/man/tt.Rd b/man/tt.Rd index 240c9352..4a64036d 100644 --- a/man/tt.Rd +++ b/man/tt.Rd @@ -72,7 +72,9 @@ The \code{tt} function renders a table in different formats with various styling \code{tinytable} uses the \code{tabularray} package from your LaTeX distribution to draw tables. \code{tabularray}, in turn, uses the special \code{tblr}, \code{talltblr}, and \code{longtblr} environments. -When rendering a document from Quarto or Rmarkdown directly to PDF, \code{tinytable} will populate the LaTeX preamble automatically with all the required packages (except when code chunks are cached). For standalone LaTeX documents, these commands should be inserted in the preamble manually: +When rendering a document from Quarto or Rmarkdown directly to PDF, \code{tinytable} will populate the LaTeX preamble automatically with all the required packages. For standalone LaTeX documents, these commands should be inserted in the preamble manually: + +Note: Your document will fail to compile to PDF in Quarto if you enable caching and you use tinytable due to missing LaTeX headers. To avoid this problem, set the option \verb{#| cache: false} for the chunk(s) where you use tinytable. \if{html}{\out{
}}\preformatted{\\usepackage\{tabularray\} \\usepackage\{float\}