If output is "markdown", "latex", "html", "html_portable", or "typst", the table is returned in a string as an R object.
If output is a valid file path, the table is saved to file. The supported extensions are: .docx, .html, .png, .pdf, .tex, .typ, and .md (with aliases .txt, .Rmd and .qmd).
If output is "html_portable" or the global option tinytable_html_portable is TRUE, the images are included in the HTML as base64 encoded string instead of link to a local file.
overwrite: A logical value indicating whether to overwrite an existing file.
Returns
A string with the table when output is a format, and the file path when output is a valid path.
Dependencies
.pdf output requires a full LaTeX installation on the local computer.
.png output requires the webshot2 package.
.html self-contained files require the base64enc package.
LaTeX preamble
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. 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.