Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.
It looks like DOIs are not passed through to BibTeX output.
This snippet:
const Cite = require('citation-js');
const cite = new Cite('10.5281/zenodo.1005176');
cite.format('bibtex')
produces the following:
@misc{Willighagen2018larsgw,
author = {Willighagen, Lars and Willighagen, Egon and Badger, The Gitter and {\v C}erm{\' a}k, Petr and Wienke, Johannes},
year = {2018},
month = {nov 2},
publisher = {Zenodo},
title = {larsgw/citation.js: v0.4.0-10},
}
Apologies if I'm overlooking anything here. Is there a reason DOIs are not included? Is there an opt-in way to include them? FWIW some publishers now require that papers include linked DOIs in bibliographies, generated from BibTeX doi attributes.
It looks like DOIs are not passed through to BibTeX output.
This snippet:
produces the following:
No DOI is included, even though
cite.data[0].DOI
is10.5281/ZENODO.1005176
. This also stands in contrast to the (outdated?) example here: https://larsgw.github.io/citation.js/api/tutorial-cite_output.htmlApologies if I'm overlooking anything here. Is there a reason DOIs are not included? Is there an opt-in way to include them? FWIW some publishers now require that papers include linked DOIs in bibliographies, generated from BibTeX
doi
attributes.