Mendeley, bibtex and the web page citation fiasco
Here is a work-around for the insufficiently-functioning Mendeley bibtex export for web page/URL citations. The issue is that a) the URL is exported as ‘url =’ and not ‘howpublished =’ and b) there is no ‘last accessed’ (aka ‘last viewed’ or ‘last checked’) field…
This little workflow and command line might help someone.
- Create a separate collection for your webpage citations
- Move all webpage citations into the new collection and delete them from you default bibliography collection
- Mark all items of the webpage collection and go to File->Export…
- Choose webpage_temp.bib as your export target in your LaTeX tree
- Run the following command below
- Edit the new file webpages.bib and check that all the “Last Accessed” descriptors are OK (Mendeley does not export the “Last Accessed” field into bibtex; therefore a fixed date is used in there…)
- Use webpage.bib in your LaTeX file (example of how it looks below)
The command line is:
cat webpages_temp.bib | \
sed "s/url =/howpublished =/g" | \
sed "s/{http/{\\\url{http/g" | \
sed "s/howpublished.*}/& [Online. Last accessed: 2011-11-06]}/g" > webpages.bib
Here is an example of how it looks in the document (alpha style):
I use this little script in the make file for the LaTeX compilation. Works for me : )
The entry before the script (as it came from Mendeley):
@misc{Ishida2011,
author = {Ishida, Richard},
booktitle = {W3C},
keywords = {cultural name differences,name ambiguity,name structure},
title = {{Personal names around the world}},
url = {http://www.w3.org/International/questions/qa-personal-names},
year = {2011}
}
The same entry after the script:
@misc{Ishida2011,
author = {Ishida, Richard},
booktitle = {W3C},
keywords = {cultural name differences,name ambiguity,name structure},
title = {{Personal names around the world}},
howpublished = {\url{http://www.w3.org/International/questions/qa-personal-names} [Online. Last accessed: 2011-11-06]},
year = {2011}
}



