The acronym package comes with built-in functionality to recognize the fields from your reference manager, so you can recognize your acronyms in the text more precisely. Currently, the following managers are supported:

  • Zotero
  • Endnote
  • Mendeley

The way it works:

library(acronym)

find_acronyms(path = system.file("zotero.docx", package = "acronym"), ref_manager = "zotero")
#> ✔ List of acronyms copied to clipboard. You can now just paste it into your Word document.
#>  [1] "CCC"      "CP"       "CP1/time" "CP2-hyp"  "CP3-hyp"  "CPexp"   
#>  [7] "CPlinear" "HR"       "LOOCV"    "Pmax"     "POpeak"   "TTE"     
#> [13] "V̇O2max"   "W’"

Delimiter

You can set delimiters to limit the search between two headings only. The default values for this are Introduction and References. You can of course modify these headings, and if you wish to ignore them you can simply set demileter = NULL.

find_acronyms(
  path = system.file("zotero.docx", package = "acronym"), 
  delimiter = c("Introduction", "References"),
  ref_manager = "zotero"
)
#> ✔ List of acronyms copied to clipboard. You can now just paste it into your Word document.
#>  [1] "CCC"      "CP"       "CP1/time" "CP2-hyp"  "CP3-hyp"  "CPexp"   
#>  [7] "CPlinear" "HR"       "LOOCV"    "Pmax"     "POpeak"   "TTE"     
#> [13] "V̇O2max"   "W’"

Without delimiters

find_acronyms(
  path = system.file("zotero.docx", package = "acronym"), 
  delimiter = NULL,
  ref_manager = "zotero"
)
#> ✔ List of acronyms copied to clipboard. You can now just paste it into your Word document.
#>  [1] "CCC"      "CP"       "CP1/time" "CP2-hyp"  "CP3-hyp"  "CPexp"   
#>  [7] "CPlinear" "HR"       "LOOCV"    "Pmax"     "POpeak"   "SWC"     
#> [13] "TTE"      "V̇O2max"   "W’"

Custom regex

If you would like to try another regex to identify the references fields in the text you can simply do:

find_acronyms(
  path = system.file("zotero.docx", package = "acronym"), 
  delimiter = NULL,
  ref_manager = "custom",
  custom_regex = "ADDIN ZOTERO.*?json"
)
#> ✔ List of acronyms copied to clipboard. You can now just paste it into your Word document.
#>  [1] "CCC"               "CP"                "CP1/time"         
#>  [4] "CP2-hyp"           "CP3-hyp"           "CP3-hyp(1,2,3,4,5"
#>  [7] "CPexp"             "CPlinear"          "HR"               
#> [10] "LOOCV"             "Pmax"              "POpeak"           
#> [13] "SWC"               "TTE"               "V̇O2max"           
#> [16] "W’"

Alphabetical order or order of appearance in text

By default, the function is going to retrieve the list in alphabetical order. If you need to have it in order of appearance, just set sort = FALSE.

find_acronyms(
  path = system.file("zotero.docx", package = "acronym"), 
  ref_manager = "zotero",
  sort = FALSE
)
#> ✔ List of acronyms copied to clipboard. You can now just paste it into your Word document.
#>  [1] "CP"       "TTE"      "CP2-hyp"  "CPexp"    "CP3-hyp"  "CPlinear"
#>  [7] "CP1/time" "W’"       "V̇O2max"   "POpeak"   "HR"       "LOOCV"   
#> [13] "CCC"      "Pmax"