body_end_section

0th

Percentile

add section

add a section in a Word document. A section has effect on preceding paragraphs or tables.

Usage
body_end_section(x, landscape = FALSE, colwidths = c(1), space = 0.05,
  sep = FALSE, continuous = FALSE)

body_default_section(x, landscape = FALSE)

break_column_before(x)

Arguments
x

an rdocx object

landscape

landscape orientation

colwidths

columns widths in percent, if 3 values, 3 columns will be produced. Sum of this argument should be 1.

space

space in percent between columns.

sep

if TRUE a line is sperating columns.

continuous

TRUE for a continuous section break.

Details

A section start at the end of the previous section (or the beginning of the document if no preceding section exists), it stops where the section is declared. The function body_end_section() is reflecting that Word concept. The function body_default_section() is only modifying the default section of the document.

Aliases
  • body_end_section
  • body_default_section
  • break_column_before
Examples
# NOT RUN {
library(magrittr)

str1 <- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " %>%
  rep(10) %>% paste(collapse = "")

my_doc <- read_docx() %>%
  # add a paragraph
  body_add_par(value = str1, style = "Normal") %>%
  # add a continuous section
  body_end_section(continuous = TRUE) %>%
  body_add_par(value = str1, style = "Normal") %>%
  body_add_par(value = str1, style = "Normal") %>%
  # preceding paragraph is on a new column
  break_column_before() %>%
  # add a two columns continous section
  body_end_section(colwidths = c(.6, .4),
                   space = .05, sep = FALSE, continuous = TRUE) %>%
  body_add_par(value = str1, style = "Normal") %>%
  # add a continuous section ... so far there is no break page
  body_end_section(continuous = TRUE) %>%
  body_add_par(value = str1, style = "Normal") %>%
  body_default_section(landscape = TRUE)

print(my_doc, target = "section.docx")
# }
Documentation reproduced from package officer, version 0.1.5, License: GPL-3

Community examples

Looks like there are no examples yet.