rtf_header() and rtf_footer() create structured header/footer objects
that can be passed to rtf_section().
Usage
rtf_header(
rows,
border = NULL,
width_twips = NULL,
width = NULL,
row_height_twips = NULL,
font_size_half_points = NULL,
font = NULL,
markup = NULL,
cell_padding_left_twips = NULL,
cell_padding_right_twips = NULL,
drop_empty_rows = FALSE
)
rtf_footer(
rows,
border = rtf_border(top = TRUE),
width_twips = NULL,
width = NULL,
row_height_twips = NULL,
font_size_half_points = NULL,
font = NULL,
markup = NULL,
cell_padding_left_twips = NULL,
cell_padding_right_twips = NULL,
drop_empty_rows = FALSE
)Arguments
- rows
The header (or footer) content, row by row: a single named character vector for one row, or a
listof them for several rows. Within a row, the name of each element chooses its column:lleft-aligned text
ccentred text
rright-aligned text
e.g.
c(l = "Protocol XYZ-001", r = "Page {AUTO_PAGE}"). Cell text may contain page-number tokens that the renderer substitutes:{AUTO_PAGE}(the current page, updated live by the viewer),{AUTO_TOTAL_PAGES}(the document total), and{PAGE}/{TOTAL_PAGES}(static numbers baked in at render time).- border
An
rtf_border()object controlling the border applied to all rows of the header/footer table.NULL= no border (default for header). Usertf_border(top = TRUE)for a horizontal dividing line (default for footer).- width_twips
Integer. Table width in twips.
NULL(default) uses the full writable width (page width minus margins).- width
Band width in the shared vocabulary:
"page"(the writable width, the default), a fraction in(0, 1]of it, or twips.width_twipsis the older absolute-only form and wins when both are given.- row_height_twips
Integer. Row height in twips.
NULL(default) reads the value frominst/resources/rtfreporter_defaults.R.- font_size_half_points
Font size for this band, in half-points.
NULL(default) inherits the document size. Setting it also recomputes the row height from that size unlessrow_height_twipsis given.- font
Font family for this band, e.g.
"Arial".NULL(default) uses the document font. A family not already in the document'sfont_tableis added to it automatically, the way a colour is.- markup
Cell-text markup for this band;
NULL(default) inherits the document setting. Seertftable().- cell_padding_left_twips, cell_padding_right_twips
Integer cell padding on the left / right side of each header (or footer) cell, matching the content-table convention.
NULL(default) reads frominst/resources/rtfreporter_defaults.R(0L for both since v0.0.21).- drop_empty_rows
Logical.
TRUE: a row whose tokens of one's own (rtf_document(tokens = ),options(rtfreporter.tokens = )) are all empty when the file is written, and which says nothing else but blanks and brackets ("<{POPULATION}>"), is left out. One header can then serve every report of a study, a report with no value for a line going without it.FALSE(default): every row is written.