Manually entering unique IDs to library items

Dear all,

Zotero allows you to export files to CSL JSON under *File>Export Library*. This is great, but it looks like the `id` field is auto-generated for every bibliographic entry.

I would like to ask whether there's a way of manually creating unique IDs for the items in my library *before* exporting them.

My current workflow involves using the pandoc CLI to convert from Markdown to HTML. I would like to incorporate a CSL JSON or CSL YAML bibliography into my resulting HTML document. In the Markdown document I use intuitive IDs like `@PaperAboutTopicA` and `@PaperAboutTopicB` so that I can quickly generate a citation without having to cross-check the auto-generated ID with other information like the title and author before actually typing it in as a citation in the original markdown.

Is there any way to do this via Zotero? Or perhaps using some sort of extension to Zotero? Thanks in advance.
  • Since it looks like you're using BBT anyway (Zotero doesn't export CSL YAML natively) I think you can just set that up to use the citekeys as IDs for its export formats. You can customize & pin BBT-generated citekeys to make sure they're stable and in the format you want them.
    If that's not the case (or at least not obviously so), ask over on the BBT GitHub and I'm pretty sure Emiliano will be able to tell you how to do this.
  • @adamsmith

    If by BBT you mean BibTeX then no, that is incorrect, I am not using BibTeX. I would very much like to stick with Citation Style Language syntax for the time being.

    I'm perfectly fine with adding a step to convert from JSON to YAML using something like `yq -Poy bib.json`. I'm only converting to YAML since it's a bit more readable.

    The thing that kills my workflow here is not being able to manually set the unique IDs in the Zotero UI before exporting. The conversion to YAML simply regurgitates the unique IDs already in the JSON file.
  • No, I mean the BetterBibTeX add-on, which (while originally for Bib(La)TeX), among other things, provides pinnable citekeys and CSL YAML export.
  • edited October 13, 2023
    @adamsmith. Thanks... seems to work OK...

    I hope it doesn't use any TeX related technology under the hood? Are there any limitations with respect to the full Citation Style Language standards that I would need to be aware of?

    I'm really trying to avoid any dependency on TeX as you can probably tell :P.
  • Nope, nothing TeX related at all unless you use it to export to BibTeX or BibLaTeX. Most people use it for that purpose, a pure pandoc workflow like yours isn't that uncommon a use case.
  • Broadly think of BBT as a plugin for plain text writing workflows (including TeX, Quarto, Markdown, pandoc, etc)
Sign In or Register to comment.