Available Options

Options can be set with options() and change the default behavior of tinytable. You can either set them in a script (usually at the top) or via .Rprofile. Note that you want to be cautious with putting things in .Rprofile since they might make results not reproducible (e.g. if you change tinytable_format_digits in .Rprofile, the table will be formatted differently).

Default values for function arguments

Most options are function specific and allow you to set default values. These all start with tinytable_X_ where X is tt/format/theme/print. See the corresponding help documentation for the what the argument looks like.

tt()

Sets default values for tt() arguments.

  • tinytable_tt_digits
  • tinytable_tt_caption
  • tinytable_tt_notes
  • tinytable_tt_width
  • tinytable_tt_theme
  • tinytable_tt_rownames

format_tt()

Sets default formats for different kinds of variables. see format_tt()

  • tinytable_format_digits
  • tinytable_format_num_fmt
  • tinytable_format_num_zero
  • tinytable_format_num_suffix
  • tinytable_format_num_mark_big
  • tinytable_format_num_mark_dec
  • tinytable_format_date
  • tinytable_format_bool
  • tinytable_format_other
  • tinytable_format_replace
  • tinytable_format_escape
  • tinytable_format_markdown
  • tinytable_format_quarto
  • tinytable_format_fn
  • tinytable_format_sprintf

theme_tt()

When using theme_tt(theme = "theme_name"), this allows you to set default arguments to the corresponding theme. See theme_tt() for details.

placement - tinytable_theme_placement_float - tinytable_theme_placement_horizontal

resize - tinytable_theme_resize_width - tinytable_theme_resize_direction

multipate - tinytable_theme_multipage_rowhead - tinytable_theme_multipage_rowfoot

tabular - tinytable_theme_tabular_style

print.tinytable()

tinytable_print_output

Global options

The rest of the options are a set of global options that apply when the tables are being built.

HTML

  • EXPERIMENTAL options(tinytable_html_mathjax = TRUE) inserts MathJax scripts in the HTML document. Warning: This may conflict with other elements of the page if MathJax is otherwise loaded.

PDF

  • options(tinytable_pdf_clean = TRUE) deletes temporary and log files.
  • options(tinytable_pdf_engine = "xelatex"): “xelatex”, “pdflatex”, “lualatex”

Quarto

The format_tt(quarto=TRUE) argument activates Quarto data processing for specific cells. This funcationality comes with a few warnings:

  1. Currently, Quarto provides a \QuartoMarkdownBase64{} LaTeX macro, but it does not appear to do anything with it. References and markdown codes may not be processed as expected in LaTeX.
  2. Quarto data processing can enter in conflict with tinytable styling or formatting options. See below for how to disable it.
  • options(tinytable_quarto_disable_processing = TRUE) disables Quarto processing of cell content.

    Setting this global option to FALSE may lead to conflicts with some tinytable features, but it also allows use of markdown and Quarto-specific code in table cells, such as cross-references.

    x <- data.frame(Math = "x^2^", Citation = "@Lovelace1842")
    fn <- function(z) sprintf("<span data-qmd='%s'></span>", z)
    tt(x) |> format_tt(i = 1, fn = fn)

    See this link for more details: https://quarto.org/docs/authoring/tables.html#disabling-quarto-table-processing