quantenbrot

Fixing Mendeley's BibTeX export

I’m writing my bachelor’s thesis with LaTeX and Mendeley as a reference manager. Ever since I switched from BibTeX to BibLaTeX, I’ve been getting warnings about the month formatting in my .bib file. Long story short, Mendeley saves month = {jan}, but BibLaTeX wants month = jan. So that’s one thing to fix. Another thing is just a cosmetic thing, but the Mendeley export starts with a message about the .bib file being auto-generated and such, so yeah.
Anyway, fixing that is easy enough using good ol’ sed. There’s probably better ways to do this, but this one works and it’s simple to understand:

#! /usr/bin/sed -f

s/{jan}/jan/g
s/{feb}/feb/g
s/{mar}/mar/g
s/{apr}/apr/g
s/{may}/may/g
s/{jun}/jun/g
s/{jul}/jul/g
s/{aug}/aug/g
s/{sep}/sep/g
s/{oct}/oct/g
s/{nov}/nov/g
s/{dec}/dec/g

1,5d

Saving that as cleanbib, chmod +x to make it executable, and that’s it. Just pump your .bib file through it, save and done.