6

Can one automate the construction of a BibTeX bibliography which includes all the bibliographic entries from multiple separate LaTeX documents? The documents I have in mind have citations in common, which must only appear once in the combined list.

I could potentially paste the text from all the documents into one file and use the bibliography from that. This would involve a fair bit of editing though, since the documents all use various incompatible documents classes and macros.

7

Is the goal just to create a .bib file with all the unique references, or to create a single printed bibliography to tack onto the back of all these different documents? If the former (I'm making this assumption because you say that the source documents have "various incompatible classes", etc), then Bibtool and its "extraction" option is your friend. I haven't tested this, but assuming bibtool is installed, if you run latex/bibtex on each separate .tex file, so that the .aux files are generated, then I believe something like

bibtool -x file1.aux file2.aux file3.aux -o consolidated.bib

will move you toward what you want. See p10 and pp27-28 of the bibtool manual. Even if the goal is a single printed bibliography, however, it will be straightforward to produce one once you've created the consolidated .bib file.

1

You can create a new document and then copy the contents of the *.bbl files of the other documents into this new document. Then delete all \begin{thebibliography} and \end{thebibliography}, except of the very first and last one.

  • Does this not leave duplicates in the combined list? – Chris Johnson Feb 13 '11 at 23:19
  • yes, that's true – user2478 Feb 14 '11 at 7:57
0

I think it might be sufficient to move all the \bibcites from the auxfiles into one auxfile. (Along with an initial \bibstyle command. Best take one from your existing documents' auxfile.) Running bibtex on that file should give you a bbl which contains the formatted bibliography. (But it's late here, I might be wrong.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.