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

booktitle in inproceedings parses as journal #200

Closed himito closed 3 years ago

himito commented 4 years ago

Hello,

I tried to parse a bibtex entry of type inproceedings, but the output changes the field booktitle to journal. Here an example:

BibTeX input

@inproceedings{Bordea2014,
  author = {Paul Buitelaar and
               Georgeta Bordea and
               Barry Coughlan},
  title = {Hot Topics and Schisms in {NLP:} Community and Trend Analysis with Saffron on {ACL} and {LREC} Proceedings},
  booktitle = {Proceedings of the Ninth International Conference on Language Resources and Evaluation, {LREC}},
  pages = {2083--2088},
  year = {2014},
  biburl = {https://dblp.org/rec/bib/conf/lrec/BuitelaarBC14},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

Output from BibTeX input

[{
  "label":"Bordea2014",
  "type":"inproceedings",
  "properties":{
    "journal":"Proceedings of the Ninth International Conference on Language Resources and Evaluation, LREC","title":"Hot Topics and Schisms in NLP: Community and Trend Analysis with Saffron on ACL and LREC Proceedings","author":"Buitelaar, Paul and Bordea, Georgeta and Coughlan, Barry","pages":"2083--2088","date":"2014","year":"2014"
  }
}]

Thank you for your help !

larsgw commented 4 years ago

This line is the problem: https://github.com/citation-js/citation-js/blob/1226cde7518a44df37892ff431bcccfcc2087b94/packages/plugin-bibtex/src/output/json.js#L39, it should be paper-conference, the CSL equivalent of inproceedings. In the meantime, if you just need the BibTeX as JSON, you can also use the following snippet:

// Parses the input one step and returns the result. In the case
// of a BibTeX string, this outputs the JSON representation of the BibTeX
Cite.plugins.input.chainLink('...')

Demo on RunKit · Method docs

himito commented 4 years ago

Thank you @larsgw!

larsgw commented 3 years ago

This issue should be fixed in v0.5.0-alpha.10. If not, please re-open the issue.