Multiple Overleaf projects with a single .bib file

I recently discovered that one of my biggest dreams – being able to link all my online LateX projects to a single .bib file (but without using Mendeley) – is possible!

Previously I had “solved” this problem with ShareLateX projects, by writing a script that copies my main .bib file to several project folders every hour. However, this requires Dropbox sync for ShareLateX, which is a premium feature for new users. Not to mention, it’s not ideal to do it every hour, and to have to update the script when you want the .bib file to be copied with an additional project.

Now a much simpler solution is possible with Overleaf. It’s probably been there for a long time, but I only realized this now. When you add a new file to an Overleaf project, there is an option “Upload from URL”. I thought this option would do just that – get the file from the URL and upload it. But what it actually does, is remotely link to the file. That’s the solution right there! (Thanks to Overleaf’s Dr. LianTze Lim for pointing this out!)

Here are the steps to get this to work:

1. Put your .bib file in Dropbox, set the sharing settings so that it’s accessible by anyone with the link. Copy the link

2. In your Overleaf project, Go to “Files”, then “Upload from URL” and paste the link here. With Dropbox, this link will end in “dl=0”. Change this to “dl=1”

If this works correctly, you should now see your .bib file in your project, but with a “linked” icon next to it

3. Proceed as you usually would with a bibliography file

If you are collaborating with others, the best way is probably to have two .bib files – the linked one (not writeable from Overleaf) and another one that is local to the project, for any new references. This way at the end of the project, you could move all the new references to your main .bib file.

I also tried to do this in ShareLatex, but couldn’t find this type of option. Although ShareLateX has free Dropbox sync because I’m an early user, this feature of Overleaf could have convinced me to switch (even if losing the sync). But Overleaf and ShareLateX are merging, so I’m hoping I might get to enjoy the benefits of both.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: