Overleaf+Mendeley


Fix bib File When Importing References

from Mendeley into Overleaf

Last updated: May 19, 2020


A couple of weeks ago, I signed up to become an IEEE member. One of the benefits of being a member is that you have Overleaf Pro account subscription. Even better, Overleaf allows you to link to Mendeley account and generates the bib file out of your references automatically (You can see the tutorial here. The bib file can be also generated directly in Mendeley, however, the bib file generated in Mendeley contains way more redundant fields comparing to the one generated through Overleaf.). This is really convenient as you just need to create a (private) group in Mendeley for the references of your preparing paper, then use Overleaf to export the bib file. However, the auto-generated bib file often contains unexpected fields such as: url, issn, isbn, keywords, etc., which could mess up the reference section of your paper. Therefore, I wrote a simple python program to help fix the problem. The download link is provided at the beginning of this article.

To run the program, you just need to type: $python Mendeley.py <path-to-bib-file> It doesn't matter if your bib file is generated by Overleaf or Mendeley, the program will help you:

  • Remove redundant fields
  • Fix the capitalization in the title (You need to install titlecase before using the program: $pip install titlecase)
Note that the program will create a copy of your original file under the name <your-bib-file>.bib.bak before directly modifying your bib file. Plus, you can easily add the to-delete-fields to the program by the syntax: <to-delete-field>.*\n

Graph
Figure 1 - Adding to-delete-field with Regular Expression in the program.
Below is an example of a reference in the bib file before and after using the program:

Graph
Figure 2 - A reference before and after removing the redundant field with the program.

If you have any suggestions on the program, just drop a comment below.