retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.38k stars 289 forks source link

[Bug]: arXiv categories missing in the BibTeX output when stored only in the Extra field #2483

Closed aywi closed 1 year ago

aywi commented 1 year ago

Debug log ID

DKRCS6I6-refs-apse

What happened?

The old behavior of Zotero was to save arXiv papers as journal articles and store categories in the Journal field. Now Zotero has changed to save arXiv papers as preprints and only save categories in the Extra field.

I have tried three combinations and found that categories are missing in the BibTeX output when stored only in the Extra field. I guess the underlying implementations for reading arXiv information from Journal vs. Extra are different?

retorquere commented 1 year ago

What are you getting, and what were you expecting?

aywi commented 1 year ago

What are you getting, and what were you expecting?

The current BBT output is:

@misc{Ramaswamy2022ELUDEGeneratingInterpretable,
  title = {{{ELUDE}}: Generating Interpretable Explanations via a Decomposition into Labelled and Unlabelled Features},
  shorttitle = {{{ELUDE}}},
  author = {Ramaswamy, Vikram V. and Kim, Sunnie S. Y. and Meister, Nicole and Fong, Ruth and Russakovsky, Olga},
  year = {2022},
  month = jun,
  number = {arXiv:2206.07690},
  eprint = {arXiv:2206.07690},
  publisher = {{arXiv}},
  url = {https://arxiv.org/abs/2206.07690},
  archiveprefix = {arxiv}
}

What I expected is (has arXiv:2206.07690 [cs] in the Extra field):

@misc{Ramaswamy2022ELUDEGeneratingInterpretable,
  title = {{{ELUDE}}: Generating Interpretable Explanations via a Decomposition into Labelled and Unlabelled Features},
  shorttitle = {{{ELUDE}}},
  author = {Ramaswamy, Vikram V. and Kim, Sunnie S. Y. and Meister, Nicole and Fong, Ruth and Russakovsky, Olga},
  year = {2022},
  month = jun,
  number = {arXiv:2206.07690},
  eprint = {arXiv:2206.07690},
  primaryclass = {cs},
  publisher = {{arXiv}},
  url = {https://arxiv.org/abs/2206.07690},
  archiveprefix = {arxiv}
}

I have tried to access the category via zotero.arXiv.category but what I get is undefined.

This is a sample output of previously saved arXiv papers (when Zotero still saved them as journal articles):

@article{Jin2021EUCAPracticalPrototyping,
  title = {{{EUCA}}: A Practical Prototyping Framework towards End-User-Centered Explainable Artificial Intelligence},
  shorttitle = {{{EUCA}}},
  author = {Jin, Weina and Fan, Jianyu and Gromala, Diane and Pasquier, Philippe and Hamarneh, Ghassan},
  year = {2021},
  month = feb,
  journal = {arXiv:2102.02437 [cs]},
  eprint = {2102.02437},
  primaryclass = {cs},
  url = {https://arxiv.org/abs/2102.02437},
  archiveprefix = {arxiv},
  langid = {english}
}

PS: The categories can be multiple, e.g. arXiv:2004.10282 [cs, eess, q-bio].

github-actions[bot] commented 1 year ago

:robot: this is your friendly neighborhood build bot announcing test build 6.7.71.4131 ("fixes #2483")

Install in Zotero by downloading test build 6.7.71.4131, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

aywi commented 1 year ago

robot this is your friendly neighborhood build bot announcing test build 6.7.71.4131 ("fixes #2483")

Install in Zotero by downloading test build 6.7.71.4131, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

Thanks, it looks good! Somehow you also changed the eprint in the BibTeX output of the preprint (stripping out the arXiv: head) to make it the same as the previously saved journal article form. This is fine for me, but may be groundbreaking for some (?) other users. If that is not an issue, I guess we can close this one.

@misc{Ramaswamy2022ELUDEGeneratingInterpretable,
  title = {{{ELUDE}}: Generating Interpretable Explanations via a Decomposition into Labelled and Unlabelled Features},
  shorttitle = {{{ELUDE}}},
  author = {Ramaswamy, Vikram V. and Kim, Sunnie S. Y. and Meister, Nicole and Fong, Ruth and Russakovsky, Olga},
  year = {2022},
  month = jun,
  number = {arXiv:2206.07690},
  eprint = {2206.07690},
  primaryclass = {cs},
  publisher = {{arXiv}},
  url = {https://arxiv.org/abs/2206.07690},
  archiveprefix = {arxiv}
}
retorquere commented 1 year ago

Thanks, it looks good! Somehow you also changed the eprint in the BibTeX output of the preprint (stripping out the arXiv: head) to make it the same as the previously saved journal article form.

This brings it in line with the other ways BBT shows arXiv IDs in the output. That I didn't do it here was an oversight. The eprinttype/archiveprefix tells you what type the identifier in eprint is.

github-actions[bot] commented 1 year ago

:robot: this is your friendly neighborhood build bot announcing test build 6.7.71.4133 ("fixes #2483")

Install in Zotero by downloading test build 6.7.71.4133, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".