Finds acronyms in a Word document and retrieves a unique list of acronyms

find_acronyms(
  path,
  delimiter = c("Introduction", "References"),
  ref_manager = c("zotero", "endnote", "mendeley", "custom"),
  custom_regex = NULL,
  sort = TRUE
)

Arguments

path

The path of your Word document. Passed onto officer::read_docx().

delimiter

An atomic vector of size two indicating whether to set boundaries for looking for acronyms. The default c("Introduction", "References") will look for acronyms only between these headings in the text. Set it to NULL for not applying any boundary.

ref_manager

Specify the reference manager used in the text. Can be one of "zotero", "endnote", "mendeley", or "custom". Set it to NULL to ignore this argument.

custom_regex

Apply your own custom regex to ignore words. You must set ref_manager = "custom" for this to work.

sort

Set to TRUE for sorting it in alphabetical order. If FALSE, it will return the acronyms in order of appearance in the text.

Value

a list of acronyms

Examples

## manuscript using zotero 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’"