Bibtex keys (\cite) are different than the exported in the .bib file...

Hi,

I have checked all discussions related to bibtex export bibtex keys and German umlauts but I couldn't find any help...

I discovered the following problem:

exporting the library to bibtex gives me the following entry (example):


@article{baecker_zukunftsfahigkeit:_2011,
title = {Zukunftsfähigkeit: 16 Thesen zur nächsten Gesellschaft},
volume = {9},
hyphenation = {german},
journal = {Revue für Postheroisches Management},
author = {Baecker, Dirk},
year = {2011},
pages = {8--9},
}

which is not very elegant but fine...

however, if I choose default output format "BiBTeX (\cite)" the output is:

\cite{baecker_zukunftsfaehigkeit:_2011}

although it should be:
\cite{baecker_zukunftsfahigkeit:_2011}

somehow the bibtex key that is created exporting the library using bibtex (utf-8) is different from the bibtex key using (\cite) in the default output (cmd+shift+c)...

My knowledge how to manipulate the bibtex translator .js (if it is a translator problem) is very limited... can anyone please help me?

cheers,
  • No translator named "BiBTeX (\cite)" ships with Zotero. You would be best off contacting whoever made this translator, either by posting in the relevant forum thread or by emailing that person directly.
  • I think he's referring to the BibTeX CSL style, which I don't think has the capability of replacing special characters, but I could be wrong.
  • the translator is called:
    BibTeX-cite-keys-only.js

    BibTeX (\cite) is only what shows in the preference pane.

    I use this for drag and drop bibtex cite keys (like: \cite{key1}) by using the standard shortcut cmd+shift+c... I can't remember where I got it from. but: I figured it out. I found the table at the end that was causing the problem... and I replaced "ae", "oe", "ue" by "a", "o", "u" and its all fine.

    But I still don't understand the problem really, because the bibtex.js translator contains the very same table at the end with ae ue oe so it should replace umlauts by these right? or do I have to activate this replacement first? I don't understand the comment in the code here:

    // a little substitution function for BibTeX keys, where we don't want LaTeX
    // escaping, but we do want to preserve the base characters

    function tidyAccents(s) {
    var r=s.toLowerCase();

    // XXX Remove conditional when we drop Zotero 2.1.x support
    // This is supported in Zotero 3.0 and higher
    if (ZU.removeDiacritics !== undefined)
    r = ZU.removeDiacritics(r, true);
    else {
    // We fall back on the replacement list we used previously
    r = r.replace(new RegExp("[ä]", 'g'),"ae");
    r = r.replace(new RegExp("[ö]", 'g'),"oe");
    r = r.replace(new RegExp("[ü]", 'g'),"ue");
    r = r.replace(new RegExp("[àáâãå]", 'g'),"a");
    r = r.replace(new RegExp("æ", 'g'),"ae");
    r = r.replace(new RegExp("ç", 'g'),"c");
    r = r.replace(new RegExp("[èéêë]", 'g'),"e");
    r = r.replace(new RegExp("[ìíîï]", 'g'),"i");
    r = r.replace(new RegExp("ñ", 'g'),"n");
    r = r.replace(new RegExp("[òóôõ]", 'g'),"o");
    r = r.replace(new RegExp("œ", 'g'),"oe");
    r = r.replace(new RegExp("[ùúû]", 'g'),"u");
    r = r.replace(new RegExp("[ýÿ]", 'g'),"y");
    }

    return r;
    };
  • So basically you disabled character replacement for exporting the library, which now matches cmd+shift+c behavior. When you use cmd+shift+c zotero uses a CSL style to format a reference, which is different and separate from the translator. As I mentioned above, I don't believe CSL can do the same sort of character replacement that a translator can, so actually what you did may be the easiest solution. Though this may cause further problems in some cases, since character replacement was there for a reason.
  • When you use cmd+shift+c zotero uses a CSL style to format a reference, which is different and separate from the translator.
    No, that's not true. Cmd-Shift-C just uses whatever Quick Copy is set to use. It sounds like in obsrvng_obsrvrs's case that's the custom BibTeX style.
  • well, yes and no: as I wrote my cmd-shift-c style is the above mentioned translator called: BibTeX-cite-keys-only.js

    and since it now works I'm almost happy, but one problem I couldn't figure out:
    the code snipped I quoted is from the bibtex.js file and it shows the exact same table for replacing the umlauts in the exported bibtex keys as the BibTeX-cite-keys-only.js file that I use for Quicke Copy - only that one was exporting bibtex keys with "ae" the other with "a" (both replacing "ä")... any ideas why? what do I miss?

    I 'solved' it by forcing also the BibTeX-cite-keys-only.js to export "ä" as "a" although this one was capable of exporting it as "ae"... I have really no clue...
  • well, yes and no: as I wrote my cmd-shift-c style is the above mentioned translator called: BibTeX-cite-keys-only.js
    Er, yes, I meant translator, not style.

    But that's a custom translator. We have nothing to do with that, so I can't help you with it.
  • ok, thank you anyways... but wouldn't it be nice to get a quick copy translator into the official version, since there already is a bibtex.js for the export? otherwise one is always (officially...) bound to a bibtex application. and it shouldn't be that much of a problem, is it? I don't know, maybe I just can't see it.
    A better bibtex support would be nice. There are the improvements by spartanroc but I am hesitating since they involve changes that I cannot understand. and I really like to understand :)

    cheers, obs
  • obs: the version of the bibtex cite key translator you have is not using the zotero 3.0 diacritic removal code.

    The difference is likely the conditional:

    "if (ZU.removeDiacritics !== undefined)" ... then it uses the new code.

    See the end of the discussion here which I just updated:
    http://forums.zotero.org/discussion/5094/drag-and-drop-bibtex-cite/#Item_18
Sign In or Register to comment.