0

I have a main reference .bib file where all my books and articles should be stored. Now I have another .bib file in my overleaf folders in which some articles are, because I can download it in this format from my sources.

How can I add the information from the single .bib file with an article for example into my main .bib file?

Is there a possibility?

Thanks!

  • Welcome to TeX.SE! – Mensch Jan 23 '24 at 21:16
  • Hey @Mensch, thx for the warm welcome! – otto334 Jan 23 '24 at 21:23
  • 1
    A .bib file is just a text file, so you can just open the other file and copy its contents and then paste it into the main .bib file. If you have the files on a computer you can easily copy from one .bib file to another using JabRef, for example, or you can append files to one another from the command line (Mac/Linux: cat file1.bib >> main.bib Note the >> not > which will overwrite main.bib. – Alan Munn Jan 23 '24 at 21:32
  • Oh okay. Well tbh I really thought it would not work with copy and paste. Thanks! – otto334 Jan 23 '24 at 21:33
  • you can use more than one bib file. Simply add another \addbibresource to your file. – Ulrike Fischer Jan 23 '24 at 21:37
  • I wanted to not have a long list of .bib files in my .tex only one with the whole references in it. Is it in any other form possible to sum them up except copy paste? – otto334 Jan 23 '24 at 21:39
  • 1
    @otto334 I gave you three options. You can easily script the command line version to add multiple files together. Inside Overleaf, not really. – Alan Munn Jan 23 '24 at 21:45
  • @otto334 I would use copy&paste, because if you download the bib file from your sources, you will likely have to fix the errors which are frequently in such automatically generated bib entries, see https://tex.stackexchange.com/questions/386053/software-generated-bibliographic-entries-common-errors-and-other-mistakes-to-ch for a list of the most common errors – samcarter_is_at_topanswers.xyz Jan 23 '24 at 22:12
  • I agree with @samcarter_is_at_topanswers.xyz on this point, I just couldn't find the question to link to :) In that sense, it's probably easiest to use GUI bib file manager like JabRef (or Bibdesk if you have a Mac). – Alan Munn Jan 23 '24 at 22:20

1 Answers1

1

Summarizing all the comments:

  • .bib files are just plain text files, so you can easily just cut and paste the contents of one file into another file using a regular editor (or the Overleaf editor if you're doing all this on Overleaf).

  • It's not a problem to have more than one .bib file be loaded using \addbibresource with biblatex.

  • If you have lots of small files containing individual .bib records, it's likely that these have been downloaded from the web using services like Google Scholar. These types of automatically generated .bib entries are very likely full of errors, and you should check them carefully before actually using them for your work. See Software-generated bibliographic entries: common errors and other mistakes to check before use

  • You can, however, easily append files to your master file using command line tools. For Mac/Linux, for example, you could simply use cat file1.bib >> main.bib. Note the use of two >> not one > which will append to main.bib rather than overwrite it. This kind of command could easily be scripted.

  • For easier management of your bib file, many people find it better to use a GUI program like Jabref (cross platform) or BibDesk (Mac only). This will allow you to easily correct missing/incorrect information in your file without having to worry about the syntax of the .bib file itself.

Alan Munn
  • 218,180