Alberto Álvarez
11 Apr 2020

Exporting references using aux2bib

A useful command when working with a LaTex document is aux2bib. Sometimes, we use a global reference file, where we have all of our references available, and from that file we just select the ones that would be included in our LaTex document. The downside is that this global bibtex file could have hundreds or thousands of references that are not included in the final .pdf file produced by LaTex. To generate a .bib file that includes only the references in the document, we can call aux2bib, using a the .aux file that results from the LaTex compilation process. To have access to aux2bib, we have to install the bib2html package. We can do this in Ubuntu by typing the following command in the terminal:

$ sudo apt install bibtex2html

Once installed, we just go to the folder where the .aux file is located and we call

$ aux2bib myauxfile.aux > references.bib

where myauxfile.aux is your .aux file and references.bib is the resulting bibtex file with the references used in your LaTex document. You could use any name for this file, references.bib in this case is just an example.

Tags: latex
alberto.am by Alberto Álvarez is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.