Zotero is a great reference manager, especially if you’re using Firefox. Its BibTeX export is invaluable for LaTeX / LyX users. However, it has a couple of sticking points whose solutions are not well documented. These issues can be especially annoying for researchers working in exact sciences (math, physics, etc.)
Problem 1: Article info contains special Unicode characters (such as é). As BibTeX doesn’t support Unicode, LaTeX compilation fails.
Solution:
- Zotero Preferences -> Export -> check Display character encoding option on export
- Whenever you export your database, pick a non-Unicode character encoding such as ISO-8859-1
Zotero will now convert the Unicode characters to their native LaTeX equivalents (for example, é will be converted into \’{e}).
Note: You could also solve this on the LaTeX side by using Biblatex and biber. However, I wasn’t able to make them work under LyX.
Problem 2:Article info contains Latex constructs (e.g. $O_{3}$). Zotero escapes these and so they appear verbatim in the reference (e.g. $O_{3}$ instead of O₃)
Solution:
- Locate your Zotero data directory and open translators\BibTeX.js with your favorite text editor
- Change the following:
var alwaysMap = { "|":"{\\textbar}", "<":"{\\textless}", ">":"{\\textgreater}", "~":"{\\textasciitilde}", "^":"{\\textasciicircum}", "\\":"{\\textbackslash}" };to the following:
var alwaysMap = { "|":"{\\textbar}", "<":"{\\textless}", ">":"{\\textgreater}" //, // "~":"{\\textasciitilde}", // "^":"{\\textasciicircum}" // "\\":"{\\textbackslash}" }; - Change the following:
value = value.replace(/[|\<\>\~\^\\]/g, mapEscape).replace(/([\#\$\%\&\_])/g, "\\$1");
to the following:
value = value.replace(/[|\<\>]/g, mapEscape).replace(/([\#\%\&])/g, "\\$1");
- Save the file.
Escaping of ~, ^, \,$,_ is now disabled, preserving your LaTeX constructs.
References and further reading
http://forums.zotero.org/discussion/5324/bibtex-and-greek-characters/
http://groups.google.com/forum/?fromgroups#!topic/zotero-dev/U9fGc1f3TO8
October 16, 2012 at 2:33 PM |
Thanks for the tips for getting Latex-code instead of unicode symbols in the export.