when creating documents with officer I am using body_end_section_portrait() and body_end_section_landscape() to set up orientations.
library(officer)
doc <- officer::read_docx()
doc <- officer::body_add_par(doc, "bla1", style = "Normal")
doc <- officer::body_end_section_portrait(doc)
doc <- officer::body_add_par(doc, "bla2", style = "Normal")
doc <- officer::body_end_section_landscape(doc)
doc <- officer::body_add_par(doc, "bla3", style = "Normal")
doc <- officer::body_end_section_portrait(doc)
print(doc, target = "bb.docx")
When I put page numbers in the created document they are not in the right order. E.g. in the provided example the numbers in the created document go 1, 3, 5, 6.
What am I doing wrong?
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)
Matrix products: default
locale:
[1] LC_COLLATE=Croatian_Croatia.1250 LC_CTYPE=Croatian_Croatia.1250
[3] LC_MONETARY=Croatian_Croatia.1250 LC_NUMERIC=C
[5] LC_TIME=Croatian_Croatia.1250
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] officer_0.4.1 rJava_1.0-6