Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % knitr -> PDFLaTeX in WinEdt 10.2 with RManager plugin
- % http://www.winedt.org/config/modes/RManager.html
- documentclass[a4paper,10pt]{article}
- usepackage[utf8]{inputenc}
- usepackage[T1]{fontenc}
- usepackage[margin=2.5cm]{geometry}
- usepackage[style=authoryear,backend=biber]{biblatex}
- addbibresource{mybibfile.bib}
- % This is the R code chunk
- <<Preamble,include=FALSE>>=
- # install the R packages, if they are not already installed.
- #install.packages("rcrossref",dependencies=True)
- #install.packages("patchDVI",dependencies=True)
- # load knitr and rcrossref
- library(knitr)
- library(rcrossref)
- # nominate the DOIs of interest
- mydois <- c('10.1002/andp.19053221004',
- '10.1038/171737a0',
- '10.1038/227680a0',
- '10.1103/PhysRevB.37.785')
- # extract the metadata for each DOI from Crossref and write the bib file
- for(i in 1:4) {
- x <- cr_cn(dois=mydois[i], format = "bibtex")
- write.table(x,file="mybibfile.bib",append=TRUE,row.names=FALSE,col.names=FALSE,fileEncoding="UTF-8")
- }
- @
- % Print the bibliography
- begin{document}
- nocite{*}
- printbibliography
- end{document}
Add Comment
Please, Sign In to add comment