Export of special chars to bibtex problem

I have exported my collection to bibtex and now have a problem when compiling the latex document.

One author is named "Wätjen". The ä is exported very strangely. In LaTeX it should be exported as \"a. Some goes for ö and ü. It even looks strange if I open the file in a simple text editor.

Furthermore URLs should be surrounded with the \url{} tag making links clickable in pdf documents.

Are there somewhere some settings for the bibtex module to correct the behaviour?
  • edited August 1, 2010
    Set your export character encoding to anything other than utf-8.
  • This issue is still not solved completely! There is a problem when exporting a Website from Zotero to Bibtex. A url = {...} entry will be generated in the bibtex containing the url. But if the url has special characters like _ or & then bibtex/latex will prompt an error "Missing & inserted"!
    For example code #1:

    @misc{bar,
    title = {bar},
    url = {http://foo_feature_transform&printable=yes},
    howpublished = {{http://foo\_feature\_transform\&printable=yes}}
    },

    Here there is a problem with the url because of the _ and & !
    The problem could be avoided, if the special characters would be translated like it is done in the "howpublished" entry (see code #1)! Using \_ and \& .

    Or one could use the \url or \href tag like in code #2:

    @misc{foo,
    title = {foo},
    url = {\url{http://foo_feature_transform&printable=yes}},
    howpublished = {{http://foo\_feature\_transform\&printable=yes}}
    },


    But the latter method has been disapproved by the community because it is no standard. See http://forums.zotero.org/discussion/4331/bibtex-importexport-problems/

    So the solution would be just to parse the url as it is done for "howpublished"? Am I right? And if so, can somebody correct the code in Zotero, please? This error prevents the exported library to compile.

    I use Zotero 2.1.6 and Firefox 3.6.17.
  • So the solution would be just to parse the url as it is done for "howpublished"? Am I right?
    Sadly, no: character escaping was intentionally omitted from the url field because some bst files use \url or \href & the links are broken when the characters are escaped.
  • Thank you noksagt for the fast response! I see, that it makes sense to omit character escaping in some cases. To resolve this conflict it may be a good idea to provide a setting so that the user can decide whether the special characters should be escaped or not.

    Unfortunately I am bounded to a specific bst file by my publisher. Is there any other way to deal with this problem, apart from escaping the characters in my bib file manually?
  • We've historically avoided offering too many choices on export, particularly ones that are for a specific format. You can customize the Zotero BibTeX translator yourself. If I were in your position, I'd probably just remove all url lines & remap howpublished to url if it was needed.
  • Is there somewhere a tutorial or so how to cutomize the Zotero BibTeX translator?
  • edited May 18, 2011
    Thank you noksagt for the hyperlink!

    I have copied and modified the original BibTeX translator by Simon Kornblith and Richard Karnesky in order to escape special characters in urls. I would like to share my experience in case somebody else encounters this issue:

    The easy steps are:

    1. create a new Translator: http://www.zotero.org/support/dev/translator_development_outside_scaffold#create_or_modify_a_translator_file and save it at the appropriate location (see http://www.zotero.org/support/dev/translator_development_outside_scaffold#translator_files)

    2. Edit the metadata: Change the label to the new filename of the translator without .js: "label":"BibTeX (modified URLs)", in line 4 and set a new translator-ID: "translatorID":"aea153a0-812b-11e0-a9da-0002a5d5c51b", (you can use this service to generate one: http://www.itu.int/ITU-T/asn1/uuid.html)

    3. Change the code at line 1830 and following: // url field is preserved, for use with \href and \url
      // Other fields (DOI?) may need similar treatment
      if(!((field == "url") || (field == "doi") | (field == "file"))) {
      to // url field is preserved, for use with \href and \url
      // Other fields (DOI?) may need similar treatment
      if(!((field == "doi") | (field == "file"))) { //edited! Original was: if(!((field == "url") || (field == "doi") | (field == "file"))) {
      This way "url" is not exempted from the escaping any more.

    4. restart Firefox

    It works so far. I hope this helps anybody. Feel free to criticize or correct me.
  • This looks like exactly the right solution. Hopefully this will help future people in your situation.
Sign In or Register to comment.