# Format a publication's author listformat_authors <-function(authors) {# Split authors' names (First MI Last or First Last) authors_split <- stringr::str_split(authors, " ")# Format as Last, FI. or Last, FI.MI. authors_formatted <- purrr::map_chr( authors_split,function(parts) {if (length(parts) ==3) {sprintf("%s %s.%s.", parts[1], substr(parts[2], 1, 1), substr(parts[3], 1, 1)) } else {sprintf("%s %s.", parts[1], substr(parts[2], 1, 1)) } } )# Shorten long author listsif (length(authors_formatted) >7) { authors_short <-c(authors_formatted[1:5], "...", authors_formatted[length(authors_formatted)]) } else { authors_short <- authors_formatted }# Make my name bold authors_short[authors_short =="Payne, A.R."] <-"<strong>Payne, A.R.</strong>"# Concatenatepaste(authors_short, collapse =", ")}# Read bib filepubs <-suppressWarnings(bib2df::bib2df("works.bib")) |># Retain relevant fields and format author list dplyr::transmute(authors = purrr::map_chr(AUTHOR, format_authors),title = TITLE,journal = JOURNAL,year = YEAR ) |># Format in HTML. Markdown doesn't support reverse ordered lists?? dplyr::mutate(pub_html = glue::glue("<li>{authors}. ({year}). {title}. <em>{journal}</em>.") ) |> dplyr::pull(pub_html)# Reverse ordered listc("<ol reversed>", pubs,"</ol>") |>cat()
Markowitz, T.M., Keener, W., Webber, M.A., Payne, A.R., Lane, R.S., Fahlbusch, J.A., Calambokidis, J.. (2024). New urban habitat for endangered humpback whales: San Francisco Bay. Aquatic Conservation: Marine and Freshwater Ecosystems.
Cronin, M.R., Zavaleta, E.S., Beltran, R.S., Esparza, M., Payne, A.R., …, Jones, M.S.. (2024). Testing the effectiveness of interactive training on sexual harassment and assault in field science. Scientific reports.
Abdel-Raheem, S.T., Payne, A.R., Rivera, M., Sturdivant, K., W., …, Beltran, R.. (2023). Oceanography’s Diversity Deficit: Identifying and Addressing Challenges for Marginalized Groups. Oceanography.
Webber, M.A., Keener, W., Spears, A.C., Cotter, M.P., Lane, R.S., Payne, A.R., Markowitz, T.M.. (2023). New Record of California Coastal Bottlenose Dolphins (Tursiops truncatus) in Offshore Waters. Aquatic Mammals.