From 640e23981568418d392bd80329936fb123b592f7 Mon Sep 17 00:00:00 2001 From: Timon Date: Tue, 17 Feb 2026 14:13:51 +0100 Subject: [PATCH] Refactor field processing logic to simplify page breaks and enhance markdown formatting in CI report --- r_app/90_CI_report_with_kpis_agronomic_support.Rmd | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/r_app/90_CI_report_with_kpis_agronomic_support.Rmd b/r_app/90_CI_report_with_kpis_agronomic_support.Rmd index 0b33379..9945571 100644 --- a/r_app/90_CI_report_with_kpis_agronomic_support.Rmd +++ b/r_app/90_CI_report_with_kpis_agronomic_support.Rmd @@ -1262,15 +1262,8 @@ tryCatch({ } # Iterate through fields using purrr::walk - is_first_field <- TRUE purrr::walk(AllPivots_merged$field, function(field_name) { tryCatch({ - # Add page break before each field (except first) - if (!is_first_field) { - cat("\\newpage\n") - } - is_first_field <<- FALSE - message(paste("Processing field:", field_name)) # Load per-field rasters for all 4 weeks @@ -1388,8 +1381,7 @@ tryCatch({ sprintf("**Decline:** %s", field_kpi$Decline_Severity) ) - cat(paste(kpi_parts, collapse = " | "), "\n") - cat("\n") # Extra newline for paragraph separation without creating empty pages + cat(paste(kpi_parts, collapse = " | "), "\n\n") # Double newline for markdown paragraph break } }