Skip to content

Commit 3a883b2

Browse files
authored
Merge pull request #332 from FredHutch/fix_longtable
Longtable page number fix for pkg reproducibility table
2 parents 1aa971e + 0a8f902 commit 3a883b2

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Improvements for users
1010
* Default behavior of `create_visc_project()` no longer includes creation of package-specific files DESCRIPTION and NAMESPACE (#306)
1111
* Add option to drop SCHARP logo in PDF output (#312)
1212
* Add `visc_load_pdata()` examples to report template skeleton (#327)
13-
* Reproducibility table formatting changes to coordinate with recent VISCfunctions update that lengthens reproducibility packages table to include packages that are loaded but not attached (#329)
13+
* Reproducibility table formatting changes to coordinate with recent VISCfunctions update that lengthens reproducibility packages table to include packages that are loaded but not attached (#329, #332)
1414

1515
Improvements for package contributors and maintainers
1616

inst/templates/visc_empty/skeleton/skeleton.Rmd

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,14 @@ if (output_type == 'latex') {
168168
169169
# format nicely for PDF with kable and kableExtra
170170
my_session_info$packages_table %>%
171-
kable(booktabs = TRUE, linesep = "", caption = tbl_caption, longtable = TRUE) %>%
172-
kable_styling(latex_options = 'repeat_header')
173-
171+
kable(
172+
booktabs = TRUE, linesep = "", caption = tbl_caption, longtable = TRUE
173+
) %>%
174+
kable_styling(
175+
latex_options = 'repeat_header',
176+
repeat_header_method = 'replace'
177+
)
178+
174179
} else {
175180
176181
# format nicely for Word with flextable

inst/templates/visc_report/skeleton/skeleton.Rmd

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,19 +444,24 @@ if (output_type == 'latex') {
444444
tbl_caption <- "Package reproducibility information"
445445
446446
if (output_type == 'latex') {
447-
447+
448448
# format nicely for PDF with kable and kableExtra
449449
my_session_info$packages_table %>%
450-
kable(booktabs = TRUE, linesep = "", caption = tbl_caption, longtable = TRUE) %>%
451-
kable_styling(latex_options = 'repeat_header')
452-
450+
kable(
451+
booktabs = TRUE, linesep = "", caption = tbl_caption, longtable = TRUE
452+
) %>%
453+
kable_styling(
454+
latex_options = 'repeat_header',
455+
repeat_header_method = 'replace'
456+
)
457+
453458
} else {
454-
459+
455460
# format nicely for Word with flextable
456461
my_session_info$packages_table %>%
457462
flextable() %>%
458463
set_caption(tbl_caption)
459-
464+
460465
}
461466
```
462467

0 commit comments

Comments
 (0)