Skip to contents

A card is the repeating unit of a poster. It draws a rounded background box (border in the theme accent), an optional header "tab" in the accent colour, and a body grob underneath. Every content type (text, table, figure, image) is wrapped in a card so the poster keeps one consistent look.

Usage

poster_card(
  body,
  header = NULL,
  theme = poster_theme(),
  header_size = NULL,
  fit_content = FALSE,
  show_plot_area = FALSE
)

Arguments

body

The content. Either a grob, or a ggplot object (converted with ggplot2::ggplotGrob()).

header

Header label for the tab. NULL, NA, or "" draws no header.

theme

A poster_theme() object.

header_size

Font size of the header, in points. Defaults to theme$base_size * 1.15.

fit_content

If TRUE, size the body cell to body's own measured height times theme$content_pad_factor, instead of filling however much vertical space the card is given (the latter is what you want when the card's height is a relative share of the column, e.g. from poster()'s numeric section$height; the former is what section$height = "auto" uses).

show_plot_area

If TRUE, draw a dashed border around the header tab and around the body content, separately, on top of the content without hiding it. When the body is a table/figure paired with a bullet-list description (see with_notes() in R/content.R), the main content and the notes column each get their own border instead of one around the combined pair. Useful for seeing exactly how much of a card each of its parts fills.

Value

A gtable::gtable grob of class poster_card.

Details

The returned object is a gtable::gtable (a grob), which can be placed in another gtable or drawn directly with grid::grid.draw().

Examples

body <- grid::textGrob("hello")
card <- poster_card(body, header = "OBJECTIVES", theme = poster_theme())
# grid::grid.newpage(); grid::grid.draw(card)