I have a template document (doc_temp6_git.docx) where the first|title page has a special footer, the option inside of the .docx does have the "different first page" option selected for footer 1 and is in portrait. The second page is the TOC which is in the same section (section 1) but has a regular footer (right hand side page 2 of xx). On the second page there is a section break for a next page. The third page (section 2) is landscape, the numbering of the pages continues from the previous section. The sections are not linked and the option for "different first page" is not selected on the footer for section 2. After the table on my third page I have another section break and the document returns to portrait, the number continues from the previous section; he option for "different first page" is not selected on the footer for section 2 and it is not linked to section 2.
When I run my .RMD script using this template document there are no footers until after the landscape page. The page after the landscape page has the same "special footer" as my template document.
Note: the same document with no sections prints the respective footers perfectly fine on a Rmarkdown file without sections but once I landscape a page we return to the same problem.
How can I fix my .RMD or word template so that all of the footers are present? I'm be willing to attach my template documents if I can figure out how.
---
title: Check
documentclass: article
fontsize: 11pt
output:
officedown::rdocx_document:
toc: true
reference_docx: doc_temp6_git.docx
---
```{r setup, include = F}
knitr::opts_chunk$set(echo = F, ft.keepnext = F, dpi = 300)
library(officedown)
library(officer)
library(tidyverse)
library(flextable)
open_section <- officer::prop_section(type = "continuous")
close_section <- officer::prop_section(
page_size = officer::page_size(orient = "landscape"),
type = "continuous")
open_first_section <- officer::prop_section(type = "nextPage")
```
\newpage
<br>
::: {custom-style="Title"}
Title Page
:::
# pre-landscape
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla eu pulvinar arcu,
quis aliquam dui. In at cursus ante. Vestibulum non sagittis lacus. Duis vitae
iaculis dui. Vivamus tempor, nibh ut pretium tempus, enim lorem dignissim quam,
at euismod massa magna at magna. Sed facilisis dapibus diam nec volutpat.
<!---BLOCK_LANDSCAPE_START--->
``` {r landscape_page, echo = F, tab.cap= "random table"}
df1 <- data.frame(id = c(1,2,3),
sex = c("M","F","M"),
day0s = c(21,25,15),
day1s = c(20,30,18),
day2s = c(18,18,17),
day0t = c(2,5,7),
day1t = c(3,6,5),
day2t = c(3,8,7),
id1 = c(1,2,3),
sex1 = c("M","F","M"),
day0s1 = c(21,25,15))
df1 %>%
flextable()
```
<!---BLOCK_LANDSCAPE_STOP--->
# end of landscape
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla eu pulvinar arcu,
quis aliquam dui. In at cursus ante. Vestibulum non sagittis lacus. Duis vitae
iaculis dui. Vivamus tempor, nibh ut pretium tempus, enim lorem dignissim quam,
at euismod massa magna at magna. Sed facilisis dapibus diam nec volutpat.
I have tried only including the section surrounding the landscape page, it results in the same output document. I have tried linking the footers in my template document. I have also tried removing all of the "different first page" checkbox in the template as well, this gave an output document of no footers until after the landscape page and the page after the landscape page had the correct footer with the correct page number.