Guest User

Untitled

a guest
Jun 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. % knitr -> PDFLaTeX in WinEdt 10.2 with RManager plugin
  2. % http://www.winedt.org/config/modes/RManager.html
  3. documentclass[a4paper,10pt]{article}
  4. usepackage[utf8]{inputenc}
  5. usepackage[T1]{fontenc}
  6. usepackage[margin=2.5cm]{geometry}
  7. usepackage[style=authoryear,backend=biber]{biblatex}
  8. addbibresource{mybibfile.bib}
  9.  
  10. % This is the R code chunk
  11. <<Preamble,include=FALSE>>=
  12. # install the R packages, if they are not already installed.
  13. #install.packages("rcrossref",dependencies=True)
  14. #install.packages("patchDVI",dependencies=True)
  15.  
  16. # load knitr and rcrossref
  17. library(knitr)
  18. library(rcrossref)
  19.  
  20. # nominate the DOIs of interest
  21. mydois <- c('10.1002/andp.19053221004',
  22. '10.1038/171737a0',
  23. '10.1038/227680a0',
  24. '10.1103/PhysRevB.37.785')
  25.  
  26. # extract the metadata for each DOI from Crossref and write the bib file
  27. for(i in 1:4) {
  28. x <- cr_cn(dois=mydois[i], format = "bibtex")
  29. write.table(x,file="mybibfile.bib",append=TRUE,row.names=FALSE,col.names=FALSE,fileEncoding="UTF-8")
  30. }
  31. @
  32. % Print the bibliography
  33. begin{document}
  34. nocite{*}
  35. printbibliography
  36. end{document}
Add Comment
Please, Sign In to add comment