Skip to content

Commit

Permalink
Fix bug where appendix chapter redfs were always 1 and not the letter
Browse files Browse the repository at this point in the history
* Appendix subsections were correct which is why this slipped past
  • Loading branch information
cgrandin committed May 26, 2024
1 parent 01051a5 commit 662316a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/add-appendix-subsection-refs.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ add_appendix_subsection_refs <- function(x){
sec <- c(counter_lines, sec_pre_code, subsections)
sec
})

# Add referencing so the appendix can be referenced in the document
# with a link
ref_string <- paste0("appendix_", app_ind,
"_counter")
counter_lines <- c(paste0("\\newcounter{", ref_string, "}"),
paste0("\\refstepcounter{",ref_string,"}"))

counter_lines <- "\refstepcounter{chapter}"
if(app_ind == 1){
counter_lines <- c("\renewcommand{\thechapter}{A}",
counter_lines)
}
app <- c(counter_lines, app)
app
})
Expand Down

0 comments on commit 662316a

Please sign in to comment.