BibTeX and natbib: Zotero arXiv article entry fix

BibTeX
Zotero
LaTeX
Better BibTeX
Author
Published

October 31, 2025

Modified

October 31, 2025

When exporting references from Zotero to BibTeX (using Better BibTeX), arXiv articles may not be formatted correctly in LaTeX-generated PDFs, as BibTeX is by default unaware of arXiv/preprint type. For example, currently (2025) an arXiv article entry from Zotero would look like this:1

@misc{betancourtConceptualIntroductionHamiltonian2018,
  title = {A Conceptual Introduction to {{Hamiltonian Monte Carlo}}},
  author = {Betancourt, Michael},
  year = 2018,
  month = jul,
  number = {arXiv:1701.02434},
  eprint = {1701.02434},
  primaryclass = {stat},
  publisher = {arXiv},
  doi = {10.48550/arXiv.1701.02434},
  archiveprefix = {arXiv},
}

The above would appear in the references section as:

Michael Betancourt. A conceptual introduction to Hamiltonian Monte Carlo,
July 2018.

A simple fix is to add a note field in the BibTeX entry with the arXiv identifier arXiv:1701.02434, so that the reference would look like:

Michael Betancourt. A conceptual introduction to Hamiltonian Monte Carlo,
July 2018. arXiv:1701.02434.

This can be automated by adding a postscript to the Better BibTeX export preferences in Zotero:

if (Translator.BetterTeX) {
  if (zotero.itemType == "preprint") {
  var arxivID = zotero.number;
  // Zotero.debug(JSON.stringify(arxivID))
  // Zotero.debug(JSON.stringify(zotero))
  tex.add({ name: 'note', value: arxivID});
  }
}

I hadn’t noticed this issue with arXiv articles before, as I usually relied on journal or conference templates that handled them correctly. When templates are unavailable, it might be preferable to switch to BibLaTeX instead of BibTeX + natbib, which provides more robust handling of preprint and arXiv entries.

Back to top

Footnotes

  1. Previously, these entries were exported as @article types in Zotero, but they now default to @misc types.↩︎

Reuse

Citation

BibTeX citation:
@online{li2025,
  author = {Li, Chengkun},
  title = {BibTeX and Natbib: {Zotero} {arXiv} Article Entry Fix},
  date = {2025-10-31},
  url = {https://pipme.github.io/posts/2025-10-31-Zotero-bibtex-arxiv/index-gist.html},
  langid = {en}
}
For attribution, please cite this work as:
Li, Chengkun. 2025. “BibTeX and Natbib: Zotero arXiv Article Entry Fix.” October 31, 2025. https://pipme.github.io/posts/2025-10-31-Zotero-bibtex-arxiv/index-gist.html.