larsgw / citation.js

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.
https://citation.js.org/
MIT License
219 stars 30 forks source link

Include DOI in exported BibTeX? #224

Closed jheer closed 1 year ago

jheer commented 1 year ago

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},
}

No DOI is included, even though cite.data[0].DOI is 10.5281/ZENODO.1005176. This also stands in contrast to the (outdated?) example here: https://larsgw.github.io/citation.js/api/tutorial-cite_output.html

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.

jheer commented 1 year ago

Sorry, it looks like this is an outdated repo. I reposted here: https://github.com/citation-js/citation-js/issues/204

Feel free to close/delete this issue.