| with_font_sizes | R Documentation |
Returns a new table-format function that behaves like 'table_format' but with the supplied font sizes injected. This is the generic mechanism used by [generate_slides()] to honor per-slide 'font_size' settings declared in the spec: a single 'table_format' symbol can carry body/header/footer sizes.
Sizes are only forwarded to arguments the underlying formatter actually declares. A formatter with an explicit 'body_font_size'/'header_font_size'/ 'footer_font_size' argument (or a '...') receives the corresponding size; sizes a formatter cannot accept are dropped rather than raising an "unused argument" error. Additional arguments supplied when the returned function is called are forwarded to the underlying formatter. When no sizes are supplied the original formatter is returned unchanged.
with_font_sizes(
table_format,
body_font_size = NULL,
header_font_size = NULL,
footer_font_size = NULL
)
table_format |
A function taking a flextable as its first argument and returning a flextable (e.g. [autoslider_format()], [black_format_tb()]). |
body_font_size, header_font_size, footer_font_size |
Point sizes. 'NULL' (the default) leaves that part to the underlying formatter default. |
A function 'function(ft, ...)' returning a styled flextable.
small <- with_font_sizes(black_format_tb, body_font_size = 6, header_font_size = 6)
ft <- flextable::flextable(head(mtcars))
small(ft)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.