diff --git a/.github/workflows/check_on_branch.yml b/.github/workflows/check_on_branch.yml index 0792184c..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@checklist-0.3.2 + - 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 4f5c8e5e..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@checklist-0.3.2 + - uses: inbo/actions/check_pkg@checklist-0.3.6 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 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 diff --git a/.zenodo.json b/.zenodo.json index 89ddb811..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>", @@ -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..f66cbab6 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,9 +1,10 @@ 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 + affiliation: Research Institute for Nature and Forest (INBO) orcid: 0000-0001-8804-4216 keywords: - markdown @@ -13,15 +14,16 @@ 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 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.1 + value: https://inbo.github.io/INBOmd/ +version: 0.6.2 diff --git a/DESCRIPTION b/DESCRIPTION index df4bdab3..c89b1d6f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,21 +1,24 @@ 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")), + 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 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 +Depends: + R (>= 3.5.0) Imports: assertthat, bookdown (>= 0.23.4), 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 diff --git a/NAMESPACE b/NAMESPACE index a0ca9e38..8b55d6d3 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,"%>%") @@ -72,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/NEWS.md b/NEWS.md index 48094b0c..7769dde5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,16 @@ +# INBOmd 0.6.2 + +* Bugfixes + # 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 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..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) { @@ -37,6 +38,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 +58,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 +77,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 @@ -80,6 +91,8 @@ msg = "The report name folder may only contain lower case letters, digits and _" 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", @@ -106,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", - "funder: Research Institute for Nature and Forest (INBO)", - "rightsholder: Research Institute for Nature and Forest (INBO)", + 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", @@ -245,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")) @@ -280,3 +292,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/ebook.R b/R/ebook.R index 2fd17cf1..c9dc5855 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,23 @@ 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, "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_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..be3f39d2 100644 --- a/R/gitbook.R +++ b/R/gitbook.R @@ -53,7 +53,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 +62,24 @@ 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, "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_args) -> pandoc_args + } + assert_that( getwd() |> path("index.Rmd") |> @@ -110,7 +127,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 + 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 @@ -119,7 +136,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) + 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 82a26799..9b6304a5 100644 --- a/R/pdf_report.R +++ b/R/pdf_report.R @@ -25,6 +25,11 @@ pdf_report <- function( yaml_front_matter() |> validate_persons(reviewer = TRUE) |> validate_rightsholder() -> fm + 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) assert_that( @@ -68,7 +73,6 @@ pdf_report <- function( paste(sprintf("'%s' (%s)", names(languages), languages), collapse = ", ") ) ) - validate_doi(ifelse(has_name(fm, "doi"), fm$doi, "1.1/1")) path("pandoc", "inbo_rapport.tex") |> system.file(package = "INBOmd") -> template @@ -100,6 +104,23 @@ 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 + ) { + 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 !!!") |> + 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)) @@ -250,7 +271,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,29 +302,54 @@ 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 one of %s", + person$name$given, person$name$family, + paste0("`", inbo_affiliation, "`", collapse = "; ") + ) |> + 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% inbo_affiliation) { + sprintf( + "`affiliation` for %s %s must be one of %s", person$name$given, + person$name$family, paste0("`", inbo_affiliation, "`", collapse = "; ") + ) |> + 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) } #' @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), @@ -312,8 +357,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), @@ -322,6 +365,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) } @@ -345,3 +395,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, ignore.case = TRUE) +} 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, diff --git a/R/sysdata.rda b/R/sysdata.rda new file mode 100644 index 00000000..9ebb2dde Binary files /dev/null and b/R/sysdata.rda differ diff --git a/inst/CITATION b/inst/CITATION index 504c4e17..0503542b 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/", + 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.1. 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", ) 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} 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 e5c28424..7a49b116 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} \\ Hilde Eggermont @@ -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 c90f3e63..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", @@ -34,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", @@ -58,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", 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") diff --git a/inst/template/report.epub3 b/inst/template/report.epub3 index ab134da8..6be22035 100644 --- a/inst/template/report.epub3 +++ b/inst/template/report.epub3 @@ -66,6 +66,8 @@ $if(titlepage)$ $if(ordernr)$

$ordernr$

$endif$ + $if(nocolophon)$ + $else$

$translation.colophon$

$if(reviewer)$

Reviewers:
@@ -104,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$ @@ -113,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$ @@ -132,7 +139,7 @@ $if(titlepage)$ ($reportnr$) $endif$
- ISSN: 1782‐9054 +$if(internal)$$else$ ISSN: 1782‐9054$endif$

$translation.vu$:
Hilde Eggermont @@ -160,6 +167,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 02d77cd2..eba6cf3a 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)$ $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$. $if(internal)$$translation.iseries$$else$$translation.series$$endif$ $translation.name$ + $if(year)$ + $year$ + $endif$ + $if(reportnr)$ + ($reportnr$). + $else$ +

!!!! ONTBREKEND: reportnr !!!!

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

!!!! ONTBREKEND: doi !!!!

+ $endif$ + $endif$ +
$translation.export$ + + + + @@ -215,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 - @@ -230,66 +233,68 @@

!!!! ONTBREKEND: doi !!!!

"title":"$title$$if(subtitle)$. $subtitle$$endif$", "author":[ $for(author)${ - "family":"$author.name.family$", - "given":"$author.name.given$" + "family":"$author.name.family$", + "given":"$author.name.given$" $sep$}, $endfor$ } ], - "issued":{"date-parts":[[$year$]]}, - "publisher":"$translation.name$", - "publisher-place":"$if(geraardsbergen)$Geraardsbergen$else$$translation.brussels$$endif$$translation.country$", +"issued":{"date-parts":[[$year$]]}, +"publisher":"$translation.name$", +"publisher-place":"$if(geraardsbergen)$Geraardsbergen$else$$translation.brussels$$endif$$translation.country$", } - $if(depotnr)$ -

$depotnr$
- $else$ -

!!!! ONTBREKEND: depotnr !!!!

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

$translation.iseries$ $translation.name$ + $else$ + $if(depotnr)$ +

$depotnr$
+ $else$ +

!!!! ONTBREKEND: depotnr !!!!

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

$translation.vu$:
Hilde Eggermont +

$translation.vu$:
Hilde Eggermont - $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$ + @@ -336,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 f12f75d3..c7c3b978 100644 --- a/man-roxygen/yaml_report.R +++ b/man-roxygen/yaml_report.R @@ -1,19 +1,25 @@ #' @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 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. #' 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/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/epub_book.Rd b/man/epub_book.Rd index f1ed0519..1f840178 100644 --- a/man/epub_book.Rd +++ b/man/epub_book.Rd @@ -63,20 +63,26 @@ 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 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. 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..a56dd372 100644 --- a/man/gitbook.Rd +++ b/man/gitbook.Rd @@ -70,20 +70,26 @@ 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 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. 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/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/pdf_report.Rd b/man/pdf_report.Rd index 78ed516a..10a06d5c 100644 --- a/man/pdf_report.Rd +++ b/man/pdf_report.Rd @@ -76,20 +76,26 @@ 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 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. 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/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}