Thursday, December 31, 2009

Solution for using UTF8 format bibtex from Zotero with Latex

When exporting the bibtex file from Zotero, the file is in utf-8 encoding. So there is a problem when I directly used it in latex. I dug for quite a while online but didn't find any ideal solution for this. The problem is when converting utf-8 to iso-8859-1, there will be some unidentified characters, leading to abnormal display in generated pdf file.
Finally, I got this solution.

1. Locate the Zotero data directory

By default, Zotero data is stored within your Firefox profile in these OS-dependent directories.

On a Mac:
/Users//Library/Application Support/Firefox/Profiles//zotero

On Windows 2000/XP:
C:\Documents and Settings\\Application Data\Mozilla\Firefox\Profiles\\zotero

On Windows Vista:
C:\Users\\AppData\Roaming\Mozilla\Firefox\Profiles\\zotero

On most Linux distributions:
~/.mozilla/firefox//zotero

2. Locate translator file BibTex.js in the $zoterodir/translators directory

3. Open that file and change the following

Zotero.addOption("exportCharset", "UTF-8");

into

Zotero.addOption("exportCharset", "ISO-8859-1");

Now you can export the bib file again from zotero, and the file is in ascll format ready for use.

No comments:

Post a Comment