Look up entries in bibliography and insert citation in Markdown format if exactly one match is returned.
md_cite(x, in_paren = TRUE,
bib_file = getOption("citr.bibliography_path"), cache = TRUE,
use_betterbiblatex = getOption("citr.use_betterbiblatex"),
encoding = getOption("citr.encoding"))
Character. Search terms used to filter bibliography (by author, year, title, and journal fields); Regex is supported.
Logical. Determines if citation is in parentheses.
Character. Path to Bib(La)TeX-file. See details.
Logical. If cache = TRUE
cached bibliography is used, if available. If
cache = FALSE
bibliography is re-imported on every function call.
Logical. If use_betterbiblatex = TRUE
references are imported from Zotero/Juris-M.
Character. Encoding of the Bib(La)TeX-file.
If the bibliography contains exactly one match the formatted citation is returned, otherwise
returns NULL
. md_cite
returns an in-text citation ("@foo2016"
), md_cite
returns an in-parenthesis citation ("[@foo2016]"
).
The path to the BibTeX-file can be set in the global options and is set to
references.bib
when the package is loaded. Once the path is changed in the
RStudio addin, the global option is updated. If use_betterbiblatex = TRUE
references
are imported from Zotero/Juris-M rather than from the Bib(La)TeX-file. The Bib(La)TeX-file
is then updated to include the inserted reference.
# NOT RUN {
md_cite("foo 2016", bib_file = "references.bib")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab