From 10739ccb02e86ce165422754b397c2c27b3f3c81 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Thu, 21 Mar 2024 09:57:39 -0700 Subject: [PATCH] Add '3.1.8' argument; version/news bump --- DESCRIPTION | 4 ++-- NEWS.md | 8 +++++++- R/add-appendix-subsection-refs.R | 8 ++++---- man/csasdown.Rd | 24 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b8f6bb66..671b4099 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: csasdown Title: Reproducible CSAS Reports with Bookdown -Version: 0.1.4 +Version: 0.1.5 Authors@R: c(person(given = c("Sean", "C."), family = "Anderson", @@ -82,7 +82,7 @@ ByteCompile: true Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 SystemRequirements: pandoc (>= 1.18) - http://pandoc.org Config/testthat/parallel: true Config/testthat/edition: 2 diff --git a/NEWS.md b/NEWS.md index 43472579..334816d4 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # csasdown +# csasdown 0.1.5 + +* Updates for compatibility with pandoc >= 3.1.8. #255 #253 + +* Fix bug with extra . in French sections. #254 + # csasdown 0.1.4 * Add *optional* `show_continued_text` logical YAML argument to enable or @@ -27,7 +33,7 @@ * `verbose` was added to many functions. If you run `render(verbose = TRUE)` you will see a detailed listing of the steps taken during rendering, including line numbers of important items. -* A new function `csasdown::render()` will auto-detect your document type (*resdoc*, *resdoc-b*, *sr*, *techreport*) and render accordingly. We recommend using this over `bookdown::render_book()`. The 'Knit' button in RStudio should properly choose `csasdown::render()`. +* A new function `csasdown::render()` will auto-detect your document type (*4resdoc*, *resdoc-b*, *sr*, *techreport*) and render accordingly. We recommend using this over `bookdown::render_book()`. The 'Knit' button in RStudio should properly choose `csasdown::render()`. * New YAML options are required for this render method; an error will be produced when you run `render()` explaining which ones you are missing. These new YAML options are new French options and are required to render the document. Even if you don't plan on using French, you must enter them with some (any) default text. They are: - `french_month` diff --git a/R/add-appendix-subsection-refs.R b/R/add-appendix-subsection-refs.R index 82abc460..06ffd0cd 100644 --- a/R/add-appendix-subsection-refs.R +++ b/R/add-appendix-subsection-refs.R @@ -20,14 +20,14 @@ add_appendix_subsection_refs <- function(x){ if(length(star_chap_inds)){ counters <- paste0("app_counter_", seq_along(star_chap_inds)) - if(pandoc_curr_ver_is_before()){ + if(pandoc_curr_ver_is_before("3.1.8")){ pre_starred_x <- x[1:(star_chap_inds[1] - 3)] }else{ pre_starred_x <- x[1:(star_chap_inds[1] - 2)] } appendix_chunks <- list() for(i in seq_along(star_chap_inds)){ - if(pandoc_curr_ver_is_before()){ + if(pandoc_curr_ver_is_before("3.1.8")){ if(i == length(star_chap_inds)){ appendix_chunks[[i]] <- x[(star_chap_inds[i] - 2):length(x)] }else{ @@ -58,7 +58,7 @@ add_appendix_subsection_refs <- function(x){ sec_chunks <- list() sec_header <- list() for(i in seq_along(app_chunk_inds)){ - if(pandoc_curr_ver_is_before()){ + if(pandoc_curr_ver_is_before("3.1.8")){ if(i == length(app_chunk_inds)){ sec_chunks[[i]] <- app_chunk[(app_chunk_inds[i] - 1):length(app_chunk)] }else{ @@ -72,7 +72,7 @@ add_appendix_subsection_refs <- function(x){ } } # Check for a label and allow missing label - if(pandoc_curr_ver_is_before() && + if(pandoc_curr_ver_is_before("3.1.8") && !length(grep("^\\\\hypertarget\\{", sec_chunks[[i]][1]))){ # An auto-generated label was not added (using manually-added label) so switching the # label and appsection is necessary diff --git a/man/csasdown.Rd b/man/csasdown.Rd index 719cee35..37af34e2 100644 --- a/man/csasdown.Rd +++ b/man/csasdown.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/csasdown.R \docType{package} \name{csasdown} +\alias{csasdown-package} \alias{csasdown} \title{csasdown: A package for creating CSAS Research Document with R Markdown/bookdown} \description{ @@ -10,3 +11,26 @@ Secretariat) Research Documents, Science Responses, and Technical Reports in PDF or Word format. The package is based on Chester Ismay's thesisdown package and Ben Marwick's huskydown package. } +\author{ +\strong{Maintainer}: Sean C. Anderson \email{sean.anderson@dfo-mpo.gc.ca} + +Authors: +\itemize{ + \item Chris Grandin + \item Andrew M. Edwards + \item Matthew H. Grinnell + \item Daniel Ricard + \item Rowan Haigh (Contributions to TeX .sty files) +} + +Other contributors: +\itemize{ + \item Meghan Burton (Landscape pages and tables) [contributor] + \item Paul M. Regular [contributor] + \item Chester Ismay (Development of thesisdown) [contributor] + \item Nick Solomon (Development of thesisdown) [contributor] + \item Ben Marwick (Development of huskydown) [contributor] + \item His Majesty the King in Right of Canada, as represented by the Minister of the Department of Fisheries and Oceans [copyright holder] +} + +}