Skip to content

Commit 05522af

Browse files
eliocampyihui
authored andcommitted
Adds 100 character warning to AGU article (#212)
* Adds check for 100 chars limit * Changes eval * Removes test keypoints
1 parent 6bb2214 commit 05522af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

inst/rmarkdown/templates/agu_article/skeleton/skeleton.Rmd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,16 @@ knitr::opts_chunk$set(
6666
out.extra = "", # To force the use of figure enviroment
6767
fig.cap = "Please caption every figure"
6868
)
69+
```
6970

71+
```{r keypoints_check, echo=FALSE, results='asis', eval = TRUE}
72+
# This chunk adds a warning if any keypoint is longer than 100 characters.
73+
# To disable it, you can remove it or set eval to FALSE.
74+
if (any(nchar(rmarkdown::metadata$keypoints) > 100)) {
75+
cat("\\textcolor{red}{\\textbf{Warning}: keypoint(s)",
76+
knitr::combine_words(which(nchar(rmarkdown::metadata$keypoints) > 100)),
77+
"longer than 100 characters.}")
78+
}
7079
```
7180

7281
Suggested section heads

0 commit comments

Comments
 (0)