Bibtex export - support for cyrillic

Now Zotero just ignores any Cyrillic characters for autogenerated citerefs and they become something __2009 -- completely unusable. As far as I have seen there are translation tables in converter file.
Is it possible to add Cyrillic characters there too?
  • If you need a mapping just tell me what format it should be.
  • I don't think we'll add Cyrillic mapping - it just gets too much, we can't implement full utf-8 mapping in a translator file. If you want cyrillic characters you should use a utf-8 capable bibtex implementation.

    Even with that, though, I believe the current citekey generation function skips everything that's not ascii. That's pretty easy to disable in a custom version Currently
    https://github.com/zotero/translators/blob/master/BibTeX.js#L2125
    lists the _allowed_ characters. That could easily be turned into a version only banning certain characters (likely # % ' ( ) , = { } ~ and backslash )
  • Creating option to export utf-8 citekeys would be great then. Or the possibility to specify keys by hand. As far as I understand the latter feature is under development right now.
  • I don't know enough about bibtex implementations - I don't really like the idea of adding yet another option to the dialog, but it would be easy to use utf-8 citekeys for utf-8 bibtex export.
    Someone more knowledgeable would have to chime in on whether that makes sense (and then there's always the problem that this will break existing citekeys).

    Yes, I expect manually specifiable citekeys for Zotero 4.2
  • When I export to BibTex, I found the Rich Text Formatting useful to render some species names in the title italicized, this will be parsed by BibTex into \textit{}, but I found this bug:
    when I mark up two italic words in the same title, the first one get parsed, but the second one would be parsed wrongly:

    Example:
    Tagged title in Zotero:
    Correlation of T cell response and bacterial clearance in human volunteers challenged with Helicobacter pylori revealed by randomised controlled vaccination with Ty21a-based Salmonella vaccines

    Output in BibTex .bib file after export,
    Correlation of T cell response and bacterial clearance in human volunteers challenged with \textit{Helicobacter pylori} revealed by randomised controlled vaccination with Ty21a-based {\textless}i{\textgreater}Salmonella{\textless}/i{\textgreater} vaccines}

    Secondly, can Zotero add another tag which is for emphasized text, which is equivelant to \emph{} in LaTeX?
  • please don't double post. Answered here
    https://forums.zotero.org/discussion/23785/parse-markup-tags-in-titles/#Item_8
  • The situation is not completely clear with bibtex and non-ASCII (as it is with many things concerning bibtex).

    AFAIK bibtex

    - does not allow any special or non-ASCII characters in the citekey.
    - will handle most (all?) characters in entries
    - cannot do anything useful with non-ASCII characters. For example, it can't sort Cyrillic names.

    IME bibtex will just pass through any character unless it is part of the citekey where it is quite strict. So it sort of does and doesn't support UTF8.

    Full UTF8 support (with all possible ways of sorting etc.) is only available for biblatex/biber (actually, proper UTF8 handling was one of the reasons biber was started).
  • I use biber backend program, not Bibtex, I meant the bibtex file format after being exported from Zotero, please look at this workflow of bibliography citation in LaTeX using Zotero + biblatex package + biber backend + text editor http://tex.stackexchange.com/questions/18848/workflow-for-managing-references/114973#114973

    I wish if there is something like this:
    - dedicated shortcut key in Zotero to copy the citation key in bibtex format, but only citation key devoid from any surrounded mark-up strings
    - parsing properly the italics, even if it is repeated twice in the same title of Zotero entry

    - you can have a look at the workflow and suggest more improvements may be
  • Strictly speaking, biblatex's format is not the same as bibtex (the format).
  • @simifilm, biblatex package works well with bibtex format (I didn't experience a problem yet), the nice thing about biblatex you can customize styles as you wish from the bibtex format, whereas the biblatex translator of Zotero now is very buggy (the date field is horrible), until we have a decent one, then we can talk about biblatex format in Zotero, till now the bibtex translator is suffering from these issues:
    - citation key author_title_year, is not a good idea IMHO, the title if the title would be marked up with some tags then you will see these tags flowing into your citation key, which is not an elegant thing, citation keys should be stable, immutable, and informative as much as possible
    - parsing of the translator is not working if I do rich text tagging in the title more than once, if I am a chemist, or biologist, I would do this frequently with species names, chemicals, etc..., then this would be a nightmare to see the first tag parsed correctly, the others are not and will make it into your .bib file
    - I would expect a dedicated shortcut key to be assigned in Zotero bibtex translator to copy the citation key ALONE (without any mark-up strings or any other fields) of the selected reference(s) into clipboard to be pasted in the tex editor (saves a lot of time), like CTRL+ALT+B, is not bad.
  • @ffsammak: I know biblatex/biber very well, a biblatex style written by me is available on CTAN.

    But make no mistake: Biblatex's format is not bibtex proper. It's very similar, but it's not the same. It features many types and fields which are not part of traditional bibtex, some fields have a different format (date field is a good example) and, as already mentioned, it supports UTF8. Non-ASCII characters in the citekey are allowed in biblatex/biber, for traditional bibtex they are a no go. So while the formats are very similar, they are not the same.
  • Hello,
    There is a simple way to (temporarily) fix this for Zotero 4.0:
    in %ZOTERO_DIR%/translators/BibLaTeX.js replace line 235:
    var citeKeyCleanRe = /[^a-z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+/g;
    with:
    var citeKeyCleanRe = /["#%'(),={}~]+/g;

    Also, for citation, you may use script from here, - save it under %ZOTERO_DIR%/translators/BibLaTeX-autocite.js, and enable in Settings. It will copy links in the format \autocite{%author%_%title%_%year%}, compatible with the fix shown above.
    And if you want to copy just key, without any tags, replace line 228 from
    Zotero.write((first ? "\\autocite{" : ",") + citekey);
    to
    Zotero.write((first ? "" : ",") + citekey);
    and remove line 233.
  • edited May 14, 2014
    MarSoft, thanks, but what confused me is this tiny bit of code, because this what would show up in the settings of Zotero to choose this nice translator:
    "label": "BibTeX-autocite",
    change to:
    "label": "BibLaTeX-autocite",

    For citation key ONLY, I suggest this less code:

    replace Zotero.write((first ? "\\autocite{" : ",") + citekey); simply with Zotero.write(citekey);

    to prevent the unwanted brace at the end, replace Zotero.write("}"); with Zotero.write("");
Sign In or Register to comment.