From 88cc5253f989cb21847e639943e441b12adcaebe Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 16 May 2023 12:23:15 +0200 Subject: [PATCH 01/24] require orcid and standarised affiliation for INBO personel --- R/pdf_report.R | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/R/pdf_report.R b/R/pdf_report.R index 82a26799..51fcac40 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -250,7 +250,6 @@ validate_persons <- function(yaml, reviewer = TRUE) { c(tail(shortauthor, 1)) |> paste(collapse = " & ") -> yaml$shortauthor } - shortauthor <- paste(shortauthor, "") assert_that( length(corresponding) == 1, msg = "A single corresponding author is required." @@ -282,22 +281,55 @@ contact_person <- function(person) { gsub("\\1.", person$name$given, perl = TRUE) |> sprintf(fmt = "%2$s, %1$s", person$name$family) -> shortauthor if (!has_name(person, "orcid")) { + if (is_inbo(person)) { + sprintf( + "`orcid` required for %s %s", person$name$given, person$name$family + ) |> + stop(call. = FALSE) + } sprintf( "No `orcid` found for %s %s", person$name$given, person$name$family ) |> warning(call. = FALSE) } if (!has_name(person, "affiliation")) { + if (is_inbo(person)) { + sprintf( + "`affiliation` required for %s %s.\nMust be either `%s` or `%s`", + person$name$given, + person$name$family, + "Research Institute for Nature and Forest (INBO)", + "Instituut voor Natuur- en Bosonderzoek (INBO)" + ) |> + stop(call. = FALSE) + } sprintf( "No `affiliation` found for %s %s", person$name$given, person$name$family ) |> warning(call. = FALSE) + } else { + if ( + is_inbo(person) && + !person$affiliation %in% c( + "Research Institute for Nature and Forest (INBO)", + "Instituut voor Natuur- en Bosonderzoek (INBO)" + ) + ) { + sprintf( + "`affiliation` for %s %s must be either `%s` or `%s`", + person$name$given, + person$name$family, + "Research Institute for Nature and Forest (INBO)", + "Instituut voor Natuur- en Bosonderzoek (INBO)" + ) |> + stop(call. = FALSE) + } } if (is.null(person$corresponding) || !person$corresponding) { return(shortauthor) } assert_that( - "email" %in% names(person), + has_name(person, "email"), msg = "no `email` provided for the corresponding author." ) sprintf("%s<%s>", shortauthor, person$email) @@ -345,3 +377,11 @@ check_license <- function() { } return(invisible(NULL)) } + +#' @importFrom assertthat has_name +is_inbo <- function(person) { + if (!has_name(person, "email")) { + return(FALSE) + } + grepl("inbo.be$", person$email) +} From 40652da581b1b267b4c4d589a3f6b3d6c338107a Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 16 May 2023 17:14:42 +0200 Subject: [PATCH 02/24] create_report() and add_author() set INBO affiliation in the language of the document --- R/add_author.R | 9 +++- R/create_report.R | 48 +++++++++++++----- R/pdf_report.R | 23 +++------ R/sysdata.rda | Bin 0 -> 251 bytes .../templates/report/skeleton/skeleton.Rmd | 11 ++-- inst/sysdata.R | 7 +++ 6 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 R/sysdata.rda create mode 100644 inst/sysdata.R diff --git a/R/add_author.R b/R/add_author.R index e88a315d..8d88a2c0 100644 --- a/R/add_author.R +++ b/R/add_author.R @@ -20,6 +20,13 @@ add_author <- function(path = ".") { path(path, "index.Rmd") |> readLines() -> index + lang <- grep("^lang:", index) + assert_that(length(lang) > 0, msg = "No `lang:` entry found in yaml header") + assert_that( + length(lang) == 1, msg = "Multiple `lang:` entries found in yaml header" + ) + lang <- gsub("lang: ", "", index[lang]) + author <- grep("^author:", index) assert_that( length(author) > 0, msg = "No `author:` entry found in yaml header" @@ -27,7 +34,7 @@ add_author <- function(path = ".") { assert_that( length(author) == 1, msg = "Multiple `author:` entries found in yaml header" ) - use_author() |> + check_author(lang = lang) |> author2yaml(corresponding = FALSE) -> extra top <- grep("^\\w+:", index) - 1 insert <- head(top[top > author], 1) diff --git a/R/create_report.R b/R/create_report.R index 4b7b240e..9d069d50 100644 --- a/R/create_report.R +++ b/R/create_report.R @@ -37,6 +37,16 @@ msg = "The report name folder may only contain lower case letters, digits and _" msg = "The report name folder already exists." ) + lang <- c(nl = "Dutch", en = "English", fr = "French") + lang <- names(lang)[ + menu_first(lang, title = "What is the main language of the report?") + ] + style <- c("INBO", "Vlaanderen") + style <- ifelse( + lang != "nl", "Flanders", + style[menu_first(style, title = "Which style to use?")] + ) + # build new yaml readline(prompt = "Enter the title: ") |> gsub(pattern = "[\"|']", replacement = "") |> @@ -47,10 +57,10 @@ msg = "The report name folder may only contain lower case letters, digits and _" gsub(pattern = "[\"|']", replacement = "") -> subtitle yaml <- c(yaml, paste("subtitle:", subtitle)[subtitle != ""]) cat("Please select the corresponding author") - authors <- use_author() + authors <- check_author(lang = lang) c(yaml, "author:", author2yaml(authors, corresponding = TRUE)) -> yaml while (isTRUE(ask_yes_no("Add another author?", default = FALSE))) { - author <- use_author() + author <- check_author(lang = lang) authors[, c("given", "family", "email")] |> rbind(author[, c("given", "family", "email")]) |> anyDuplicated() -> duplo @@ -66,7 +76,7 @@ msg = "The report name folder may only contain lower case letters, digits and _" cat("Please select the reviewer") duplo <- 1 while (duplo > 0) { - author <- use_author() + author <- check_author(lang = lang) authors[, c("given", "family", "email")] |> rbind(author[, c("given", "family", "email")]) |> anyDuplicated() -> duplo @@ -76,15 +86,6 @@ msg = "The report name folder may only contain lower case letters, digits and _" ) } } - lang <- c(nl = "Dutch", en = "English", fr = "French") - lang <- names(lang)[ - menu_first(lang, title = "What is the main language of the report?") - ] - style <- c("INBO", "Vlaanderen") - style <- ifelse( - lang != "nl", "Flanders", - style[menu_first(style, title = "Which style to use?")] - ) readline(prompt = "Enter one or more keywords separated by `;`") |> gsub(pattern = "[\"|']", replacement = "") |> strsplit(";") |> @@ -106,8 +107,8 @@ msg = "The report name folder may only contain lower case letters, digits and _" "lof: TRUE"[ask_yes_no("Do you want a list of figures?", default = FALSE)], "lot: TRUE"[ask_yes_no("Do you want a list of tables?", default = FALSE)], keywords, "community: \"inbo\"", "publication_type: report", - "funder: Research Institute for Nature and Forest (INBO)", - "rightsholder: Research Institute for Nature and Forest (INBO)", + paste("funder:", inbo_affiliation[lang]), + paste("rightsholder:", inbo_affiliation[lang]), "bibliography: references.bib", "link-citations: TRUE", "site: bookdown::bookdown_site", "output:", " INBOmd::gitbook: default", " INBOmd::pdf_report: default", " INBOmd::epub_book: default", @@ -280,3 +281,22 @@ add_address <- function(type = "client") { sprintf("%s_logo: %s", type, logo)[logo != ""] ) } + +#' @importFrom checklist use_author +check_author <- function(lang = "nl") { + person <- use_author() + if (is_inbo(person) && !person$affiliation %in% inbo_affiliation) { + paste0("`", inbo_affiliation, "`", collapse = "; ") |> + sprintf(fmt = "INBO staff must use one of %s as affiliation.") |> + cat("Please update the author information.", "\n", sep = " ") + person <- check_author(lang = "nl") + person$affiliation <- inbo_affiliation[lang] + } + if (is_inbo(person) && is.na(person$orcid)) { + cat( + "INBO staff must provide an ORCID.", + "Please update the author information.", "\n", sep = " " + ) + person <- check_author(lang = "nl") + } +} diff --git a/R/pdf_report.R b/R/pdf_report.R index 51fcac40..5dcfeb23 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -295,11 +295,9 @@ contact_person <- function(person) { if (!has_name(person, "affiliation")) { if (is_inbo(person)) { sprintf( - "`affiliation` required for %s %s.\nMust be either `%s` or `%s`", - person$name$given, - person$name$family, - "Research Institute for Nature and Forest (INBO)", - "Instituut voor Natuur- en Bosonderzoek (INBO)" + "`affiliation` required for %s %s.\nMust be one of %s", + person$name$given, person$name$family, + paste0("`", inbo_affiliation, "`", collapse = "; ") ) |> stop(call. = FALSE) } @@ -308,19 +306,10 @@ contact_person <- function(person) { ) |> warning(call. = FALSE) } else { - if ( - is_inbo(person) && - !person$affiliation %in% c( - "Research Institute for Nature and Forest (INBO)", - "Instituut voor Natuur- en Bosonderzoek (INBO)" - ) - ) { + if (is_inbo(person) && !person$affiliation %in% inbo_affiliation) { sprintf( - "`affiliation` for %s %s must be either `%s` or `%s`", - person$name$given, - person$name$family, - "Research Institute for Nature and Forest (INBO)", - "Instituut voor Natuur- en Bosonderzoek (INBO)" + "`affiliation` for %s %s must be one of %s", person$name$given, + person$name$family, paste0("`", inbo_affiliation, "`", collapse = "; ") ) |> stop(call. = FALSE) } diff --git a/R/sysdata.rda b/R/sysdata.rda new file mode 100644 index 0000000000000000000000000000000000000000..9ebb2dde58188b2d129af73555d4bd38ed71ae65 GIT binary patch literal 251 zcmVgbrhC?(lMMCX7Ze>iKP_n|c^AsXpZ?>zan?e(% zJ4HOY(w@9PVqCf4Sdss9bf_fwnn({-0u^CT!$?_|FeHywRz-?vDNLfL?-(uzi1Pq_ z`Y9d-rtI-mT9s{wVNAR~lP)&VvHYMgt>oYL8{&%CR-}DJigNy);txN?5fpO)007UD Baq<8F literal 0 HcmV?d00001 diff --git a/inst/rmarkdown/templates/report/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/report/skeleton/skeleton.Rmd index 550fdde3..4372cd96 100644 --- a/inst/rmarkdown/templates/report/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/report/skeleton/skeleton.Rmd @@ -5,16 +5,17 @@ title: author: - name: given: Firstname1 - family: "Last name1" + family: Last name1 email: "firstname1.lastname1@inbo.be" orcid: 0000-0002-1825-0097 - affiliation: Research Institute for Nature and Forest (INBO) + affiliation: Instituut voor Natuur- en Bosonderzoek (INBO) corresponding: true - name: given: Firstname2 family: Lastname2 email: "voornaam2.achternaam2@inbo.be" orcid: 0000-0002-1825-0097 + affiliation: Instituut voor Natuur- en Bosonderzoek (INBO) style: INBO lang: nl @@ -25,9 +26,9 @@ reviewer: family: Lastname email: "firstname.lastname@inbo.be" orcid: 0000-0002-1825-0097 - affiliation: Research Institute for Nature and Forest (INBO) -funder: Research Institute for Nature and Forest (INBO) -rightsholder: Research Institute for Nature and Forest (INBO) + affiliation: Instituut voor Natuur- en Bosonderzoek (INBO) +funder: Instituut voor Natuur- en Bosonderzoek (INBO) +rightsholder: Instituut voor Natuur- en Bosonderzoek (INBO) community: inbo keywords: # year: diff --git a/inst/sysdata.R b/inst/sysdata.R new file mode 100644 index 00000000..1eb4699c --- /dev/null +++ b/inst/sysdata.R @@ -0,0 +1,7 @@ +inbo_affiliation <- c( + en = "Research Institute for Nature and Forest (INBO)", + nl = "Instituut voor Natuur- en Bosonderzoek (INBO)", + fr = "Institut de Recherche sur la Nature et les For\u00eats (INBO)", + de = "Institut f\u00fcr Natur- und Waldforschung (INBO)" +) +save(inbo_affiliation, file = "R/sysdata.rda") From bbfb29797396b3ae8354ed2afa498c93e7993a3e Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 16 May 2023 17:14:58 +0200 Subject: [PATCH 03/24] update NEWS --- NEWS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.md b/NEWS.md index 48094b0c..2126fc2a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,12 @@ # INBOmd 0.6.1 +* INBO authors and reviewers now must use their `orcid` and a standardised + `affiliation`. + We infer INBO membership from the author's email address. +* `create_report()` and `add_author()` will set the INBO author affiliation in + the language of the report. * `slides()` no longer requires a reviewer. +* Install missing `TinyTeX` installation or packages. * Bugfixes in `create_report()`. # INBOmd 0.6.0 From 661d257eaf5ad48ba7d07804ac2a415bfa3ca140 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Mon, 22 May 2023 11:54:36 +0200 Subject: [PATCH 04/24] ignore case when checking email domain --- NAMESPACE | 1 + R/create_report.R | 19 +++++++++++++++---- R/pdf_report.R | 14 +++++++++++--- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index a0ca9e38..341d72c4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -47,6 +47,7 @@ importFrom(bookdown,gitbook) importFrom(bookdown,pdf_book) importFrom(checklist,ask_yes_no) importFrom(checklist,menu_first) +importFrom(checklist,organisation) importFrom(checklist,read_checklist) importFrom(checklist,use_author) importFrom(dplyr,"%>%") diff --git a/R/create_report.R b/R/create_report.R index 9d069d50..162cdd2b 100644 --- a/R/create_report.R +++ b/R/create_report.R @@ -14,7 +14,8 @@ #' @family utils #' @export #' @importFrom assertthat assert_that is.string noNA -#' @importFrom checklist ask_yes_no menu_first read_checklist use_author +#' @importFrom checklist ask_yes_no menu_first organisation read_checklist +#' use_author #' @importFrom fs dir_create file_copy is_dir is_file path #' @importFrom gert git_find create_report <- function(path = ".", shortname) { @@ -86,6 +87,17 @@ msg = "The report name folder may only contain lower case letters, digits and _" ) } } + lang <- c(nl = "Dutch", en = "English", fr = "French") + lang <- names(lang)[ + menu_first(lang, title = "What is the main language of the report?") + ] + org <- organisation$new() + aff <- org$get_organisation[["inbo.be"]]$affiliation[lang] + style <- c("INBO", "Vlaanderen") + style <- ifelse( + lang != "nl", "Flanders", + style[menu_first(style, title = "Which style to use?")] + ) readline(prompt = "Enter one or more keywords separated by `;`") |> gsub(pattern = "[\"|']", replacement = "") |> strsplit(";") |> @@ -107,8 +119,7 @@ msg = "The report name folder may only contain lower case letters, digits and _" "lof: TRUE"[ask_yes_no("Do you want a list of figures?", default = FALSE)], "lot: TRUE"[ask_yes_no("Do you want a list of tables?", default = FALSE)], keywords, "community: \"inbo\"", "publication_type: report", - paste("funder:", inbo_affiliation[lang]), - paste("rightsholder:", inbo_affiliation[lang]), + paste("funder:", aff), paste("rightsholder:", aff), "bibliography: references.bib", "link-citations: TRUE", "site: bookdown::bookdown_site", "output:", " INBOmd::gitbook: default", " INBOmd::pdf_report: default", " INBOmd::epub_book: default", @@ -246,7 +257,7 @@ author2yaml <- function(author, corresponding = FALSE) { yaml <- c(yaml, sprintf(" orcid: \"%s\"", author$orcid)) } if (!is.na(author$affiliation) && author$affiliation != "") { - yaml <- c(yaml, paste(" affiliation: \"%s\"", author$affiliation)) + yaml <- c(yaml, sprintf(" affiliation: \"%s\"", author$affiliation)) } if (!corresponding) { return(paste(yaml, collapse = "\n")) diff --git a/R/pdf_report.R b/R/pdf_report.R index 5dcfeb23..89710faf 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -325,7 +325,10 @@ contact_person <- function(person) { } #' @importFrom assertthat assert_that has_name is.string noNA +#' @importFrom checklist organisation validate_rightsholder <- function(yaml) { + org <- organisation$new() + aff <- org$get_organisation[["inbo.be"]]$affiliation stopifnot( "no `funder` found" = has_name(yaml, "funder"), "`funder` is not a string" = is.string(yaml$funder), @@ -333,8 +336,6 @@ validate_rightsholder <- function(yaml) { "no `rightsholder` found" = has_name(yaml, "rightsholder"), "`rightsholder` is not a string" = is.string(yaml$rightsholder), "`rightsholder` is not a string" = noNA(yaml$rightsholder), -"Research Institute for Nature and Forest (INBO) not defined as rightsholder" = - yaml$rightsholder == "Research Institute for Nature and Forest (INBO)", "no `community` found" = has_name(yaml, "community"), "`community` must be a string separated by `; `" = is.string(yaml$community), @@ -343,6 +344,13 @@ validate_rightsholder <- function(yaml) { "no `keywords` found" = has_name(yaml, "keywords"), "`keywords` must be a string separated by `; `" = is.string(yaml$keywords) ) + assert_that( + yaml$rightsholder %in% aff, + msg = sprintf( + "rightsholder must be one of the following\n%s", + paste(aff, collapse = "\n") + ) + ) return(yaml) } @@ -372,5 +380,5 @@ is_inbo <- function(person) { if (!has_name(person, "email")) { return(FALSE) } - grepl("inbo.be$", person$email) + grepl("inbo.be$", person$email, ignore.case = TRUE) } From 2cf0c0d54b9a6ca8e62c2f0ee23bb301ff3bb6ba Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 7 Jun 2023 16:53:16 +0200 Subject: [PATCH 05/24] add affiliation for authors --- .zenodo.json | 4 ++++ CITATION.cff | 2 ++ DESCRIPTION | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 89ddb811..751bfed2 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -15,16 +15,19 @@ "contributors": [ { "name": "Onkelinx, Thierry", + "affiliation": "Research Institute for Nature and Forest (INBO)", "orcid": "0000-0001-8804-4216", "type": "ContactPerson" }, { "name": "Vanderhaeghe, Floris", + "affiliation": "Research Institute for Nature and Forest (INBO)", "orcid": "0000-0002-6378-6229", "type": "ProjectMember" }, { "name": "Lommelen, Els", + "affiliation": "Research Institute for Nature and Forest (INBO)", "orcid": "0000-0002-3481-5684", "type": "ProjectMember" }, @@ -36,6 +39,7 @@ "creators": [ { "name": "Onkelinx, Thierry", + "affiliation": "Research Institute for Nature and Forest (INBO)", "orcid": "0000-0001-8804-4216" } ], diff --git a/CITATION.cff b/CITATION.cff index d184f141..968a9e2c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,6 +4,7 @@ title: 'INBOmd: Markdown Templates for INBO' authors: - given-names: Thierry family-names: Onkelinx + affiliation: Research Institute for Nature and Forest (INBO) orcid: 0000-0001-8804-4216 keywords: - markdown @@ -13,6 +14,7 @@ keywords: contact: - given-names: Thierry family-names: Onkelinx + affiliation: Research Institute for Nature and Forest (INBO) orcid: 0000-0001-8804-4216 doi: 10.5281/zenodo.842223 license: GPL-3.0 diff --git a/DESCRIPTION b/DESCRIPTION index df4bdab3..70536660 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,11 +4,11 @@ Title: Markdown Templates for INBO Version: 0.6.1 Authors@R: c( person("Thierry", "Onkelinx", , "thierry.onkelinx@inbo.be", role = c("aut", "cre"), - comment = c(ORCID = "0000-0001-8804-4216")), + comment = c(ORCID = "0000-0001-8804-4216", affiliation = "Research Institute for Nature and Forest (INBO)")), person("Floris", "Vanderhaeghe", , "floris.vanderhaeghe@inbo.be", role = "ctb", - comment = c(ORCID = "0000-0002-6378-6229")), + comment = c(ORCID = "0000-0002-6378-6229", affiliation = "Research Institute for Nature and Forest (INBO)")), person("Els", "Lommelen", , "els.lommelen@inbo.be", role = "ctb", - comment = c(ORCID = "0000-0002-3481-5684")), + comment = c(ORCID = "0000-0002-3481-5684", affiliation = "Research Institute for Nature and Forest (INBO)")), person("Research Institute for Nature and Forest (INBO)", , , "info@inbo.be", role = c("cph", "fnd")) ) Description: Several templates to generate reports, presentations and From 3db51ecb764d516800da5836d91969c3b75da2ad Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 7 Jun 2023 16:55:01 +0200 Subject: [PATCH 06/24] update GHA --- .github/workflows/check_on_branch.yml | 2 +- .github/workflows/check_on_main.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_on_branch.yml b/.github/workflows/check_on_branch.yml index 0792184c..bc635a07 100644 --- a/.github/workflows/check_on_branch.yml +++ b/.github/workflows/check_on_branch.yml @@ -17,4 +17,4 @@ jobs: permissions: contents: read steps: - - uses: inbo/actions/check_pkg@checklist-0.3.2 + - uses: inbo/actions/check_pkg@main diff --git a/.github/workflows/check_on_main.yml b/.github/workflows/check_on_main.yml index 4f5c8e5e..6e8268dc 100644 --- a/.github/workflows/check_on_main.yml +++ b/.github/workflows/check_on_main.yml @@ -16,4 +16,4 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: inbo/actions/check_pkg@checklist-0.3.2 + - uses: inbo/actions/check_pkg@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b2f57d3..95fdd8cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: Get tag message run: | TAG=$(git tag --contains $(git rev-parse HEAD)) - TAG_BODY=$(git tag --contains {{ github.sha }} -n100 | awk '(NR>1)') + TAG_BODY=$(git tag --contains $(git rev-parse HEAD) -n100 | awk '(NR>2)') echo "TAG=$TAG" >> $GITHUB_OUTPUT echo "TAG_BODY=$TAG_BODY" >> $GITHUB_OUTPUT id: tag-body From 0bbc5465ed6272bbeea95d67fc1c1c8c137ad246 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 26 Sep 2023 14:02:16 +0200 Subject: [PATCH 07/24] replace the deprecated qrcode::qrcode_gen() with the new qrcode::qr_code() --- NAMESPACE | 2 +- R/poster.R | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 341d72c4..8b55d6d3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -73,7 +73,7 @@ importFrom(knitr,kable) importFrom(knitr,opts_current) importFrom(knitr,opts_knit) importFrom(pdftools,pdf_convert) -importFrom(qrcode,qrcode_gen) +importFrom(qrcode,qr_code) importFrom(rmarkdown,includes_to_pandoc_args) importFrom(rmarkdown,knitr_options) importFrom(rmarkdown,output_format) diff --git a/R/poster.R b/R/poster.R index 4080f464..ff6fe967 100644 --- a/R/poster.R +++ b/R/poster.R @@ -32,7 +32,7 @@ #' @importFrom utils compareVersion #' @importFrom grDevices pdf dev.off #' @importFrom graphics par image -#' @importFrom qrcode qrcode_gen +#' @importFrom qrcode qr_code #' @family output poster <- function( subtitle, @@ -91,11 +91,11 @@ poster <- function( extra$ORCID, function(this_orcid) { url <- paste0("https://orcid.org/", this_orcid$ID) - qr <- qrcode_gen(url, plotQRcode = FALSE, dataOutput = TRUE) + qr <- qr_code(url) qr_file <- sprintf("orcid-qr-%s.pdf", gsub(" ", "-", this_orcid$name)) pdf(qr_file, width = 1.4, height = 1.4) par(mai = rep(0, 4), mar = rep(0, 4)) - image(qr, asp = 1, col = c("#C04384", "#FFFFFF"), axes = FALSE) + plot(qr, col = c("#C04384", "#FFFFFF")) dev.off() c( this_orcid$name, @@ -112,11 +112,11 @@ poster <- function( extra$DOI, function(this_doi) { url <- paste0("https://doi.org/", this_doi$ID) - qr <- qrcode_gen(url, plotQRcode = FALSE, dataOutput = TRUE) + qr <- qr_code(url) qr_file <- sprintf("doi-qr-%s.pdf", gsub(" ", "-", this_doi$name)) pdf(qr_file, width = 1.4, height = 1.4) par(mai = rep(0, 4), mar = rep(0, 4)) - image(qr, asp = 1, col = c("#C04384", "#FFFFFF"), axes = FALSE) + plot(qr, col = c("#C04384", "#FFFFFF")) dev.off() c( this_doi$name, From c4062d0001eed907097168b409a25d78682e303f Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 26 Sep 2023 14:03:10 +0200 Subject: [PATCH 08/24] install kableExtra into the docker image --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index adfe40c8..42b645bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -200,6 +200,9 @@ RUN mkdir ${HOME}/.fonts \ && fc-cache -fv \ && Rscript -e 'tinytex:::updmap()' +## Install kableExtra +RUN Rscript -e 'remotes::install_cran("kableExtra")' + ## Install current version of INBOmd COPY .Rbuildignore inbomd/.Rbuildignore COPY DESCRIPTION inbomd/DESCRIPTION From bdf92b96b3e9a8c364dd3ee8cbed54e85b3f0aa0 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 26 Sep 2023 14:30:58 +0200 Subject: [PATCH 09/24] bump package version --- .zenodo.json | 2 +- CITATION.cff | 2 +- DESCRIPTION | 2 +- NEWS.md | 4 ++++ inst/CITATION | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 751bfed2..c60b7231 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "INBOmd: Markdown Templates for INBO", - "version": "0.6.1", + "version": "0.6.2", "license": "GPL-3.0", "upload_type": "software", "description": "

Several templates to generate reports, presentations and posters.<\/p>", diff --git a/CITATION.cff b/CITATION.cff index 968a9e2c..c6b0cfca 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -26,4 +26,4 @@ identifiers: value: 10.5281/zenodo.842223 - type: url value: [] -version: 0.6.1 +version: 0.6.2 diff --git a/DESCRIPTION b/DESCRIPTION index 70536660..939785ef 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: INBOmd Title: Markdown Templates for INBO -Version: 0.6.1 +Version: 0.6.2 Authors@R: c( person("Thierry", "Onkelinx", , "thierry.onkelinx@inbo.be", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8804-4216", affiliation = "Research Institute for Nature and Forest (INBO)")), diff --git a/NEWS.md b/NEWS.md index 2126fc2a..7769dde5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# INBOmd 0.6.2 + +* Bugfixes + # INBOmd 0.6.1 * INBO authors and reviewers now must use their `orcid` and a standardised diff --git a/inst/CITATION b/inst/CITATION index 504c4e17..d3ccb0a8 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -2,12 +2,12 @@ citHeader("To cite `INBOmd` in publications please use:") # begin checklist entry bibentry( bibtype = "Manual", - title = "INBOmd: Markdown Templates for INBO. Version 0.6.1", + title = "INBOmd: Markdown Templates for INBO. Version 0.6.2", author = c( author = c(person(given = "Thierry", family = "Onkelinx"))), year = 2023, url = "https://github.com/inbo/INBOmd/", abstract = "Several templates to generate reports, presentations and posters.", - textVersion = "Onkelinx, Thierry (2023) INBOmd: Markdown Templates for INBO. Version 0.6.1. https://github.com/inbo/INBOmd/", + textVersion = "Onkelinx, Thierry (2023) INBOmd: Markdown Templates for INBO. Version 0.6.2. https://github.com/inbo/INBOmd/", keywords = "markdown; bookdown; corporate identity; template", doi = "10.5281/zenodo.842223", ) From 505b6a99a363a041187eea4dd741400a74da78a4 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 26 Sep 2023 14:50:12 +0200 Subject: [PATCH 10/24] use development version of checklist --- .github/workflows/check_on_branch.yml | 2 +- .github/workflows/check_on_main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_on_branch.yml b/.github/workflows/check_on_branch.yml index bc635a07..2f09f443 100644 --- a/.github/workflows/check_on_branch.yml +++ b/.github/workflows/check_on_branch.yml @@ -17,4 +17,4 @@ jobs: permissions: contents: read steps: - - uses: inbo/actions/check_pkg@main + - uses: inbo/actions/check_pkg@checklist-0.3.6 diff --git a/.github/workflows/check_on_main.yml b/.github/workflows/check_on_main.yml index 6e8268dc..d5a137b5 100644 --- a/.github/workflows/check_on_main.yml +++ b/.github/workflows/check_on_main.yml @@ -16,4 +16,4 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: inbo/actions/check_pkg@main + - uses: inbo/actions/check_pkg@checklist-0.3.6 From 0d91855bb62739f11fe7ea3317f8a3e5e2992e82 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 26 Sep 2023 20:50:33 +0200 Subject: [PATCH 11/24] pdf_report() hides DOI when nocolophon is set fixes #94 --- .../tex/latex/inborapport_2015/flanders_report.sty | 4 ++++ .../tex/latex/inborapport_2015/flanders_report_generic.sty | 2 +- .../local_tex/tex/latex/inborapport_2015/flandre_report.sty | 4 ++++ inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty | 6 +++++- .../tex/latex/inborapport_2015/vlaanderen_report.sty | 4 ++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty b/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty index f8da7f1e..a1975a95 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty @@ -15,7 +15,9 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/en}{www.vlaanderen.be}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} +\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -25,7 +27,9 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/en}{www.vlaanderen.be}}}} + \ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} + \fi \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} diff --git a/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty b/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty index 0dad1d8b..0b8de6e6 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty @@ -635,7 +635,7 @@ \vspace{144pt} \hspace{10mm}\parbox[t]{140mm}{ - \fontsize{\fontsizeordernr}{\fontsizeordernrinter}\selectfont \raggedright \mainColourURL{\@doi} \\ \@ordernumber + \fontsize{\fontsizeordernr}{\fontsizeordernrinter}\selectfont \raggedright \ifnum \@colophon > 0 \mainColourURL{\@doi} \\ \fi \@ordernumber } \vfill diff --git a/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty b/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty index 9e36ed42..d0fbcba3 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty @@ -15,7 +15,9 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} +\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -25,7 +27,9 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}} + \ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} + \fi \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} diff --git a/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty b/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty index b533acef..a5516df0 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty @@ -15,7 +15,9 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} +\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -25,7 +27,9 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}} - \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} + \ifnum \@colophon > 0 + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} + \fi \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} diff --git a/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty b/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty index fbf52c4a..19e7f097 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty @@ -14,7 +14,9 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be}{www.vlaanderen.be}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} +\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -24,7 +26,9 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be}{www.vlaanderen.be}}}} + \ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} + \fi \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} From 2601cbf242a343634a32aa7084d775703bfe56a7 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 26 Sep 2023 21:09:01 +0200 Subject: [PATCH 12/24] update citation --- CITATION.cff | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index c6b0cfca..c188739a 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,6 +1,6 @@ cff-version: 1.2.0 message: If you use this software, please cite it using these metadata. -title: 'INBOmd: Markdown Templates for INBO' +title: "INBOmd: Markdown Templates for INBO" authors: - given-names: Thierry family-names: Onkelinx @@ -20,10 +20,8 @@ doi: 10.5281/zenodo.842223 license: GPL-3.0 repository-code: https://github.com/inbo/INBOmd/ type: software -abstract: Several templates to generate reports, presentations and posters. +abstract: "Several templates to generate reports, presentations and posters." identifiers: - type: doi value: 10.5281/zenodo.842223 -- type: url - value: [] version: 0.6.2 From be992752a65fb8b2977c5245d58129adbe6fe585 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 27 Sep 2023 15:50:14 +0200 Subject: [PATCH 13/24] update URL --- CITATION.cff | 2 ++ DESCRIPTION | 2 +- inst/CITATION | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index c188739a..f66cbab6 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -24,4 +24,6 @@ abstract: "Several templates to generate reports, presentations and posters." identifiers: - type: doi value: 10.5281/zenodo.842223 +- type: url + value: https://inbo.github.io/INBOmd/ version: 0.6.2 diff --git a/DESCRIPTION b/DESCRIPTION index 939785ef..57aa7646 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,7 @@ Authors@R: c( Description: Several templates to generate reports, presentations and posters. License: GPL-3 -URL: https://github.com/inbo/inbomd, https://doi.org/10.5281/zenodo.842223 +URL: https://inbo.github.io/INBOmd/, https://github.com/inbo/inbomd, https://doi.org/10.5281/zenodo.842223 BugReports: https://github.com/inbo/inbomd/issues Imports: assertthat, diff --git a/inst/CITATION b/inst/CITATION index d3ccb0a8..0503542b 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -5,9 +5,9 @@ bibentry( title = "INBOmd: Markdown Templates for INBO. Version 0.6.2", author = c( author = c(person(given = "Thierry", family = "Onkelinx"))), year = 2023, - url = "https://github.com/inbo/INBOmd/", + url = "https://inbo.github.io/INBOmd/", abstract = "Several templates to generate reports, presentations and posters.", - textVersion = "Onkelinx, Thierry (2023) INBOmd: Markdown Templates for INBO. Version 0.6.2. https://github.com/inbo/INBOmd/", + textVersion = "Onkelinx, Thierry (2023) INBOmd: Markdown Templates for INBO. Version 0.6.2. https://inbo.github.io/INBOmd/", keywords = "markdown; bookdown; corporate identity; template", doi = "10.5281/zenodo.842223", ) From c0ab95a07b99aa05382ab24ee50e77ee2532adf6 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 27 Sep 2023 16:01:01 +0200 Subject: [PATCH 14/24] use current version for testing the examples --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 55e24138..4daaa2ab 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -16,7 +16,7 @@ jobs: - name: checkout uses: actions/checkout@v2 - name: build examples - uses: inbo/actions/render_inbomd@inbomd-0.6.0 + uses: inbo/actions/render_inbomd@inbomd-0.6.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} EXAMPLE_BRANCH: main From 9f375db839c50349996eebdd07e8715c0a597626 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 27 Sep 2023 17:25:23 +0200 Subject: [PATCH 15/24] make DESCRIPTION tidy --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 57aa7646..3e81f8a7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,8 @@ Authors@R: c( Description: Several templates to generate reports, presentations and posters. License: GPL-3 -URL: https://inbo.github.io/INBOmd/, https://github.com/inbo/inbomd, https://doi.org/10.5281/zenodo.842223 +URL: https://inbo.github.io/INBOmd/, https://github.com/inbo/inbomd, + https://doi.org/10.5281/zenodo.842223 BugReports: https://github.com/inbo/inbomd/issues Imports: assertthat, From d126336a9ccf43c59d527b344168bbb116301d76 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Mon, 23 Oct 2023 16:45:52 +0200 Subject: [PATCH 16/24] update documentation --- man/deprecated.Rd | 6 +++++- man/minutes.Rd | 6 +++++- man/mission.Rd | 6 +++++- man/poster.Rd | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/man/deprecated.Rd b/man/deprecated.Rd index c8e522c7..1985f85c 100644 --- a/man/deprecated.Rd +++ b/man/deprecated.Rd @@ -120,7 +120,11 @@ document (typically created using the \code{\link[rmarkdown]{includes}} function \item{lang}{main language} -\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF. +Note that this argument does not control whether to keep the auxiliary +files (e.g., \file{.aux}) generated by LaTeX when compiling \file{.tex} to +\file{.pdf}. To keep these files, you may set \code{options(tinytex.clean = +FALSE)}.} \item{fig_crop}{Whether to crop PDF figures with the command \command{pdfcrop}. This requires the tools \command{pdfcrop} and diff --git a/man/minutes.Rd b/man/minutes.Rd index 920fee41..94520167 100644 --- a/man/minutes.Rd +++ b/man/minutes.Rd @@ -34,7 +34,11 @@ document (typically created using the \code{\link[rmarkdown]{includes}} function \item{lang}{main language} -\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF. +Note that this argument does not control whether to keep the auxiliary +files (e.g., \file{.aux}) generated by LaTeX when compiling \file{.tex} to +\file{.pdf}. To keep these files, you may set \code{options(tinytex.clean = +FALSE)}.} \item{fig_crop}{Whether to crop PDF figures with the command \command{pdfcrop}. This requires the tools \command{pdfcrop} and diff --git a/man/mission.Rd b/man/mission.Rd index 6215cf5a..cfa81988 100644 --- a/man/mission.Rd +++ b/man/mission.Rd @@ -43,7 +43,11 @@ document (typically created using the \code{\link[rmarkdown]{includes}} function \item{lang}{main language} -\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF. +Note that this argument does not control whether to keep the auxiliary +files (e.g., \file{.aux}) generated by LaTeX when compiling \file{.tex} to +\file{.pdf}. To keep these files, you may set \code{options(tinytex.clean = +FALSE)}.} \item{fig_crop}{Whether to crop PDF figures with the command \command{pdfcrop}. This requires the tools \command{pdfcrop} and diff --git a/man/poster.Rd b/man/poster.Rd index afab8db6..a48db19c 100644 --- a/man/poster.Rd +++ b/man/poster.Rd @@ -26,7 +26,11 @@ poster( \item{email}{The email address to display at the bottom. Defaults to \code{"info@inbo.be"}} -\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF} +\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF. +Note that this argument does not control whether to keep the auxiliary +files (e.g., \file{.aux}) generated by LaTeX when compiling \file{.tex} to +\file{.pdf}. To keep these files, you may set \code{options(tinytex.clean = +FALSE)}.} \item{fig_crop}{\code{TRUE} to automatically apply the \code{pdfcrop} utility (if available) to pdf figures} From 0090130a5a627f5455021ea37a039599c6ad860e Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Mon, 23 Oct 2023 16:59:46 +0200 Subject: [PATCH 17/24] replace DOI with "unpublished report" in case the pdf is generated without colophon --- R/pdf_report.R | 8 ++++++++ .../tex/latex/inborapport_2015/flanders_report.sty | 4 ---- .../latex/inborapport_2015/flanders_report_generic.sty | 2 +- .../tex/latex/inborapport_2015/flandre_report.sty | 4 ---- inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty | 6 +----- .../tex/latex/inborapport_2015/vlaanderen_report.sty | 4 ---- 6 files changed, 10 insertions(+), 18 deletions(-) diff --git a/R/pdf_report.R b/R/pdf_report.R index 89710faf..1d921488 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -69,6 +69,14 @@ pdf_report <- function( ) ) validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) + fm$doi <- ifelse( + has_name(fm, "nocolophon"), + c( + nl = "onuitgeven rapport", en = "unpublished report", + fr = "rapport non publié" + )[lang], + fm$doi + ) path("pandoc", "inbo_rapport.tex") |> system.file(package = "INBOmd") -> template diff --git a/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty b/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty index a1975a95..f8da7f1e 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty @@ -15,9 +15,7 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/en}{www.vlaanderen.be}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} -\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} -\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -27,9 +25,7 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/en}{www.vlaanderen.be}}}} - \ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fi \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} diff --git a/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty b/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty index 0b8de6e6..0dad1d8b 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty @@ -635,7 +635,7 @@ \vspace{144pt} \hspace{10mm}\parbox[t]{140mm}{ - \fontsize{\fontsizeordernr}{\fontsizeordernrinter}\selectfont \raggedright \ifnum \@colophon > 0 \mainColourURL{\@doi} \\ \fi \@ordernumber + \fontsize{\fontsizeordernr}{\fontsizeordernrinter}\selectfont \raggedright \mainColourURL{\@doi} \\ \@ordernumber } \vfill diff --git a/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty b/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty index d0fbcba3..9e36ed42 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty @@ -15,9 +15,7 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} -\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} -\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -27,9 +25,7 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}} - \ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fi \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} diff --git a/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty b/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty index a5516df0..b533acef 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty @@ -15,9 +15,7 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} -\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} -\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -27,9 +25,7 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}} - \ifnum \@colophon > 0 - \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fi + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} diff --git a/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty b/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty index 19e7f097..fbf52c4a 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty @@ -14,9 +14,7 @@ \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be}{www.vlaanderen.be}}}} \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} -\ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} -\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -26,9 +24,7 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be}{www.vlaanderen.be}}}} - \ifnum \@colophon > 0 \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fi \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} From 048a48df84302eb64d4ee1491988178a34f1a737 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 25 Oct 2023 10:29:50 +0200 Subject: [PATCH 18/24] replace UTF-8 character with ASCII encoding --- R/pdf_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/pdf_report.R b/R/pdf_report.R index 1d921488..c37b0916 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -73,7 +73,7 @@ pdf_report <- function( has_name(fm, "nocolophon"), c( nl = "onuitgeven rapport", en = "unpublished report", - fr = "rapport non publié" + fr = "rapport non publi\u00e9" )[lang], fm$doi ) From 238af5d3bc11216c7522bea3193023f0ac7ab3bf Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 22 Nov 2023 16:01:46 +0100 Subject: [PATCH 19/24] update to new pandoc CSL style jgm/pandoc-templates@8a5b381 --- .../inbogeneric_2015/inbogeneric_2015.sty | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/inst/local_tex/tex/latex/inbogeneric_2015/inbogeneric_2015.sty b/inst/local_tex/tex/latex/inbogeneric_2015/inbogeneric_2015.sty index 3ec35aba..54ff82c8 100644 --- a/inst/local_tex/tex/latex/inbogeneric_2015/inbogeneric_2015.sty +++ b/inst/local_tex/tex/latex/inbogeneric_2015/inbogeneric_2015.sty @@ -91,12 +91,40 @@ \RequirePackage{threeparttablex} \RequirePackage{makecell} -% settings for CSL -\newenvironment{CSLReferences}[2]% - {}% - {\par} - % settings for CSL \newenvironment{cslreferences}[2]% {}% {\par} + +\NewDocumentCommand\citeproctext{}{} +\NewDocumentCommand\citeproc{mm}{% + \begingroup\def\citeproctext{#2}\cite{#1}\endgroup} +\makeatletter + % allow citations to break across lines + \let\@cite@ofmt\@firstofone + % avoid brackets around text for \cite: + \def\@biblabel#1{} + \def\@cite#1#2{{#1\if@tempswa , #2\fi}} +\makeatother +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing + {\begin{list}{}{% + \setlength{\itemindent}{0pt} + \setlength{\leftmargin}{0pt} + \setlength{\parsep}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 + \setlength{\leftmargin}{\cslhangindent} + \setlength{\itemindent}{-1\cslhangindent} + \fi + % set entry spacing + \setlength{\itemsep}{#2\baselineskip}}} + {\end{list}} +\RequirePackage{calc} +\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} From 866d1edd3b8de2e12e6048a693950a21d6877083 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 22 Nov 2023 16:02:28 +0100 Subject: [PATCH 20/24] display standard text instead of DOI for internal reports --- R/pdf_report.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/pdf_report.R b/R/pdf_report.R index c37b0916..4f8a7adb 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -70,7 +70,7 @@ pdf_report <- function( ) validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) fm$doi <- ifelse( - has_name(fm, "nocolophon"), + has_name(fm, "nocolophon") && fm$nocolophon, c( nl = "onuitgeven rapport", en = "unpublished report", fr = "rapport non publi\u00e9" @@ -97,6 +97,7 @@ pdf_report <- function( ), pandoc_variable_arg("corresponding", fm$corresponding), pandoc_variable_arg("shortauthor", gsub("\\&", "\\\\&", fm$shortauthor)), + pandoc_variable_arg("doi", fm$doi), pandoc_variable_arg( "babel", paste(languages[c(other_lang, lang)], collapse = ",") ), From d453a1d52744f17e56f7e1ba36e44edf32f4079d Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Wed, 22 Nov 2023 17:01:36 +0100 Subject: [PATCH 21/24] pdf_report() handles document with colophon and without DOI --- R/pdf_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/pdf_report.R b/R/pdf_report.R index 4f8a7adb..03b32084 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -75,7 +75,7 @@ pdf_report <- function( nl = "onuitgeven rapport", en = "unpublished report", fr = "rapport non publi\u00e9" )[lang], - fm$doi + head(c(fm$doi, "!!! missing DOI !!!"), 1) ) path("pandoc", "inbo_rapport.tex") |> From e7ee32022c86b5be9704998054dd896a761b599f Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Thu, 23 Nov 2023 15:47:58 +0100 Subject: [PATCH 22/24] pdf_report(), gitbook() and pdf_report() gain a public_report option --- R/ebook.R | 20 +++- R/gitbook.R | 20 +++- R/pdf_report.R | 30 +++-- inst/pandoc/translations.lua | 3 + inst/template/report.epub3 | 4 + inst/template/report.html | 223 ++++++++++++++++++----------------- man-roxygen/yaml_report.R | 11 +- man/epub_book.Rd | 11 +- man/gitbook.Rd | 11 +- man/pdf_report.Rd | 11 +- 10 files changed, 207 insertions(+), 137 deletions(-) diff --git a/R/ebook.R b/R/ebook.R index 2fd17cf1..809a6854 100644 --- a/R/ebook.R +++ b/R/ebook.R @@ -15,6 +15,10 @@ epub_book <- function() { yaml_front_matter() |> validate_persons(reviewer = TRUE) |> validate_rightsholder() -> fm + assert_that( + !has_name(fm, "nocolophon"), msg = "Legacy option `nocolophon` detected. + Please use the `public_report` option." + ) style <- ifelse(has_name(fm, "style"), fm$style, "INBO") assert_that(length(style) == 1) assert_that(style %in% c("INBO", "Vlaanderen", "Flanders"), @@ -40,7 +44,6 @@ epub_book <- function() { style == "Flanders" || lang == "nl", msg = "Use style: Flanders when the language is not nl" ) - validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) pandoc_args <- c( "--csl", @@ -50,6 +53,21 @@ epub_book <- function() { "--lua-filter", system.file(file.path("pandoc", "translations.lua"), package = "INBOmd") ) + validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) + if (has_name(fm, "public_report") && !fm$public_report) { + c( + nl = "onuitgeven rapport", en = "unpublished report", + fr = "rapport non publi\u00e9" + )[lang] |> + pandoc_variable_arg(name = "doi") |> + c(pandoc_variable_arg("nocolophon", "true")) |> + c(pandoc_args) -> pandoc_args + } else { + c(fm$doi, "!!! missing DOI !!!") |> + head(1) |> + pandoc_variable_arg(name = "doi") |> + c(pandoc_args) -> pandoc_args + } file.path("css_styles", c("fonts", "img")) |> system.file(package = "INBOmd") |> list.files(full.names = TRUE) -> fonts diff --git a/R/gitbook.R b/R/gitbook.R index 340b0915..3ddd699f 100644 --- a/R/gitbook.R +++ b/R/gitbook.R @@ -21,6 +21,10 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { yaml_front_matter() |> validate_persons(reviewer = TRUE) |> validate_rightsholder() -> fm + assert_that( + !has_name(fm, "nocolophon"), msg = "Legacy option `nocolophon` detected. + Please use the `public_report` option." + ) style <- ifelse(has_name(fm, "style"), fm$style, "INBO") assert_that(length(style) == 1) assert_that( @@ -53,7 +57,6 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { split_by %in% c("chapter+number", "section+number"), msg = "`split_by` must be either 'chapter+number' or `section+number`" ) - validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) pandoc_args <- c( "--csl", @@ -63,6 +66,17 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { "--lua-filter", system.file(file.path("pandoc", "translations.lua"), package = "INBOmd") ) + validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) + if (has_name(fm, "public_report") && !fm$public_report) { + c( + nl = "onuitgeven rapport", en = "unpublished report", + fr = "rapport non publi\u00e9" + )[lang] |> + pandoc_variable_arg(name = "doi") |> + c(pandoc_variable_arg("nocolophon", "true")) |> + c(pandoc_args) -> pandoc_args + } + assert_that( getwd() |> path("index.Rmd") |> @@ -110,7 +124,7 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { template = template, extra_dependencies = list(inbomd_dep), code_folding = code_folding ) - post <- config$post_processor # in case a post processor have been defined + old_post <- config$post_processor # in case a post processor have been defined config$post_processor <- function(metadata, input, output, clean, verbose) { file(output, encoding = "UTF-8") |> readLines() -> x @@ -119,7 +133,7 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { x <- c(head(x, i - 1), "", tail(x, -i + 1)) } writeLines(x, output) - post(metadata, input, output, clean, verbose) + old_post(metadata, input, output, clean, verbose) } config$clean_supporting <- TRUE return(config) diff --git a/R/pdf_report.R b/R/pdf_report.R index 03b32084..a11b2c0b 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -25,6 +25,10 @@ pdf_report <- function( yaml_front_matter() |> validate_persons(reviewer = TRUE) |> validate_rightsholder() -> fm + assert_that( + !has_name(fm, "nocolophon"), msg = "Legacy option `nocolophon` detected. + Please use the `public_report` option." + ) floatbarrier <- ifelse(has_name(fm, "floatbarrier"), fm$floatbarrier, NA) assert_that(length(floatbarrier) == 1) assert_that( @@ -68,15 +72,6 @@ pdf_report <- function( paste(sprintf("'%s' (%s)", names(languages), languages), collapse = ", ") ) ) - validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) - fm$doi <- ifelse( - has_name(fm, "nocolophon") && fm$nocolophon, - c( - nl = "onuitgeven rapport", en = "unpublished report", - fr = "rapport non publi\u00e9" - )[lang], - head(c(fm$doi, "!!! missing DOI !!!"), 1) - ) path("pandoc", "inbo_rapport.tex") |> system.file(package = "INBOmd") -> template @@ -97,7 +92,6 @@ pdf_report <- function( ), pandoc_variable_arg("corresponding", fm$corresponding), pandoc_variable_arg("shortauthor", gsub("\\&", "\\\\&", fm$shortauthor)), - pandoc_variable_arg("doi", fm$doi), pandoc_variable_arg( "babel", paste(languages[c(other_lang, lang)], collapse = ",") ), @@ -109,6 +103,22 @@ pdf_report <- function( includes_to_pandoc_args(includes) ) args <- args[args != ""] + validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) + if (has_name(fm, "public_report") && !fm$public_report) { + c( + nl = "onuitgeven rapport", en = "unpublished report", + fr = "rapport non publi\u00e9" + )[lang] |> + pandoc_variable_arg(name = "doi") |> + c(pandoc_variable_arg("nocolophon", "true")) |> + c(args) -> args + } else { + c(fm$doi, "!!! missing DOI !!!") |> + head(1) |> + pandoc_variable_arg(name = "doi") |> + c(args) -> args + } + if (has_name(fm, "lof") && isTRUE(fm$lof)) { args <- c(args, pandoc_variable_arg("lof", TRUE)) diff --git a/inst/pandoc/translations.lua b/inst/pandoc/translations.lua index c90f3e63..41edff6f 100644 --- a/inst/pandoc/translations.lua +++ b/inst/pandoc/translations.lua @@ -20,6 +20,7 @@ local function translation(lang) ordernr = "Opdrachtnummer", reviewer = "Nagelezen door", series = "Rapporten van het", + unpublished = "Onuitgegeven rapport", vu = "Verantwoordelijke uitgever", year = "Gepubliceerd in" } @@ -43,6 +44,7 @@ local function translation(lang) ordernr = "Numéro de commande", reviewer = "Examiné par", series = "Rapports de", + unpublished = "Rapport non publié", vu = "Éditeur responsable", year = "Publié en" } @@ -66,6 +68,7 @@ local function translation(lang) ordernr = "Order number", reviewer = "Reviewed by", series = "Reports of the", + unpublished = "Unpublished report", vu = "Responsible publisher", year = "Published during" } diff --git a/inst/template/report.epub3 b/inst/template/report.epub3 index 9bee73f4..b5dbae2e 100644 --- a/inst/template/report.epub3 +++ b/inst/template/report.epub3 @@ -66,6 +66,9 @@ $if(titlepage)$ $if(ordernr)$

$ordernr$

$endif$ + $if(nocolophon)$ +

$translation.unpublished$

+ $else$

$translation.colophon$

$if(reviewer)$

Reviewers:
@@ -160,6 +163,7 @@ $if(titlepage)$

Creative Commons-Licentie
$translation.license_pre$ $translation.license$. + $endif$ $else$ $if(coverpage)$ diff --git a/inst/template/report.html b/inst/template/report.html index ddf038b8..3412f4cb 100644 --- a/inst/template/report.html +++ b/inst/template/report.html @@ -95,7 +95,7 @@ $endif$

$title$

$if(subtitle)$ -

$subtitle$

+

$subtitle$

$endif$ $for(author)$

$author.name.given$ $author.name.family$ @@ -122,81 +122,84 @@

$author.name.given$ $author.name.family$ $endif$ $endfor$ $if(date)$ -

$date$

+

$date$

$endif$ $if(doi)$ -

$doi$

+

$doi$

$endif$ $if(ordernr)$ -

$ordernr$

+

$ordernr$

$endif$ -

$translation.colophon$

- $if(reviewer)$ -

Reviewers:
- $for(reviewer)$ - $reviewer.name.given$ $reviewer.name.family$ - $if(reviewer.orcid)$ - - ORCID logo - $reviewer.orcid$ - - $endif$ - $if(reviewer.email)$ - $reviewer.email$ - $endif$
- $endfor$ + $if(nocolophon)$ +

$translation.unpublished$

$else$ -

!!!! ONTBREKEND: reviewer !!!!

- $endif$ +

$translation.colophon$

+ $if(reviewer)$ +

Reviewers:
+ $for(reviewer)$ + $reviewer.name.given$ $reviewer.name.family$ + $if(reviewer.orcid)$ + + ORCID logo + $reviewer.orcid$ + + $endif$ + $if(reviewer.email)$ + $reviewer.email$ + $endif$
+ $endfor$ + $else$ +

!!!! ONTBREKEND: reviewer !!!!

+ $endif$ -

$translation.mission$ +

$translation.mission$ -

$translation.location$:
- INBO $if(geraardsbergen)$Geraardsbergen
Gaverstraat 4, 9500 Geraardsbergen$else$$translation.brussels$
Herman Teirlinckgebouw, Havenlaan 88 bus 73, 1000 $translation.brussels$$endif$$translation.country$ -
vlaanderen.be/inbo +

$translation.location$:
+ INBO $if(geraardsbergen)$Geraardsbergen
Gaverstraat 4, 9500 Geraardsbergen$else$$translation.brussels$
Herman Teirlinckgebouw, Havenlaan 88 bus 73, 1000 $translation.brussels$$endif$$translation.country$ +
vlaanderen.be/inbo -

e-mail:
$if(corresponding)$$corresponding$$else$info@inbo.be$endif$ +

e-mail:
$if(corresponding)$$corresponding$$else$info@inbo.be$endif$ -

$translation.citation$:
- $if(shortauthor)$ - $shortauthor$ - $else$ -

!!!! ONTBREKEND: shortauthor !!!!

- $endif$ - $if(year)$ - ($year$). - $else$ -

!!!! ONTBREKEND: year !!!!

- $endif$ - $title$$if(subtitle)$. $substitle$$endif$. $translation.series$ $translation.name$ - $if(year)$ - $year$ - $endif$ - $if(reportnr)$ - ($reportnr$). - $else$ -

!!!! ONTBREKEND: reportnr !!!!

- $endif$ - $translation.name$, $translation.brussels$. DOI: - $if(doi)$ - $doi$ - $else$ -

!!!! ONTBREKEND: doi !!!!

- $endif$ -
$translation.export$ - - - - +

$translation.citation$:
+ $if(shortauthor)$ + $shortauthor$ + $else$ +

!!!! ONTBREKEND: shortauthor !!!!

+ $endif$ + $if(year)$ + ($year$). + $else$ +

!!!! ONTBREKEND: year !!!!

+ $endif$ + $title$$if(subtitle)$. $substitle$$endif$. $translation.series$ $translation.name$ + $if(year)$ + $year$ + $endif$ + $if(reportnr)$ + ($reportnr$). + $else$ +

!!!! ONTBREKEND: reportnr !!!!

+ $endif$ + $translation.name$, $translation.brussels$. DOI: + $if(doi)$ + $doi$ + $else$ +

!!!! ONTBREKEND: doi !!!!

+ $endif$ +
$translation.export$ + + + + - $if(depotnr)$ -

$depotnr$
- $else$ -

!!!! ONTBREKEND: depotnr !!!!

- $endif$ - $translation.series$ $translation.name$ - $if(year)$ - $year$ - $endif$ - $if(reportnr)$ - ($reportnr$) - $endif$ -
- ISSN: 1782‐9054 + $if(depotnr)$ +

$depotnr$
+ $else$ +

!!!! ONTBREKEND: depotnr !!!!

+ $endif$ + $translation.series$ $translation.name$ + $if(year)$$year$$endif$ + $if(reportnr)$($reportnr$)$endif$ +
+ ISSN: 1782‐9054 -

$translation.vu$:
Maurice Hoffmann +

$translation.vu$:
Maurice Hoffmann - $if(cover_description)$ -

$translation.cover$:
$cover_description$ - $else$ -

!!!! ONTBREKEND: cover_description !!!!

- $endif$ + $if(cover_description)$ +

$translation.cover$:
$cover_description$ + $else$ +

!!!! ONTBREKEND: cover_description !!!!

+ $endif$ - $if(client)$ -

$translation.client$:
- $for(client)$ + $if(client)$ +

$translation.client$:
+ $for(client)$ $client$ - $sep$
- $endfor$ - $if(client_logo)$ -
- $endif$ - $endif$ + $sep$
+ $endfor$ + $if(client_logo)$ +
+ $endif$ + $endif$ - $if(cooperation)$ -

$translation.cooperation$:
- $for(cooperation)$ + $if(cooperation)$ +

$translation.cooperation$:
+ $for(cooperation)$ $cooperation$ - $sep$
- $endfor$ - $if(cooperation_logo)$ -
- $endif$ - $endif$ + $sep$
+ $endfor$ + $if(cooperation_logo)$ +
+ $endif$ + $endif$ -

Creative Commons-Licentie
$translation.license_pre$ $translation.license$. - +

Creative Commons-Licentie
$translation.license_pre$ $translation.license$. + + $endif$ $endif$ + diff --git a/man-roxygen/yaml_report.R b/man-roxygen/yaml_report.R index f12f75d3..9cbf86b9 100644 --- a/man-roxygen/yaml_report.R +++ b/man-roxygen/yaml_report.R @@ -1,19 +1,24 @@ #' @section Available YAML headers options specific for reports: #' -#' Bold items are required. +#' Bold items are required when creating a public report. #' Omitting them results in an ugly warning in the rendered document. #' This is deliberate done so you can prepare the document without adding the #' information. #' But the ugly warnings nudges you to add the required information before #' publication. #' +#' - `public_report`: A logical value indicating whether the report will be +#' published or not. +#' Setting `public_report: FALSE` will remove the colophon and replace the +#' DOI with a text indicating the report is unpublished. +#' Omitting `public_report` is equivalent to `public_report: TRUE`. #' - **`reviewer`**: names of the reviewers. #' Use the same syntax as for the authors. #' - **`year`**: year of publication. #' Used in the same places as `shortauthor`. #' - **`cover_photo`**: the relative path to the image you want on the cover. -#' - **`cover_description`**: Description of the cover photo, including information -#' on the author of the picture and license information. +#' - **`cover_description`**: Description of the cover photo, including +#' information on the author of the picture and license information. #' - `cover` the relative path to a pdf with the cover provided by the graphical #' designer. #' The first page of this pdf will be prepended to the pdf version of the diff --git a/man/epub_book.Rd b/man/epub_book.Rd index f1ed0519..c6aa9fb2 100644 --- a/man/epub_book.Rd +++ b/man/epub_book.Rd @@ -63,20 +63,25 @@ Add \code{corresponding: true} to the corresponding author. \section{Available YAML headers options specific for reports}{ -Bold items are required. +Bold items are required when creating a public report. Omitting them results in an ugly warning in the rendered document. This is deliberate done so you can prepare the document without adding the information. But the ugly warnings nudges you to add the required information before publication. \itemize{ +\item \code{public_report}: A logical value indicating whether the report will be +published or not. +Setting \code{public_report: FALSE} will remove the colophon and replace the +DOI with a text indicating the report is unpublished. +Omitting \code{public_report} is equivalent to \code{public_report: TRUE}. \item \strong{\code{reviewer}}: names of the reviewers. Use the same syntax as for the authors. \item \strong{\code{year}}: year of publication. Used in the same places as \code{shortauthor}. \item \strong{\code{cover_photo}}: the relative path to the image you want on the cover. -\item \strong{\code{cover_description}}: Description of the cover photo, including information -on the author of the picture and license information. +\item \strong{\code{cover_description}}: Description of the cover photo, including +information on the author of the picture and license information. \item \code{cover} the relative path to a pdf with the cover provided by the graphical designer. The first page of this pdf will be prepended to the pdf version of the diff --git a/man/gitbook.Rd b/man/gitbook.Rd index 206f2fbf..ac590e86 100644 --- a/man/gitbook.Rd +++ b/man/gitbook.Rd @@ -70,20 +70,25 @@ Add \code{corresponding: true} to the corresponding author. \section{Available YAML headers options specific for reports}{ -Bold items are required. +Bold items are required when creating a public report. Omitting them results in an ugly warning in the rendered document. This is deliberate done so you can prepare the document without adding the information. But the ugly warnings nudges you to add the required information before publication. \itemize{ +\item \code{public_report}: A logical value indicating whether the report will be +published or not. +Setting \code{public_report: FALSE} will remove the colophon and replace the +DOI with a text indicating the report is unpublished. +Omitting \code{public_report} is equivalent to \code{public_report: TRUE}. \item \strong{\code{reviewer}}: names of the reviewers. Use the same syntax as for the authors. \item \strong{\code{year}}: year of publication. Used in the same places as \code{shortauthor}. \item \strong{\code{cover_photo}}: the relative path to the image you want on the cover. -\item \strong{\code{cover_description}}: Description of the cover photo, including information -on the author of the picture and license information. +\item \strong{\code{cover_description}}: Description of the cover photo, including +information on the author of the picture and license information. \item \code{cover} the relative path to a pdf with the cover provided by the graphical designer. The first page of this pdf will be prepended to the pdf version of the diff --git a/man/pdf_report.Rd b/man/pdf_report.Rd index 78ed516a..cd7f5382 100644 --- a/man/pdf_report.Rd +++ b/man/pdf_report.Rd @@ -76,20 +76,25 @@ Add \code{corresponding: true} to the corresponding author. \section{Available YAML headers options specific for reports}{ -Bold items are required. +Bold items are required when creating a public report. Omitting them results in an ugly warning in the rendered document. This is deliberate done so you can prepare the document without adding the information. But the ugly warnings nudges you to add the required information before publication. \itemize{ +\item \code{public_report}: A logical value indicating whether the report will be +published or not. +Setting \code{public_report: FALSE} will remove the colophon and replace the +DOI with a text indicating the report is unpublished. +Omitting \code{public_report} is equivalent to \code{public_report: TRUE}. \item \strong{\code{reviewer}}: names of the reviewers. Use the same syntax as for the authors. \item \strong{\code{year}}: year of publication. Used in the same places as \code{shortauthor}. \item \strong{\code{cover_photo}}: the relative path to the image you want on the cover. -\item \strong{\code{cover_description}}: Description of the cover photo, including information -on the author of the picture and license information. +\item \strong{\code{cover_description}}: Description of the cover photo, including +information on the author of the picture and license information. \item \code{cover} the relative path to a pdf with the cover provided by the graphical designer. The first page of this pdf will be prepended to the pdf version of the From 7cdfac4872f855a4a28a4fbf2cde85ebc81203ba Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Fri, 24 Nov 2023 13:20:05 +0100 Subject: [PATCH 23/24] use colophon for internal reports --- R/ebook.R | 16 +++++---- R/gitbook.R | 23 ++++++------ R/pdf_report.R | 24 +++++++------ .../inborapport_2015/flanders_report.sty | 16 ++++++--- .../flanders_report_generic.sty | 26 +++++++++++++- .../latex/inborapport_2015/flandre_report.sty | 16 ++++++--- .../latex/inborapport_2015/inbo_report.sty | 16 ++++++--- .../inborapport_2015/vlaanderen_report.sty | 16 ++++++--- inst/pandoc/inbo_rapport.tex | 2 ++ inst/pandoc/translations.lua | 6 ++-- inst/template/report.epub3 | 28 ++++++++------- inst/template/report.html | 36 ++++++++++--------- man-roxygen/yaml_report.R | 5 +-- man/epub_book.Rd | 5 +-- man/gitbook.Rd | 5 +-- man/pdf_report.Rd | 5 +-- 16 files changed, 161 insertions(+), 84 deletions(-) diff --git a/R/ebook.R b/R/ebook.R index 809a6854..c9dc5855 100644 --- a/R/ebook.R +++ b/R/ebook.R @@ -54,13 +54,15 @@ epub_book <- function() { system.file(file.path("pandoc", "translations.lua"), package = "INBOmd") ) validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) - if (has_name(fm, "public_report") && !fm$public_report) { - c( - nl = "onuitgeven rapport", en = "unpublished report", - fr = "rapport non publi\u00e9" - )[lang] |> - pandoc_variable_arg(name = "doi") |> - c(pandoc_variable_arg("nocolophon", "true")) |> + if ( + !has_name(fm, "doi") && has_name(fm, "public_report") && !fm$public_report + ) { + Sys.time() |> + format("%Y-%m-%d %H:%M:%S") |> + c(fm$reportnr) |> + tail(1) |> + pandoc_variable_arg(name = "pagefootmessage") |> + c(pandoc_variable_arg("internal", "true")) |> c(pandoc_args) -> pandoc_args } else { c(fm$doi, "!!! missing DOI !!!") |> diff --git a/R/gitbook.R b/R/gitbook.R index 3ddd699f..a6af9a26 100644 --- a/R/gitbook.R +++ b/R/gitbook.R @@ -21,10 +21,6 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { yaml_front_matter() |> validate_persons(reviewer = TRUE) |> validate_rightsholder() -> fm - assert_that( - !has_name(fm, "nocolophon"), msg = "Legacy option `nocolophon` detected. - Please use the `public_report` option." - ) style <- ifelse(has_name(fm, "style"), fm$style, "INBO") assert_that(length(style) == 1) assert_that( @@ -67,13 +63,20 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { system.file(file.path("pandoc", "translations.lua"), package = "INBOmd") ) validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) - if (has_name(fm, "public_report") && !fm$public_report) { - c( - nl = "onuitgeven rapport", en = "unpublished report", - fr = "rapport non publi\u00e9" - )[lang] |> + if ( + !has_name(fm, "doi") && has_name(fm, "public_report") && !fm$public_report + ) { + Sys.time() |> + format("%Y-%m-%d %H:%M:%S") |> + c(fm$reportnr) |> + tail(1) |> + pandoc_variable_arg(name = "pagefootmessage") |> + c(pandoc_variable_arg("internal", "true")) |> + c(pandoc_args) -> pandoc_args + } else { + c(fm$doi, "!!! missing DOI !!!") |> + head(1) |> pandoc_variable_arg(name = "doi") |> - c(pandoc_variable_arg("nocolophon", "true")) |> c(pandoc_args) -> pandoc_args } diff --git a/R/pdf_report.R b/R/pdf_report.R index a11b2c0b..2555eac7 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -25,9 +25,10 @@ pdf_report <- function( yaml_front_matter() |> validate_persons(reviewer = TRUE) |> validate_rightsholder() -> fm - assert_that( - !has_name(fm, "nocolophon"), msg = "Legacy option `nocolophon` detected. - Please use the `public_report` option." + stopifnot( + "`internal` option in yaml is not allowed" = !has_name(fm, "internal"), + "`pagefootmessage` option in yaml is not allowed" = + !has_name(fm, "pagefootmessage") ) floatbarrier <- ifelse(has_name(fm, "floatbarrier"), fm$floatbarrier, NA) assert_that(length(floatbarrier) == 1) @@ -104,13 +105,15 @@ pdf_report <- function( ) args <- args[args != ""] validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) - if (has_name(fm, "public_report") && !fm$public_report) { - c( - nl = "onuitgeven rapport", en = "unpublished report", - fr = "rapport non publi\u00e9" - )[lang] |> - pandoc_variable_arg(name = "doi") |> - c(pandoc_variable_arg("nocolophon", "true")) |> + if ( + !has_name(fm, "doi") && has_name(fm, "public_report") && !fm$public_report + ) { + Sys.time() |> + format("%Y-%m-%d %H:%M:%S") |> + c(fm$reportnr) |> + tail(1) |> + pandoc_variable_arg(name = "pagefootmessage") |> + c(pandoc_variable_arg("internal", "true")) |> c(args) -> args } else { c(fm$doi, "!!! missing DOI !!!") |> @@ -119,7 +122,6 @@ pdf_report <- function( c(args) -> args } - if (has_name(fm, "lof") && isTRUE(fm$lof)) { args <- c(args, pandoc_variable_arg("lof", TRUE)) } diff --git a/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty b/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty index f8da7f1e..eb8c246a 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flanders_report.sty @@ -14,8 +14,12 @@ \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/en}{www.vlaanderen.be}}}} -\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} -\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename~\textbf{\thepage}~/~\textbf{\pageref*{LastPage}}}} +\ifnum \@public = 0 +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} +\else +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -25,8 +29,12 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/en}{www.vlaanderen.be}}}} - \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} + \ifnum \@public = 0 + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} + \else + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} + \fi + \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename~\textbf{ \thepage}~/~\textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } diff --git a/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty b/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty index 0dad1d8b..457e4979 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flanders_report_generic.sty @@ -23,9 +23,15 @@ \def\subtitle#1{\def\@subtitle{#1}} \subtitle{} +\def\pagefootmessage#1{\def\@pagefootmessage{#1}} +\pagefootmessage{} + \def\colophon#1{\def\@colophon{#1}} \colophon{1} +\def\public#1{\def\@public{#1}} +\public{1} + \def\colofonauthor#1{\def\@colofonauthor{#1}} \colofonauthor{} @@ -501,6 +507,15 @@ \addto\extrasfrench{% \def\cfseries{Rapports de \cfinbo}% } +\addto\extrasdutch{% + \def\cfiseries{Interne rapporten van het \cfinbo}% +} +\addto\extrasenglish{% + \def\cfiseries{Internal reports of the \cfinbo}% +} +\addto\extrasfrench{% + \def\cfiseries{Rapports internes de \cfinbo}% +} \addto\extrasdutch{% \def\cfcity{Brussel}% } @@ -591,11 +606,18 @@ \textbf{e-mail:} \\ \@corresponding + \ifnum \@public = 0 + \textbf{\cfcitation} \\ \@shortauthor~(\@year). \@citetitle. \cfiseries~\@year~(\@reportnr). \cfinbo, \cfcity. + + \textbf{\cfiseries~\@year~(\@reportnr)} + \else \textbf{\cfcitation} \\ \@shortauthor~(\@year). \@citetitle. \cfseries~\@year~(\@reportnr). \cfinbo, \cfcity. DOI: \@doi \textbf{\@depotnr} \\ \textbf{\cfseries~\@year~(\@reportnr)} \\ \textbf{ISSN: 1782-9054} + \fi + \textbf{\cfvu} \\ Maurice Hoffmann @@ -635,7 +657,9 @@ \vspace{144pt} \hspace{10mm}\parbox[t]{140mm}{ - \fontsize{\fontsizeordernr}{\fontsizeordernrinter}\selectfont \raggedright \mainColourURL{\@doi} \\ \@ordernumber + \fontsize{\fontsizeordernr}{\fontsizeordernrinter}\selectfont \raggedright + \ifnum \@public > 1 \@doi \\ \fi + \@ordernumber } \vfill diff --git a/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty b/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty index 9e36ed42..90ccbbf0 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/flandre_report.sty @@ -14,8 +14,12 @@ \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}} -\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} -\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename~\textbf{\thepage}~/~\textbf{\pageref*{LastPage}}}} +\ifnum \@public = 0 +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} +\else +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -25,8 +29,12 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/fr}{www.vlaanderen.be}}}} - \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename \textbf{ \thepage} / \textbf{\pageref*{LastPage}}}} + \ifnum \@public = 0 + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} + \else + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} + \fi + \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \pagename~\textbf{\thepage}~/~\textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } diff --git a/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty b/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty index b533acef..578e47f6 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty @@ -14,8 +14,12 @@ \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}} -\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} -\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina~\textbf{\thepage}~van~\textbf{\pageref*{LastPage}}}} +\ifnum \@public = 0 +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} +\else +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -25,8 +29,12 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}} - \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} + \ifnum \@public = 0 + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} + \else + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} + \fi + \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina~\textbf{\thepage}~van~\textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } diff --git a/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty b/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty index fbf52c4a..67a1b28f 100644 --- a/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty +++ b/inst/local_tex/tex/latex/inborapport_2015/vlaanderen_report.sty @@ -13,8 +13,12 @@ \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be}{www.vlaanderen.be}}}} -\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} -\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} +\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina~\textbf{\thepage}~van~\textbf{\pageref*{LastPage}}}} +\ifnum \@public = 0 +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} +\else +\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} +\fi \renewcommand{\footrule}{\vbox to 8pt{\hbox to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}} \renewcommand{\headrulewidth}{0pt} @@ -24,8 +28,12 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter} \fancyhead{} \fancyfoot{} \fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be}{www.vlaanderen.be}}}} - \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\@doi}}} - \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina \textbf{\thepage} van \textbf{\pageref*{LastPage}}}} + \ifnum \@public = 0 + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}} + \else + \fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}} + \fi + \fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina~\textbf{\thepage}~van~\textbf{\pageref*{LastPage}}}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } diff --git a/inst/pandoc/inbo_rapport.tex b/inst/pandoc/inbo_rapport.tex index 682f6b69..a0ad2fe6 100644 --- a/inst/pandoc/inbo_rapport.tex +++ b/inst/pandoc/inbo_rapport.tex @@ -117,6 +117,8 @@ $if(hyphentation)$\hyphenation{$hyphentation$}$endif$ $if(nocolophon)$\colophon{0}$else$\colophon{1}$endif$ +$if(internal)$\public{0}$else$\public{1}$endif$ +$if(pagefootmessage)$\pagefootmessage{$pagefootmessage$}$endif$ $for(header-includes)$ $header-includes$ diff --git a/inst/pandoc/translations.lua b/inst/pandoc/translations.lua index 41edff6f..2b6048ad 100644 --- a/inst/pandoc/translations.lua +++ b/inst/pandoc/translations.lua @@ -12,6 +12,7 @@ local function translation(lang) cover = "Foto cover", depotnr = "Depotnummer", export = "Exporteer referentie als", + iseries = "Interne rapporten van het", license_pre = "Dit werk valt onder een", license = "Creative Commons Naamsvermelding 4.0 Internationaal-licentie", location = "Vestiging", @@ -20,7 +21,6 @@ local function translation(lang) ordernr = "Opdrachtnummer", reviewer = "Nagelezen door", series = "Rapporten van het", - unpublished = "Onuitgegeven rapport", vu = "Verantwoordelijke uitgever", year = "Gepubliceerd in" } @@ -35,6 +35,7 @@ local function translation(lang) country = ", Belgique", cover = "Photo de couverture", depotnr = "Numéro de dépôt", + iseries = "Rapports internes de", export = "Exporter la référence à", license_pre = "Ce rapport est sous licence", license = "Creative Commons Attribution 4.0 International Licence", @@ -44,7 +45,6 @@ local function translation(lang) ordernr = "Numéro de commande", reviewer = "Examiné par", series = "Rapports de", - unpublished = "Rapport non publié", vu = "Éditeur responsable", year = "Publié en" } @@ -60,6 +60,7 @@ local function translation(lang) country = ", Belgium", depotnr = "Deposit number", export = "Export reference to", + iseries = "Internal reports of the", license_pre = "This work is licensed under a", license = "Creative Commons Attribution 4.0 International License", location = "Location", @@ -68,7 +69,6 @@ local function translation(lang) ordernr = "Order number", reviewer = "Reviewed by", series = "Reports of the", - unpublished = "Unpublished report", vu = "Responsible publisher", year = "Published during" } diff --git a/inst/template/report.epub3 b/inst/template/report.epub3 index b5dbae2e..f2564e10 100644 --- a/inst/template/report.epub3 +++ b/inst/template/report.epub3 @@ -67,7 +67,6 @@ $if(titlepage)$

$ordernr$

$endif$ $if(nocolophon)$ -

$translation.unpublished$

$else$

$translation.colophon$

$if(reviewer)$ @@ -107,7 +106,7 @@ $if(titlepage)$ $else$

!!!! ONTBREKEND: year !!!!

$endif$ - $title$$if(subtitle)$. $substitle$$endif$. $translation.series$ $translation.name$ + $title$$if(subtitle)$. $substitle$$endif$. $if(internal)$$translation.iseries$$else$$translation.series$$endif$ $translation.name$ $if(year)$ $year$ $endif$ @@ -116,18 +115,23 @@ $if(titlepage)$ $else$

!!!! ONTBREKEND: reportnr !!!!

$endif$ - $translation.name$, $translation.brussels$. DOI: - $if(doi)$ - $doi$ - $else$ -

!!!! ONTBREKEND: doi !!!!

+ $translation.name$, $translation.brussels$.$if(internal)$$else$ DOI: + $if(doi)$ + $doi$ + $else$ +

!!!! ONTBREKEND: doi !!!!

+ $endif$ $endif$ - $if(depotnr)$ -

$depotnr$
+ $if(internal)$ +

$translation.iseries$ $translation.name$ $else$ -

!!!! ONTBREKEND: depotnr !!!!

+ $if(depotnr)$ +

$depotnr$
+ $else$ +

!!!! ONTBREKEND: depotnr !!!!

+ $endif$ + $translation.series$ $translation.name$ $endif$ - $translation.series$ $translation.name$ $if(year)$ $year$ $endif$ @@ -135,7 +139,7 @@ $if(titlepage)$ ($reportnr$) $endif$
- ISSN: 1782‐9054 +$if(internal)$$else$ ISSN: 1782‐9054$endif$

$translation.vu$:
Maurice Hoffmann diff --git a/inst/template/report.html b/inst/template/report.html index 3412f4cb..75e337eb 100644 --- a/inst/template/report.html +++ b/inst/template/report.html @@ -131,7 +131,6 @@

$doi$

$ordernr$

$endif$ $if(nocolophon)$ -

$translation.unpublished$

$else$

$translation.colophon$

$if(reviewer)$ @@ -171,7 +170,7 @@

!!!! ONTBREKEND: shortauthor !!!!

$else$

!!!! ONTBREKEND: year !!!!

$endif$ - $title$$if(subtitle)$. $substitle$$endif$. $translation.series$ $translation.name$ + $title$$if(subtitle)$. $substitle$$endif$. $if(internal)$$translation.iseries$$else$$translation.series$$endif$ $translation.name$ $if(year)$ $year$ $endif$ @@ -180,11 +179,12 @@

!!!! ONTBREKEND: year !!!!

$else$

!!!! ONTBREKEND: reportnr !!!!

$endif$ - $translation.name$, $translation.brussels$. DOI: - $if(doi)$ - $doi$ - $else$ -

!!!! ONTBREKEND: doi !!!!

+ $translation.name$, $translation.brussels$. $if(internal)$$else$DOI: + $if(doi)$ + $doi$ + $else$ +

!!!! ONTBREKEND: doi !!!!

+ $endif$ $endif$
$translation.export$ @@ -209,7 +209,7 @@

!!!! ONTBREKEND: doi !!!!

adress = {$if(geraardsbergen)$Geraardsbergen$else$$translation.brussels$$endif$$translation.country$}, year = {$year$}, number = {$year$ ($reportnr$)}, - doi = {$doi$}, +$if(doi)$ doi = {$doi$},$endif$ type = {techreport} } @@ -218,11 +218,11 @@

!!!! ONTBREKEND: doi !!!!

TY - RPRT $for(author)$AU - $author.name.family$, $author.name.given$$sep$
$endfor$ TI - $title$$if(subtitle)$. $subtitle$$endif$ -DO - $doi$ +$if(doi)$DO - $doi$$endif$ PB - $translation.name$ PP - $if(geraardsbergen)$Geraardsbergen$else$$translation.brussels$$endif$$translation.country$ PY - $year$ -SN - 1782-9054 +$if(internal)$$else$SN - 1782-9054$endif$ ER - @@ -245,16 +245,20 @@

!!!! ONTBREKEND: doi !!!!

} - $if(depotnr)$ -

$depotnr$
+ $if(internal)$ +

$translation.iseries$ $translation.name$ $else$ -

!!!! ONTBREKEND: depotnr !!!!

+ $if(depotnr)$ +

$depotnr$
+ $else$ +

!!!! ONTBREKEND: depotnr !!!!

+ $endif$ + $translation.series$ $translation.name$ $endif$ - $translation.series$ $translation.name$ $if(year)$$year$$endif$ $if(reportnr)$($reportnr$)$endif$
- ISSN: 1782‐9054 + $if(internal)$$else$ISSN: 1782‐9054$endif$

$translation.vu$:
Maurice Hoffmann @@ -337,7 +341,7 @@

$endfor$

 

Creative Commons-Licentie -$shortauthor$ ($year$). $doi$ +$shortauthor$ ($year$). $if(doi)$$doi$$endif$ diff --git a/man-roxygen/yaml_report.R b/man-roxygen/yaml_report.R index 9cbf86b9..c7c3b978 100644 --- a/man-roxygen/yaml_report.R +++ b/man-roxygen/yaml_report.R @@ -9,9 +9,10 @@ #' #' - `public_report`: A logical value indicating whether the report will be #' published or not. -#' Setting `public_report: FALSE` will remove the colophon and replace the -#' DOI with a text indicating the report is unpublished. +#' Setting `public_report: FALSE` will alter the colophon. #' Omitting `public_report` is equivalent to `public_report: TRUE`. +#' An internal report can't have a DOI. +#' Setting a DOI is equivalent to `public_report: TRUE`. #' - **`reviewer`**: names of the reviewers. #' Use the same syntax as for the authors. #' - **`year`**: year of publication. diff --git a/man/epub_book.Rd b/man/epub_book.Rd index c6aa9fb2..1f840178 100644 --- a/man/epub_book.Rd +++ b/man/epub_book.Rd @@ -72,9 +72,10 @@ publication. \itemize{ \item \code{public_report}: A logical value indicating whether the report will be published or not. -Setting \code{public_report: FALSE} will remove the colophon and replace the -DOI with a text indicating the report is unpublished. +Setting \code{public_report: FALSE} will alter the colophon. Omitting \code{public_report} is equivalent to \code{public_report: TRUE}. +An internal report can't have a DOI. +Setting a DOI is equivalent to \code{public_report: TRUE}. \item \strong{\code{reviewer}}: names of the reviewers. Use the same syntax as for the authors. \item \strong{\code{year}}: year of publication. diff --git a/man/gitbook.Rd b/man/gitbook.Rd index ac590e86..a56dd372 100644 --- a/man/gitbook.Rd +++ b/man/gitbook.Rd @@ -79,9 +79,10 @@ publication. \itemize{ \item \code{public_report}: A logical value indicating whether the report will be published or not. -Setting \code{public_report: FALSE} will remove the colophon and replace the -DOI with a text indicating the report is unpublished. +Setting \code{public_report: FALSE} will alter the colophon. Omitting \code{public_report} is equivalent to \code{public_report: TRUE}. +An internal report can't have a DOI. +Setting a DOI is equivalent to \code{public_report: TRUE}. \item \strong{\code{reviewer}}: names of the reviewers. Use the same syntax as for the authors. \item \strong{\code{year}}: year of publication. diff --git a/man/pdf_report.Rd b/man/pdf_report.Rd index cd7f5382..10a06d5c 100644 --- a/man/pdf_report.Rd +++ b/man/pdf_report.Rd @@ -85,9 +85,10 @@ publication. \itemize{ \item \code{public_report}: A logical value indicating whether the report will be published or not. -Setting \code{public_report: FALSE} will remove the colophon and replace the -DOI with a text indicating the report is unpublished. +Setting \code{public_report: FALSE} will alter the colophon. Omitting \code{public_report} is equivalent to \code{public_report: TRUE}. +An internal report can't have a DOI. +Setting a DOI is equivalent to \code{public_report: TRUE}. \item \strong{\code{reviewer}}: names of the reviewers. Use the same syntax as for the authors. \item \strong{\code{year}}: year of publication. From e17c41b641213f44b85fe5f6a4be3d6a79d81ef2 Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Fri, 24 Nov 2023 14:33:27 +0100 Subject: [PATCH 24/24] fix checklist issues --- DESCRIPTION | 2 ++ R/gitbook.R | 4 ++-- R/pdf_report.R | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3e81f8a7..c89b1d6f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,6 +17,8 @@ License: GPL-3 URL: https://inbo.github.io/INBOmd/, https://github.com/inbo/inbomd, https://doi.org/10.5281/zenodo.842223 BugReports: https://github.com/inbo/inbomd/issues +Depends: + R (>= 3.5.0) Imports: assertthat, bookdown (>= 0.23.4), diff --git a/R/gitbook.R b/R/gitbook.R index a6af9a26..be3f39d2 100644 --- a/R/gitbook.R +++ b/R/gitbook.R @@ -127,7 +127,7 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { template = template, extra_dependencies = list(inbomd_dep), code_folding = code_folding ) - old_post <- config$post_processor # in case a post processor have been defined + op <- config$post_processor # in case a post processor have been defined config$post_processor <- function(metadata, input, output, clean, verbose) { file(output, encoding = "UTF-8") |> readLines() -> x @@ -136,7 +136,7 @@ gitbook <- function(code_folding = c("none", "show", "hide")) { x <- c(head(x, i - 1), "", tail(x, -i + 1)) } writeLines(x, output) - old_post(metadata, input, output, clean, verbose) + op(metadata, input, output, clean, verbose) } config$clean_supporting <- TRUE return(config) diff --git a/R/pdf_report.R b/R/pdf_report.R index 2555eac7..9b6304a5 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -106,7 +106,7 @@ pdf_report <- function( args <- args[args != ""] validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) if ( - !has_name(fm, "doi") && has_name(fm, "public_report") && !fm$public_report + has_name(fm, "public_report") && !fm$public_report ) { Sys.time() |> format("%Y-%m-%d %H:%M:%S") |>