Skip to content

Commit

Permalink
Fix doubled appendices
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrandin committed Jun 14, 2024
1 parent 337b33c commit 0346406
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/add-appendix-subsection-refs.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 0346406

Please sign in to comment.