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, " Reviewers: $depotnr$ $translation.iseries$ $translation.name$
$else$
- $depotnr$ $translation.vu$: $date$ $date$ Reviewers: Reviewers: $translation.mission$
+ $translation.mission$
- $translation.location$: $translation.location$: e-mail: e-mail: $translation.citation$: $translation.citation$: $depotnr$ $translation.iseries$ $translation.name$
+ $else$
+ $if(depotnr)$
+ $depotnr$ $translation.vu$: $translation.vu$: $translation.cover$: $translation.cover$: $translation.client$: $translation.client$: $translation.cooperation$: $translation.cooperation$:
-$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}
$ordernr$
$endif$
+ $if(nocolophon)$
+ $else$
$translation.colophon$
$if(reviewer)$
@@ -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)$
-
+ $if(internal)$
+ !!!! ONTBREKEND: depotnr !!!!
+ $if(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$
Hilde Eggermont
@@ -160,6 +167,7 @@ $if(titlepage)$
$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)$
-
$doi$
+ $doi$
$endif$
$if(ordernr)$
- $ordernr$
+ $ordernr$
$endif$
- $translation.colophon$
- $if(reviewer)$
-
- $for(reviewer)$
- $reviewer.name.given$ $reviewer.name.family$
- $if(reviewer.orcid)$
-
-
- $reviewer.orcid$
-
- $endif$
- $if(reviewer.email)$
- $reviewer.email$
- $endif$
- $endfor$
+ $if(nocolophon)$
$else$
- !!!! ONTBREKEND: reviewer !!!!
- $endif$
+ $translation.colophon$
+ $if(reviewer)$
+
+ $for(reviewer)$
+ $reviewer.name.given$ $reviewer.name.family$
+ $if(reviewer.orcid)$
+
+
+ $reviewer.orcid$
+
+ $endif$
+ $if(reviewer.email)$
+ $reviewer.email$
+ $endif$
+ $endfor$
+ $else$
+ !!!! ONTBREKEND: reviewer !!!!
+ $endif$
-
- 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
+
+ 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
-
$if(corresponding)$$corresponding$$else$info@inbo.be$endif$
+
$if(corresponding)$$corresponding$$else$info@inbo.be$endif$
-
- $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(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)$
-
- $else$
- !!!! ONTBREKEND: depotnr !!!!
- $endif$
- $translation.series$ $translation.name$
- $if(year)$
- $year$
- $endif$
- $if(reportnr)$
- ($reportnr$)
- $endif$
-
- ISSN: 1782‐9054
+ $if(internal)$
+
+ $else$
+ !!!! ONTBREKEND: depotnr !!!!
+ $endif$
+ $translation.series$ $translation.name$
+ $endif$
+ $if(year)$$year$$endif$
+ $if(reportnr)$($reportnr$)$endif$
+
+ $if(internal)$$else$ISSN: 1782‐9054$endif$
-
Hilde Eggermont
+
Hilde Eggermont
- $if(cover_description)$
-
$cover_description$
- $else$
- !!!! ONTBREKEND: cover_description !!!!
- $endif$
+ $if(cover_description)$
+
$cover_description$
+ $else$
+ !!!! ONTBREKEND: cover_description !!!!
+ $endif$
- $if(client)$
-
- $for(client)$
+ $if(client)$
+
+ $for(client)$
$client$
- $sep$
- $endfor$
- $if(client_logo)$
-
- $endif$
- $endif$
+ $sep$
+ $endfor$
+ $if(client_logo)$
+
+ $endif$
+ $endif$
- $if(cooperation)$
-
- $for(cooperation)$
+ $if(cooperation)$
+
+ $for(cooperation)$
$cooperation$
- $sep$
- $endfor$
- $if(cooperation_logo)$
-
- $endif$
- $endif$
+ $sep$
+ $endfor$
+ $if(cooperation_logo)$
+
+ $endif$
+ $endif$
-
$translation.license_pre$ $translation.license$.
-
+
$translation.license_pre$ $translation.license$.
+
+ $endif$
$endif$
+
@@ -336,7 +341,7 @@
$endfor$