Bibliography from Mendeley to Overleaf
Published: 2024-05-08 11:10:13

A cheeky (free) workaround that lets you automatically synchronize references from Mendeley to Overleaf.


**TL;DR:**

1. Setup Mendeley to automatically sync .bib file onto your local drive.
2. Make sure that the file is synced to Google Drive (or is accessible somewhere else on the Internet).
3. Get the URL for the raw content of the file.
4. Import to Overleaf _From External URL_

---

Mendeley serves me well as an environment for collecting, organizing, reading, and highlighting PDFs. However, it can also automatically generate `.bib` files that can then be referenced in LaTeX documents.

Overleaf is a cloud-based LaTex editor. It has a free and premium version. Most of the time, you wouldn't even notice that you're using the free version. So far, I've bumped into just very few features that are part of the premium, and these are nice-to-have rather than must-have.

One of these features is a built-in [Mendeley integration](https://www.overleaf.com/learn/how-to/How_to_link_your_Overleaf_account_to_Mendeley_and_Zotero). A neat feature, but I'd have a hard time justifying the ~$17/month just for that. Fortunately, there is a fairly simple workaround:

### 1️⃣ Setup BibTeX syncing in Mendeley
Open up your Mendeley desktop app, go to Tools > Options > BibTex and enable BibText Syncing.

![BibTeX syncing settings in Mendeley App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rv8rh0cip9f45m8y203b.png)

BibTeX syncing settings in Mendeley AppI'm using the "per group" option so that each of my folders will have its own `.bib` file.
You can find more info [here](https://blog.mendeley.com/2011/10/25/howto-use-mendeley-to-create-citations-using-latex-and-bibtex/).

### 2️⃣ Use the cloud(s)
Make sure that the `.bib` files that Mendeley generates are shared in some cloud storage. I'm using Google Drive in this example, but there are ways to make this work for the different cloud storage solutions.

💡If you're on Linux, you can try InSync.

### 3️⃣ Get the URL of the raw file
In Google Drive, the standard sharing link won't give you the raw content of the file. Here's the URL you `https://docs.google.com/uc?export=download&id=[yourFileID]`

You can get your FileId from the sharing link that Google generated for you (it's the long, messy part of the URL).

### 4️⃣ Import to Overleaf - From External URL
This is the trick that finally connects the dots. In Overleaf, click Upload and select the From External URL option, pasting in the URL from the previous step.


![From External URL modal in Overleaf](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzhjaktsjd0p56graoo5.png)


---

And that's it. Now you can use [BibTeX like you normally would](https://www.overleaf.com/blog/532-creating-and-managing-bibliographies-with-bibtex-on-overleaf). This time, Mendeley will sync your references to the local file, InSync will get it to the cloud, and Overleaf will pull it from the URL 👏

⚠️ I haven't yet figured out how often (if ever) Overleaf pulls the file's updated content, but you have a button to check for updates, making it easy to force Overleaf to pull the newest version.