R/extract_authors_from_bib.R

Defines functions extract_authors_from_bib

extract_authors_from_bib <- function(bib.file){
  read_lines(bib.file) %>%
    grep("^\\s+author", ., value = TRUE, perl = TRUE) %>%
    gsub("^.*[=]\\s+", "", ., perl = TRUE) %>%
    gsub("[\\{\\},]", "", ., perl = TRUE) %>%
    strsplit(split = " ", fixed = TRUE) %>%
    unlist %>%
    unique %>%
    .[nchar(.) > 1L] 
    
    
}

Try the TeXCheckR package in your browser

Any scripts or data that you put into this service are public.

TeXCheckR documentation built on May 29, 2024, 7:20 a.m.