extract_bib is a simple R script to create minimal a bibtex library file for an article. Some journals require tex and bib files with submissions. However, I have only one master bib file. That file currently contains 3543 references. Rather than send all of that to the journal to help typeset my manuscript, I only want to send a bib file with the references included in my article. This script does that.
- Read a
texfile - Extract all of the citations
- Read a master
bibfile - Match the citations from the
texfile to the master librarybibfile - Output a minimal library for submission
- I use
natbiband so the citations I search for in thetexfile are onlycitet{}andcitep{}. Expand this to other citation functions. - I remove some crud from the library put there by my citation manager (Mendeley), including annotations and file locations, as well as abstracts. If there are other unneeded fields, they can be removed from the minimal library output.
- Expand to work with multiple input libraries or multiple input
texfiles?