Add pr_section for fine-grained Word section control in save_flex_docx()#2438
Merged
Merged
Conversation
Add a pr_section argument (and matching save_flex_docx-lst:pr_section theme element) accepting an officer::prop_section() to control page margins, page size, orientation, and section columns. The header/footer regions remain managed by save_flex_docx() (relocated caption/notes), so any header_default/footer_default on pr_section are ignored. For collections the same section is applied to every table with the paging type fixed to 'nextPage' to avoid blank pages. The argument overrides the theme element. Co-authored-by: Ona <no-reply@ona.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
Add a
pr_sectionargument (and matchingsave_flex_docx-lst:pr_sectiontheme element) tosave_flex_docx()accepting anofficer::prop_section()object for fine-grained control of the Word section—page margins, page size, orientation, and columns—while the header/footer regions remain managed bysave_flex_docx(); for a collection the same section is applied to every table with the pagingtypefixed to"nextPage".If there is an issue associated with this pull request, please provide link.
N/A
Reviewer Checklist (if item does not apply, mark is as complete)
covr::report())usethis::use_spell_check()run and no spelling errors in documentationR CMD Checkruns without errors, warnings, and notes (relevant test suite passes locally)When the branch is ready to be merged:
NEWS.mdwith the changes from this pull request under the heading "# gtsummary (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (seeNEWS.mdfor examples).usethis::use_version(which = "dev")pkgdown::build_site()and merge any changes neededNotes
This PR is stacked on
feat/as_flex_word(PR #2437), notmain— it builds on the flextable/list input support from that branch. Please merge #2437 first, after which this PR's base can be retargeted tomain(or it will auto-retarget on merge).Key behavior:
header_default/footer_defaulton the suppliedpr_sectionare discarded in favor of the relocated caption/notes.type = "nextPage"— the samepr_sectionapplies to every table's section; anytypeonpr_sectionis ignored between tables to avoid blank pages.pr_sectionargument overrides thesave_flex_docx-lst:pr_sectiontheme element.All
test-save_flex_docx.Rtests pass (NOT_CRAN=true), including 8 new tests covering margins, ours-wins, no-content, collections, list input, theme element + override, and class validation. NoNAMESPACEdrift;man/andR/sysdata.rdaregenerated.