From 03464067ab80a6fc297593e338206b9d62ff6e19 Mon Sep 17 00:00:00 2001 From: Chris Grandin Date: Fri, 14 Jun 2024 14:43:07 -0700 Subject: [PATCH] Fix doubled appendices --- R/add-appendix-subsection-refs.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/add-appendix-subsection-refs.R b/R/add-appendix-subsection-refs.R index be94aa1..0868f2b 100644 --- a/R/add-appendix-subsection-refs.R +++ b/R/add-appendix-subsection-refs.R @@ -97,6 +97,13 @@ add_appendix_subsection_refs <- function(x){ sec_inds <- grep(app_section_pat, app) if(!length(sec_inds)){ + # Add referencing so the appendix can be referenced in the document + # with a link + counter_lines <- c(paste0("\\renewcommand{\\thechapter}{", + toupper(LETTERS[app_ind]), + "}"), + "\\refstepcounter{chapter}") + app <- c(counter_lines, app) return(app) }