## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup, eval = FALSE------------------------------------------------------
# library(docorator)
# library(ggplot2)
# library(gt)
# 
# # Create a plot
# plot <- ggplot(mtcars, aes(wt, mpg)) +
#   geom_point() +
#   labs(title = "Weight vs MPG")
# 
# # Create a table
# tbl <- head(mtcars) |>
#   gt::gt()
# 
# # Combine into a list
# output_list <- list(
#   plot,
#   tbl
# )
# 
# # Run `as_docorator` and set headers and footers
# as_docorator(
#   output_list,
#   display_name = "multi_page_example",
#   header = fancyhead(fancyrow(right = doc_pagenum()), # `doc_pagenum` will set pagenumbers in the right header
#                      fancyrow(center = "Multipage Display")),
#   footer = fancyfoot(fancyrow(left = "Footnote1"))
# ) |>  # render
# render_pdf()

