Skip to content

Commit 9cebd6d

Browse files
committed
fixed issues 132, 133, 134
1 parent 74bf79d commit 9cebd6d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: rjtools
22
Title: Preparing, Checking, and Submitting Articles to the 'R Journal'
3-
Version: 1.0.18
3+
Version: 1.0.19
44
Authors@R:
55
c(person(given = "Mitchell",
66
family = "O'Hara-Wild",

NEWS.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# rjtools 1.0.18
2+
3+
Fix issues #132, 133, 134. Warnings instead of errors reported when potential problems with section headings and title given.
4+
15
# rjtools 1.0.17
26

37
* Added technical editors to issue template.

R/check.R

+4-3
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ check_title <- function(path, ignore = ""){
263263
}
264264

265265
if (!res$result){
266-
log_error("Article title not in title case! Suggest title: {res$suggest}.")
266+
log_warning("Article title not in title case! Suggest title: {res$suggest}.")
267267
} else{
268268
log_success("Article title formatted in title case.")
269269
}
@@ -308,7 +308,7 @@ check_section <- function(path){
308308
dt <- do.call(rbind, lapply(str_remove(str, " R"), check_sentence_case))
309309
res <- paste0(str[!dt[["in_sentence_case"]]], collapse = ", ")
310310
if (nchar(res) != 0){
311-
log_error("Section {res} is not in sentence case!")
311+
log_warning("Section {res} is not in sentence case!")
312312
} else{
313313
log_success("Section titles formatted in sentence case.")
314314
}
@@ -379,7 +379,8 @@ check_spelling <- function(path, dic = "en_US", ...){
379379
detect_abstract <- purrr::map(tex, ~stringr::str_extract(.x, "(?<=\\\\abstract\\{).*?"))
380380
abstract_loc <- match(detect_abstract[!is.na(detect_abstract)], detect_abstract)
381381

382-
detect_bib <- purrr::map(tex, ~stringr::str_extract(.x, "\\\\section\\*\\{References\\}"))
382+
#detect_bib <- purrr::map(tex, ~stringr::str_extract(.x, "\\\\section\\*\\{References\\}"))
383+
detect_bib <- purrr::map(tex, ~stringr::str_extract(.x, "(?<=\\\\bibliography\\{).*?(?=\\})")) # Reverse 3950d84, issue #132
383384
bib_loc <- match(detect_bib[!is.na(detect_bib)], detect_bib)
384385

385386
# spell_to_remove is a pre-defined vector of latex commands

0 commit comments

Comments
 (0)