insert_break() not working for Word output
kelliemac opened this issue · 5 comments
Describe the bug
insert_break() is not working for Word output - no page break is added.
Expected behavior
insert_break() should insert a page break in both pdf and Word outputs
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
The method used by insert_break() for Word outputs appears to be out of date, see:
https://bookdown.org/yihui/rmarkdown-cookbook/pagebreaks.html
Now \newpage should work for all output types. We can update the insert_break() function and/or VISCtemplates documentation to reflect this.
I can confirm locally that just using \newpage
creates a page break on both Word and PDF, on both new pandoc and statsrv pandoc. I tested this by just changing the insert_break() function to use \newpage all the time.
To simplify the codebase, we could just delete the insert_break() function, and replace the instances of its use in the package with \newpage
, and update the internal documentation in VISCtemplates to say to just use \newpage.
The reason to keep insert_break() around would be if this function is getting used in code outside the package. It is an exported function, so it seems possible that people might have existing Rmds out in the wild that include insert_break() that would get broken if we removed the function from the package. Does that seem like a concern?
Depending on what you think @kelliemac , I'd be happy to put in a PR to either fix it inside the function, or fix it by deleting the function.
I am in favor of deleting the insert_break() function and switching over to \newpage. @mayerbry do you have an opinion on this?
Here's an example of where I think that if we removed the insert_break()
function from VISCtemplates, we would break re-knitting of reports previously generated by the template.
A compromise approach might be to keep the function around to not break old Rmds, but also replace its use in the package and update the main documentation saying to just use \newpage.
Optionally we could also have the function throw a warning advising to switch to using \newpage, and after enough time has passed, it could probably get removed. I'm not sure whether people would actually pay attention to these warnings during knitting though!