knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(dplyr)
library(officer)

The docx reference document

As explained in section 3.4 of R Markdown: The Definitive Guide, the first step in creating a reference document is to produce a .docx file using rmarkdown or Pandoc. The formatting and layout of this document can then be edited and saved. The resulting reference document is then used in the YAML metadata of each R Markdown file.

This vignette is intended to track all the changes made to the rub_reference.docx file, so that these changes are reproducible and documented.

We can use officer::styles_info to extract all custom styles defined in the reference document:

reference_docx <- system.file(
  "rmarkdown",
  "templates",
  "datenreport-2022",
  "skeleton",
  "rub_reference_2021.docx",
  package = "RUBer"
)

x <- officer::read_docx(
  reference_docx
)

x %>% 
officer::styles_info() %>% 
  dplyr::filter(
    is_custom
  ) %>% 
  dplyr::arrange(
    style_type,
    style_name
  ) %>% 
  head(50L)

Page Layout

Margins

Paper

Layout

Header and Footer

Header

Footer

Styles

Title

Author

Date

TOC Heading

TOC 1

Heading 1

Heading 2

Heading 3

Heading 4

Heading 6

Image Caption

First Paragraph

Body Text

Footnote Reference

Footnote Text

Header

Footer

Hyperlink

Compact

Captioned Figure



RichardMeyer-Eppler/RUBer documentation built on June 2, 2022, 7:24 p.m.