This function is called by the provided Rd macro \cite{pkg}{key}:

  • Parses the bibtex file references.bib in the root directory of package package using bibtex::read.bib().

  • Extracts the entry with key key.

  • Converts to Rd with tools::toRd().

cite_bib(package, key)



Package to read the bibtex file from.


Entry of the bibtex file.


(character(1)) Bibentry formated as Rd.


# examplary bibtex file path = system.file("references.bib", package = "mlr3misc") cat(readLines(path), sep = "\n")
#> @article{mlr, #> author = {Bernd Bischl and Michel Lang and Lars Kotthoff and Julia Schiffner and Jakob Richter and Erich Studerus and Giuseppe Casalicchio and Zachary M. Jones}, #> title = {mlr: Machine Learning in R}, #> journal = {Journal of Machine Learning Research}, #> year = {2016}, #> volume = {17}, #> number = {170}, #> pages = {1-5}, #> url = {} #> }
# return value: raw rd cite_bib("mlr3misc", "mlr")
#> [1] "Bischl B, Lang M, Kotthoff L, Schiffner J, Richter J, Studerus E, Casalicchio G, Jones ZM (2016).\n\\dQuote{mlr: Machine Learning in R.}\n\\emph{Journal of Machine Learning Research}, \\bold{17}(170), 1-5.\n\\url{}.\n"