* Bibtex Entries from Arxiv.org
:PROPERTIES:
:categories: emacs,bibtex
:date: 2015/03/09 15:14:52
:updated: 2015/03/09 15:14:52
:END:
http://arxiv.org is an open-source physics preprint server where copies of scientific manuscripts can be found. For example, http://arxiv.org/abs/0801.1144 is a paper I wrote, and you can find the PDF for that paper here: http://arxiv.org/pdf/0801.1144v1. Each entry at Arxiv has an arxiv number, and for this paper the number is "0801.1144". In this post, we explore some capabilities of the [[https://github.com/jkitchin/org-ref/blob/master/arxiv.el][arxiv.el]] library which is part of org-ref (https://github.com/jkitchin/org-ref).
To use this library, get the org-ref distribution, make sure it is on your path, and then require the library:
#+BEGIN_SRC emacs-lisp
(require 'arxiv)
#+END_SRC
First, there is a new org-link: arxiv:0801.1144. This is a clickable link that simply opens arxiv.org at the URL for an arxiv number, and exports as a link to that entry in arxiv.
On the right hand side of the arxiv page, there is a link under References & Citations that takes you to a page where you can get a bibtex entry. The link for this entry is http://adsabs.harvard.edu/cgi-bin/bib_query?arXiv:0801.1144. On that page, there is a link to a bibtex entry (http://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2008PhRvB..77g5437K&data_type=BIBTEX&db_key=PHY&nocookieset=1). We can construct this link pretty easily, we just need the bibcode for that entry. arxiv.el provides a function for that.
#+BEGIN_SRC emacs-lisp
(arxiv-get-bibliographic-code "0801.1144")
#+END_SRC
#+RESULTS:
: 2008PhRvB..77g5437K
Next, once we have a url, we can get the text of the bibtex entry.
#+BEGIN_SRC emacs-lisp
(arxiv-get-bibtex-entry "2008PhRvB..77g5437K")
#+END_SRC
#+RESULTS:
#+begin_example
@ARTICLE{2008PhRvB..77g5437K,
author = {{Kitchin}, J.~R. and {Reuter}, K. and {Scheffler}, M.},
title = "{Alloy surface segregation in reactive environments: First-principles atomistic thermodynamics study of Ag$_{3}$Pd(111) in oxygen atmospheres}",
journal = {\prb},
archivePrefix = "arXiv",
eprint = {0801.1144},
primaryClass = "cond-mat.mtrl-sci",
keywords = {Ab initio calculations of adsorbate structure and reactions, Density functional theory local density approximation gradient and other corrections, Oxidation},
year = 2008,
month = feb,
volume = 77,
number = 7,
eid = {075437},
pages = {075437},
doi = {10.1103/PhysRevB.77.075437},
adsurl = {http://adsabs.harvard.edu/abs/2008PhRvB..77g5437K},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
#+end_example
Finally, arxiv.el wraps those to functions together into an interactive function =arxiv-add-bibtex-entry= which prompts you for an arxiv number, and then a bibtex file, and then adds the text above to your bibtex file. You can then clean the entry as you see fit. It is also possible to get the pdf for an arxiv entry via =arxiv-get-pdf=. This is an interactive function that will prompt you for an arxiv number and a pdf file name, and it will then get the pdf for you and open it. I have not integrated this with the bibtex entry function yet, but one would ideally clean the bibtex entry to get a uniform key, and then get the pdf and name it according to the key like we do in org-ref.
#+BEGIN_SRC emacs-lisp
(arxiv-get-pdf "0801.1144" "0801.1144.pdf")
#+END_SRC
#+RESULTS:
If you use [[https://github.com/jkitchin/jmax/blob/master/words.el][words.el]] you will find a new function =words-arxiv= which allows you to search the selected text or word at point on arxiv.org.
I do not use arxiv.org a lot, so this is not super well tested on many articles in arxiv.org, but it has worked on the few examples I have tested so far.