Skip to content

Yun-Hou/mendeleyBibFix

 
 

Repository files navigation

mendeleyBibFix

This is a simple function intended to correct bib-files that are automatically generated by Mendeley Desktop. I have found it to work for bib-files generated with the IEEE citation style, but it should work for other styles as well. It makes the following corrections:

  • changes double braces around titles to single braces
  • provides workaround for constraints on year via issn. If an entry has no year but has an ISSN, then the ISSN entry is renamed to year. This enables labeling a paper as "in press", "submitted", "to appear", or any other custom text for the end of the entry.
  • removes escaping of { and } (will only matter if you checked "Escape LaTeX special characters" in the "Bibtex" Options tab)
  • removes URL for any entry that is not specified as an exception (read the comment block after start of main function to read how to change the exceptions)
  • removes braces around months so that they appear correctly
  • removes all appearances of the "annote" field, which is used by Mendeley for personal annotations to the entry
  • removes all appearances of the "file" field, which lists the location of a local soft copy

It should work correctly for files generated by Mendeley Desktop v1.16.1. Still works as of v1.17.9.

A number of fixes are hard-coded, i.e., it expects to know where the braces are. So this code runs very fast (bib files with hundreds of entries are fixed in a small fraction of a second) but may not be "future-proof"

You will need to compile this code to run it. A compiled version for Windows is included on the release page of Github. If you are going to compile it yourself with gcc, then you will need the -std=c99 option

  • Call syntax (Windows): mendeleyBibFix.exe [OUTPUT_FILENAME] [INPUT_FILENAME]
  • Call syntax (Linux or macOS): ./mendeleyBibFix [OUTPUT_FILENAME] [INPUT_FILENAME]

Both arguments are optional. If there is only one argument, then it is assumed to be the output filename. The default input filename is "library.bib", and the default output filename is "library_fixed.bib". If you're happy with the defaults then you can just double-click on the executable in the directory with "library.bib".

About

Function to fix bib files that are generated by Mendeley.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 99.1%
  • Other 0.9%