GithubHelp home page GithubHelp logo

franceswong / mendeleybibfix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamjgnoel/mendeleybibfix

0.0 1.0 0.0 20 KB

Function to fix bib files that are generated by Mendeley.

Home Page: http://ramblingacademic.com/2016/06/fixing-bibtex-files-mendeley/

License: BSD 3-Clause "New" or "Revised" License

Batchfile 0.44% Shell 0.46% C 99.10%

mendeleybibfix's Introduction

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.18.

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 (e.g., command like โ€œgcc -o mendeleyBibFix mendeleyBibFix.c -std=c99โ€).

The full call syntax is as follows:

  • 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" (which is the default name of the bib-file that Mendeley generates), and the default output filename is "library_fixed.bib".

You can run the script in one of two ways:

  1. Open a command window and navigate to the folder containing both the bib-file and the executable (e.g., cd "C:\Users\Documents..."). Then enter (for Windows) "mendeleyBibFix.exe OUTPUT_FILENAME INPUT_FILENAME". You can omit the filename arguments if your bib-file is called library.bib and you want the script to create library_fixed.bib.
  2. If you're happy with the default arguments, and if the executable is placed in the same directory as the bib-file "library.bib", then you can just double-click on the executable

mendeleybibfix's People

Contributors

adamjgnoel avatar aldridgecaleb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.