Skip to content

Instantly share code, notes, and snippets.

@dschaehi
Last active March 26, 2024 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dschaehi/54e954d4380f743ccd467496814a7b90 to your computer and use it in GitHub Desktop.
Save dschaehi/54e954d4380f743ccd467496814a7b90 to your computer and use it in GitHub Desktop.
Zotero Better BibLaTeX script for arXiv and conference papers with missing booktitle
if (Translator.BetterBibTeX) {
if (tex.has.doi) {
tex.remove("doi");
}
if (tex.has.url) {
tex.remove("url");
}
if (tex.has.issn) {
tex.remove("issn");
}
if (tex.has.month) {
tex.remove("month");
}
if (tex.entrytype === "misc" && zotero.arXiv) {
if (!tex.has.misc) tex.entrytype = "article";
if (tex.has.number) {
tex.remove("number");
}
if (tex.has.journal) {
tex.remove("journal");
}
tex.add({
name: "journal",
value: "arXiv preprint arXiv:" + zotero.arXiv.id,
});
}
}
/*
if (Translator.BetterBibLaTeX && tex.entrytype === "online" && zotero.arXiv) {
if (!tex.has.online) tex.entrytype = "article";
if (tex.has.number) {
tex.remove("number");
}
if (tex.has.pubstate) {
tex.remove("pubstate");
}
if (tex.has.journal) {
tex.remove("journal");
}
tex.add({
name: "journal",
value: "arXiv preprint arXiv:" + zotero.arXiv.id,
});
}
if (Translator.BetterBibLaTeX && tex.entrytype == 'inproceedings') {
if (!tex.has.booktitle && tex.has.eventtitle) {
tex.add({name: 'booktitle', value: zotero.conferenceName})
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment