migrate from openoffice+zotero to TeX+zotero

I have the following issue. I have openoffice odt files with hundreds of citations and I consider migrating them to LaTeX. Doing this by hand is possible, but extremely laborous.

What I have in *.odt files are Zotero item tags, which look like this:
"ZOTERO_ITEM_{"citationID"_"17prh12c2f"_"citationItems"__{"uri"__"http___zotero_org_users_111xxx_items_ZWHMS6WH"_}_}_RNDSa1Ra5NlJo"

What I need is at least the flat text of the document with latex citations, which look like this:

\citep{oecd2001measuring}

this is the format generated by the BibtexCiteKeyOnly.js translator.

As you can see, the citationID is different from what bibtex generates for latex. Has anyone solved this problem already?
  • I'll leave advice about the workflow to others who know the BibTeX side better than I do, but just for info, the "citationID" is not a key for an individual item; it's a key to the citation as a whole (which may contain multiple items).
  • There is a bibtex citation style that creates keys and content of the bibtex file that would go with the document. You only need to add the citep{} around the keys.

    Citation:
    Collins_2003

    Bibliography:
    @article{Collins_2003, title={Pretesting survey instruments: an overview of cognitive methods}, volume={12}, number={3}, journal={Quality of Life Research}, author={Collins, D.}, year={2003}, pages={229–238}}

    The link for the style is
    http://www.zotero.org/styles/bibtex

    Note that these keys might not match exactly keys that would be generated if you exported your Zotero database as bibtex.
  • I need two things:
    1) a way to export the raw text from odt files, which keeps the zotero tags as something like this:

    "The results in the literature confirm the thesis. \citep(some_identifier)"

    2) creating a bibtex file with matching identifiers.
  • i have looked up the structure of the zotero database (sqlite). The way I see it, the citations are matched by the "key" column of the "items" table. In the above example that would be the "ZWHMS6WH" part. This one needs to be exported as \citep{ZWHMS6WH} It's not human readable, but would do the trick for the migration.
  • I think that the existing bibtex style is your best bet. The alternative is to modify the style to fit your needs or write a new style.
  • alright, I have partially solved this.

    1. copy BibTeX.js to BibTeXItemKey.js
    2. change the "translatorID" number to something else
    3. change "label" to something else. I have:"BibTeX-itemkey"
    4. change the line
    Zotero.write((first ? "" : ",\n\n") + "@"+type+"{"+citekey);
    to
    Zotero.write((first ? "" : ",\n\n") + "@"+type+"{"+item.key);

    Works like a charm. The output will look like this:

    @book{ZWHMS6WH,
    title = {Capital},
    author = {{OECD}},
    year = {2001}
    },

    Credits for this idea go to bjonnh on a previous forum:
    http://forums.zotero.org/discussion/15273/add-itemlibraryid-and-itemkey-to-citation-system/
  • Since nobody seems to have asked the question ...
    I have openoffice odt files with hundreds of citations and I consider migrating them to LaTeX.
    Why are you "considering" this? Seems like a bad idea to me mid-project.
  • LaTeX would give me a very clean print of the final document with consistent styles, something I can trust. I need to do some cleaning up of the styles in odt files, which will require a lot of work anyway. The document needs to look the same everywhere, but right now there are local variations in the font size and paragraph, which are impossible to find in a wysiwyg editor.
Sign In or Register to comment.