body_set_default_section: Define Default Section

View source: R/docx_section.R

body_set_default_sectionR Documentation

Define Default Section

Description

Define default section of the document. You can define section propeerties (page size, orientation, ...) with a prop_section object.

Usage

body_set_default_section(x, value)

Arguments

x

an rdocx object

value

a prop_section object

Illustrations

body_set_default_section_doc_1.png

See Also

Other functions for Word sections: body_end_block_section(), body_end_section_columns(), body_end_section_columns_landscape(), body_end_section_continuous(), body_end_section_landscape(), body_end_section_portrait()

Examples

default_sect_properties <- prop_section(
  page_size = page_size(orient = "landscape"), type = "continuous",
  page_margins = page_mar(bottom = .75, top = 1.5, right = 2, left = 2)
)

doc_1 <- read_docx()
doc_1 <- body_add_table(doc_1, value = mtcars[1:10, ], style = "table_template")
doc_1 <- body_add_par(doc_1, value = paste(rep(letters, 40), collapse = " "))
doc_1 <- body_set_default_section(doc_1, default_sect_properties)

print(doc_1, target = tempfile(fileext = ".docx"))

officer documentation built on Oct. 10, 2024, 1:06 a.m.