Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 6 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
    
Does this not leave duplicates in the combined list? –  Chris Johnson Feb 13 '11 at 23:19
    
yes, that's true –  Herbert Feb 14 '11 at 7:57

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.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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