The Inspire HEP tracks publications, conferences, job ads and many other things for high energy physics, and is in general an invaluable resource. One of its most useful features, is the fact that the API for their vast article database is open. With this in hand, it is easy to programmatically extract a bibliography for a high energy physics paper written in LaTeX, suitable for BibTeX.
I have written a small python script called citations.py, which does exactly that. I use it for all my papers, and put it here in the hope that other people will find it useful too.
You can download it as part of a physics paper template, which also includes some other functions -- handy when starting up a new paper, keeping you free of writing the boilerplate.
Clone it with
Call the script with:
will tell you all you need to know. Some key features are:
You need to use the inspireHEP citation keys when writing cite in your paper.
The script will scan through the .aux file produced by pdflatex for keys. This means that you can have several included .tex files, which will all be scanned (as opposed to the inspireHEP bibliography generator on their page, where you upload the tex files).
Should you need to add entries which are not tracked by inspire, you can make an auxiliary bibliography file, default name aux-bib.bib, but can be changed with an argument to the above call. Remember to add both to your manuscript.
Example use cases provided in the accompanying .tex files. Try to simply do make bib, and see what comes out.