I have created an article with a bibliography (natbib + BibDesk, using commands \citet and \citep). Since I have to submit the .tex file, and my master file.bib is very big, I need a .bib file containing just the items cited in my paper. Is there an easy way to do this on iMac?
2 Answers
Yes, there is an easy way to do this.
When you run LaTeX on your .tex file, it generates an .aux file in the same folder.
In BibDesk and Better BibTeX for Zotero and JabRef (and perhaps in other reference management software as well), there is a command that selects or exports all the bibliography items that are cited in an .aux file.
In BibDesk, the relevant command is the menu item Database → Select Publications from .aux File (or simply drag the .aux file onto the main table of publications). In Better BibTeX for Zotero, the command is Tools → Scan BibTeX AUX file for references. In JabRef, the command is Tools → New subdatabase based on AUX file.
Then export the selected items to a new .bib file.
If you prefer to use the command line, Gerd Neugebauer's multipurpose BibTool could be a good choice, as it provides a simple command-line option for the task: bibtool -x document.aux -o document.bib.
- 410
-
1By the way, the .aux file command is useful for other purposes: I also use the command in BibDesk to help create a static group for each of the works I've written containing the bibliographic items that the paper cites, so that when I select a bibliographic item in the main table of BibDesk I can see all of my works that cite it highlighted in the list of static groups in the sidebar. – Big Mac Apr 13 '23 at 02:07
There are other approaches as well, including a short Python script I have successfully used in the past.
- 6,690
- 5
- 26
- 47
bashor another programme to extract maybe, hava a read ofcheckcites– JamesT Apr 07 '23 at 11:24