Fields in Microsoft Word broken when library is replaced by same content

Hi,

I know I am using Zotero not quite the way it is intended, but still. I encountered the following problem:

o) I am Latex user and do everything in bibtex, so I have my carefully maintained library in a bibtex file
o) Sometimes I am forced to use Word, thanks to all of you for providing Zotero, which I thought would save my life :)
o) I then import my bibtex file into a fresh Zotero database and add references to my .doc
o) When I now find a mistake in my bib, I wanted to fix my bibfile rather than the entry in Zotero, thus I completely purge my Zotero library and re-import my updated bibfile
o) Unfortunately, all the fields in my .doc are broken, as Zotero does not seem to reference to the title or other fields (which admittedly may change) but to some randomly generated key which changes when I re-import an item (even with unchanged content).

This is deadly for me, any idea how to cope with this?

Thanks a bunch!!
  • no, sorry, there's no way to deal with this and Zotero isn't intended or designed to work with regularly deleted and re-imported databases. For the document in question I'm not aware of any way to fix/reattach this without doing it manually.

    My best suggestion would be to flip the script and use Zotero and betterBibTeX to manage your .bib file. That way you'd only have to maintain the data in one place and would also benefit from Zotero's data import ability.
    If that's not an option, you could still just fix any issues in both the bib file and Zotero
  • edited August 17, 2016
    Thanks Adam for the quick reply. Unfortunately, manual reinsertion is not really an option, it's a big document with hundreds of references.
    Updating in both places is also difficult, as I mostly work (happily) in LaTeX and only need to do this occasionally, but this means that my documents will be basically dead everytime I start again.
    I see your point regarding moving completely to Zotero, but I'm not ready for this yet after 25 years of happy text-file editing :)

    Just a quick question regarding the internals: with Shift+F9 I see the fields entered by Zotero into the .doc. When I add a reference, Zotero creates a field like this

    "citationItems":[{"id":5295,"uris":["http://zotero.org/users/local/.../items/N9GF6KVF"],"uri":["http://zotero.org/users/local/.../N9GF6KVF"]}

    When I delete all entries in Zotero, re-import the bibtex stuff, and insert the same references, the "id", "uris", and "uri" fields change.
    I am supposing that these are the links to the Zotero database?

    Any information on how these keys are generated when Zotero imports its stuff? Any way to see these keys in Zotero (They are not showing in the Info tab)?

    When I import a bibtex item, is the unique bibtex key also imported?
    (HUANG11 as below)? If it were in the SQLite database of Zotero, I could write a script to automatically migrate my .doc files by reading out the old content, creating a table with bibkeys and Zotero id's, importing the new content, and changing the old Zotero keys to the new ones ...

    @article{HUANG11,
    title = {Theoretical study of corundum as an ideal gate dielectric material for graphene transistors},
    author = {Huang, Bing and Xu, Qiang and Wei, Su-Huai},
    journal = {Phys. Rev. B},
    volume = {84},
    issue = {15},
    pages = {155406},
    numpages = {5},
    year = {2011},
    month = {Oct},
    publisher = {American Physical Society},
    doi = {10.1103/PhysRevB.84.155406},
    url = {http://link.aps.org/doi/10.1103/PhysRevB.84.155406}
    }

    Thanks!!!
  • I am supposing that these are the links to the Zotero database?
    yup
    Any information on how these keys are generated when Zotero imports its stuff?
    They're 8 character random alpha-numeric strings, intended to be (de facto) certainly unique if a user e.g. creates two separate databases and then syncs them together).
    Any way to see these keys in Zotero (They are not showing in the Info tab)?
    https://zoteromusings.wordpress.com/2013/04/23/zotero-item-uris-from-client/
    When I import a bibtex item, is the unique bibtex key also imported?
    (HUANG11 as below)?
    not currently, no, though that might(!) happen at some point.
    https://github.com/ZotPlus/zotero-better-bibtex
    has some added support for citekeys, but I don't believe that involves importing them (worth checking though).
    I think you _could_ import them into the Extra field (or anywhere else, but I'd recommend Extra) though by modifying the bibtex import (that's bibtex.js in the "translators" directory of Zotero's data folder: https://www.zotero.org/support/zotero_data)
    hth
  • edited August 17, 2016
    Thanks a bunch!

    Is there a possibility to overwrite these 8 random alpha-numeric characters, e.g. by placing them into my bibitems? That would nicely resolve my problem.

    E.g.,

    @article{HUANG11,
    ...
    zotero_key = {ABCDEFGH},
    ...
    }

    Thanks!
  • I'm pretty sure the answer is no. Certainly not with the existing translators.
    Dan at some point floated an idea to allow to keep item IDs stable on import, but while I'm sure this never happened, I don't know how much would have to change to allow for that.
  • Okay, pity, thanks a lot, Adam!
Sign In or Register to comment.