Build word
Setup text formatting properties¶
-
Title property
-
Superscript property
Create Word documents¶
-
Create blank doc
-
Read in template
Insert text¶
-
Prepare formatted text with properties
# Title table1_title <- fpar( ftext("Table 1. ", prop = bold_style), ftext( paste0( "Number of cases (n=", nrow(df), ")" ), prop = title_font ), fp_p = fp_par(padding.bottom = 10) # add padding to the bottom ) # Footnote fig2_footnote <- fpar( ftext("1", prop = sup_style), ftext( " footnote placeholder", prop = footnote_style ), run_linebreak(), # line break ftext("2", prop = sup_style), ftext( " footnote placeholder", prop = footnote_style ) )
-
Insert formatted text into Word doc
-
Insert an empty line
-
Insert multiple empty lines
Insert flextable¶
Insert ggplot figures¶
Add page break¶
Move cursor¶
- Set the cursor at the beginning of the document, on the first element of the document
- Set the cursor at a bookmark that has previously been set