Bug: BibTeX export: don't escape LaTeX special chars in url field

As title says.

The BibTeX translator currently escapes LaTeX special chars (#$%&~_^\) in all fields. This should not be done for the 'url' field.

As an example, for a given url http://a.b/c_d
Zotero exports

url = { http://a.b/c\_d }

whereas the expected output is

url = { http://a.b/c_d }


Tested using the 2007-11-07 version of the BibTex translator.
  • I don't know if this is fixed, but you should test it with the 2008-03-26 version, which is only available via Reset Translators and Styles in the Advanced pane of the Zotero prefs.
  • edited April 7, 2009
    I do not understand what Dan S. meant -- the button just deleted some files I had to copy them from my backup. And I agree with ngirard, there is sth wrong with the TeX export.

    A citation title says
    a) "blabla blah BaTiO3 blaaaaah"
    b) "blabla blah BaTiO$_3$ blaaaaah"

    and the exports are
    a) {BaTiO3}
    b) {BaTiO\$\_3\$}

    none is correct to include into a tex file without previous manual correction to {BaTiO$_3$}. What I miss is a TeX encoding amongst the big bunch of other encodings (Arab, Chinese, etc). I do not know for Arab or Chinese, but for European languages one can export any character to TeX encoding.
  • edited April 7, 2009
    The specific issue first reported in this thread (escaping URLs) was fixed sometime ago (you'll note this thread is almost a year old).
    I do not understand what Dan S. meant -- the button just deleted some files I had to copy them from my backup.
    What files did it delete? Are you sure you pressed the right button? In any case, I don't think that a translator update would give you what you want....
    and the exports are
    a) {BaTiO3}
    b) {BaTiO\$\_3\$}
    These are both by design. In case (a), there is no way for Zotero to know that you intend to subscript the 3. Encasing in brackets preserves the case. Re. (b), Zotero is not a BibTeX-specific manager & so none of the fields use '$' to enclose TeX-encoded entities. It assumes the you mean a literal dollar sign, which must be escaped.

    In this specific example, you can use UTF-8 to get what you want: BaTiO₃ will be exported as "{BaTiO₃}" if you are using UTF-8 export or as "{BaTiO$_{3}$}" if you are using a different character set.
    What I miss is a TeX encoding amongst the big bunch of other encodings (Arab, Chinese, etc).
    These work if you can use a UTF-8 BibTeX file
    I do not know for Arab or Chinese, but for European languages one can export any character to TeX encoding.
    There are very few commonly-used entities for the non-western characters. Zotero does have extensive mappings between UTF-8 and LaTeX entities if you require an ISO 8859 bibtex file.
  • I do not understand what Dan S. meant -- the button just deleted some files I had to copy them from my backup.
    I posted that last April when we weren't sending updates to the BibTeX translator to clients or updating it on upgrade due to instability with large database transactions in Firefox 2, so the only way to upgrade to the bundled version of the translator was to use Reset Translators and Styles. This is no longer necessary.

    Also, the button warns you that new and modified translators and styles will be lost.
  • edited August 17, 2009
    Thanks noksagt, thanks Dan, too, for your replies.

    I see and I can reproduce a valid export now. I have tried that for some UTF-8 characters. Only that, it was a pain to find some characters. Has been an option considered to export/show a note related to a citation entry in UTF-8 encoding? I write "BaTiO₃ and BaTiO3" and when copying to the title the sub's tag is lost.

    In other words, I could not find a straightforward way how to paste an UTF-8 character into the entry. Some characters are exported when saving an "encoding text" in OpenOffice, some can be found and copied from a webpage. Is there a way how to write in UTF-8 directly from keyboard?

    Thanks for any opinion, Z
  • edited September 8, 2009
    E.g. I'm not able to write in UTF-8 the following correctly:

    Far-infrared soft-mode behavior in PbSc1/2Ta1/2O₃ thin films

    Should look similar to ad have an UTF-8 character for subscript(1/2):
    Far-infrared soft-mode behavior in PbSc1/2Ta1/2O₃ thin films.

    This problem with wider description and redirected: http://forums.zotero.org/discussion/8597/proper-encoding-format-in-details-and-correct-export-or-how-to-write-everything-in-utf/
Sign In or Register to comment.