Skip to content

Commit 4397dd2

Browse files
committed
Fixes regression with pagebreak_in_banner
1 parent 35963db commit 4397dd2

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## crunchtabs 1.4.4
2+
3+
- Fixes a regression where absolutelynopagebreak was duplicated in some situations. (pagebreak_in_banner=TRUE and one_per_page=FALSE)
4+
15
## crunchtabs 1.4.3
26

37
- categorical_arrays were previously spliced into the first position at every question iteration, leading to questions being presented out of vector order in the resulting pdf output. This update patches the results list back together when splicing the array questions in-place. Now, the order of variables is the same as the order presented in the output pdf. (INNOV-498)

R/writeLatex.R

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,11 @@ latexReportTables <- function(results, banner, theme) {
222222
# bottomrule gets wiped out by nopagebreak environment
223223
# adding one manually
224224
if (!theme$pagebreak_in_banner) {
225-
# table <- gsub(
226-
# "\\end{longtable}",
227-
# "\\bottomrule\\end{longtable}\n",
228-
# table,
229-
# fixed = TRUE
230-
# )
231-
232-
table <- noBreaks(table)
225+
table = gsub(
226+
"\\end{longtable}",
227+
"\\bottomrule\\end{longtable}\n\\end{absolutelynopagebreak}",
228+
table, fixed = TRUE)
229+
# table <- noBreaks(table)
233230
}
234231

235232
table_bodies[[i]] <- table

tests/testthat/test-catArrayToCategoricals.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ context("catArrayToCategoricals")
22

33
test_that("Binds categorical arrays appropriately", {
44
questions <- readRDS(test_path("fixtures/catArrayToCategorical_questions.rds"))
5-
res <- catArrayToCategoricals(questions, "petloc", labels = NULL)
5+
res <- expect_warning(
6+
catArrayToCategoricals(questions, "petloc", labels = NULL),
7+
"New variables derived from a"
8+
)
69

710
expect_equal(
811
res$petloc_1$crosstabs$Results$`___total___`$proportions,

0 commit comments

Comments
 (0)