202

I would like to use multiple .bib files for my article, such as file1.bib, file2.bib.

However, I would like my references not to be separated (such as "Primary sources", "Secondary sources", etc.). These bibliographies just need to be merged into one.

One way to do this is to copy-paste these .bib files into one .bib file, and this would solve the problem. However, I would like to keep it split into several .bib files, by topic (file1.bib contains articles on topic1, file2.bib contains articles on topic2, and so on).

I tried to do

\bibliographystyle{alpha}

\bibliography{file1}
\bibliography{file2}

but this just gives me the same bibliography twice!

0

2 Answers 2

296

The correct way to load multiple bib files is to use

\bibliography{file1,file2}

Note the lack of space between the comma and the files!

14
  • 19
    What if there is a conflict in bibtexkeys of the two files?
    – Orion
    Jun 26, 2013 at 18:52
  • 28
    Only one of them will be include (the first one) and bibtex will report a Repeated Entry message and will skip the second one.
    – Guido
    Jun 26, 2013 at 20:59
  • 10
    @Guido, may I ask why the space between the comma and the second filename is important?
    – Leo Fang
    May 6, 2014 at 4:15
  • 11
    @LeoFang otherwise bibtex will report a white space in arguments and will ignore the bibtex files after the space.
    – Guido
    May 6, 2014 at 11:39
  • 8
    The lacking space does the trick, thank you
    – hoeni
    Dec 14, 2014 at 15:33
46

If you use the biblatex package and need to load multiple bib files, each bib file needs to be loaded separately via an \addbibresource instruction:

\addbibresource{file1.bib}
\addbibresource{file2.bib}

For more information, see section 3.6.1, "Resources", of the reference manual of the biblatex package.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .