How to import the bibtexkey of a Jabref file

I would like to import my Jabref database in Zotero. The import is fine, the only problem for me is the bibtexkey.
I use it as a cote and I wild like to import this data in the "cote" field of Zotero.
Any idea how to to it ?

Many thnaks in advance for your help.
Sophie
  • It involves a bit of code, but if you're up for it:
    All Zotero exports are done by small javascript files in the translators directory in the Zotero data folder: https://www.zotero.org/support/zotero_data

    Changes there take effect immediately, so it's pretty easy to test and you can revert them using the "Reset Translators" button in the preferences, so not much that can go wrong.

    BibTeX is imported using BibTeX.js. The citekey is available as item.itemID during import and you could map that to item.callNumber (which I think is what cote in the French version corresponds to)
  • You can also try the BetterBibtex add-on (https://github.com/retorquere/zotero-better-bibtex/releases). It imports the Bibtexkey generated by Jabref.
  • Yes, BetterBibTex is definitely the better way to do this. I had forgotten it imports citekeys. They will be displayed at the top of the reference on the right, not in the Call Number field, but I'd assume that's actually preferable (not least because call Number doesn't exist for all item types).
  • Hello Adam, hello Steffeno,

    I tried both solutions and today I prefer the first one because I created my own bibtexkey and I really want to keep them (and not to replace them by an automatically generated key) and as it is precisely a call number, the "cote" field is the right destination.

    Many many thanks for your help.
    It is always a pleasure to ask a question here and to receive great advices.

    Kindly
    Sophie
  • To be clear, if you import using BetterBibTeX, it will keep the imported citekey, not use an automatic one. Using BetterBibTeX has the advantage of properly exporting the citekey to the BibTeX citekey field when you export from Zotero (which using Call Number won't).
  • Sorry bwiernik,
    But in my test, my own bibtexkey had been replaced by an automatic one...
  • @emilianoeheyns Is that the expected behavior here?
  • @bwiernik the behavior you described earlier is correct; if the citekey is not imported correctly that would be a bug (but a weird one, as my test suite would fail in multiple places if that were the case).

    As @bwiernik says, the imported key will be displayed at the top of the reference.

    @"Sophie Cornu", if it is not displaying the key you had, please open an issue on the BBT github project. Are you by any chance exporting the imported references with "BibTeX" rather than "Better BibTeX"? That would explain why you're seeing automatic keys. I have halve a mind to offer the option to remove the stock Zotero BibTeX translators in my onboarding wizard. This problem of BibTeX vs BBT export happens pretty frequently.
  • For completeness sake: if BBT is installed, it will handle the import, not Zotero BibTeX. This is not (cannot be) configurable, as the translator priorities are hard-coded into the translators.

    If BBT handles the import, the citekey will show up in the `extra` field (and at the top of the reference in Zotero). If it is then again exported with BBT, that's the key that will be used.

    If the reference was imported without BBT installed, Zotero will have done the import, and the citekey is lost; BBT cannot reproduce it from such references, so it will generate a new key. Similarly, the Zotero "BibTeX" export doesn't know about the citation key in the extra field, and will ignore it. To import and keep using existing citation keys in Zotero, importing and exporting with BBT is the only way.
  • @bwiernik and @emilianoheyn,
    I retry today and I would like to apologize.
    I erase the previous tests, I enable the Zotero Better Bibtex extension in Zotero, and I re-import my .bib file after.
    My own bibtexkey appears at the top of the reference and in the extra field. It's really great.
    Thank you both for your help and the very clear explanation.
    Kindly

    Sophie
Sign In or Register to comment.