Tweaking default BibTeX key pattern via BibLaTeX.js translator in Zotero 5
I've been using the following key pattern [auth][year][shorttitle][volume] with Zotero 4 and BBT extension for quite a long time. Now when Zotero 5 has arrived (great job, by the way!) and BBT still being not compatible, how can I tweak the default translators in order to match the pattern I universally utilize?
var citeKeyFormat = "%a%y%t%v";
doesn't exactly use [shorttitle] as %t (it grabs the first word instead), and it seems like %v is not recognized as a key for volume.
Also, how reliable is this method of manual translators tweaking with Z5? Won't my changes be overwritten with an update in the future?
var citeKeyFormat = "%a%y%t%v";
doesn't exactly use [shorttitle] as %t (it grabs the first word instead), and it seems like %v is not recognized as a key for volume.
Also, how reliable is this method of manual translators tweaking with Z5? Won't my changes be overwritten with an update in the future?
Same for the BibLaTex translator: BibLaTeX.js
In BibTeX.js and BibLaTeX.js, there are only three wildcards: %a %y and %t
To add other wildcards, I think you just have to edit
var citeKeyConversions
(here in BibTeX.js, there in BibLaTeX.js).Short Title:
"s":function (flags, item) {
if (item["shortTitle"]) {
return item["shortTitle"].toLowerCase().replace(citeKeyTitleBannedRe, "");
}
return "noshortTitle";
}
Volume (i.e. volume holding the item (e.g. “2” when citing a chapter from book volume 2))
"v":function (flags, item) {
if (item["volume"]) {
return item["volume"];
}
return "";
}
and then adjust
var citeKeyFormat
accordingly. They will be. But you can change the translatorID, label, and lastUpdated at the beginning of the js file to create your own custom translator.I would expect [shorttitle] to return the value according to it's defined in JabRef (e.g. "The first 3 words of the title", http://help.jabref.org/en/BibtexKeyPatterns), and not the content of the field of similar name, which is in 95% of my entries is empty.
"s": function (flags, item) {
if (item["title"]) {
return item["title"].toLowerCase().replace(citeKeyTitleBannedRe, "").split(/\s+/g).slice(0,3).join("_");
}
return "";
}
adjust
join("_")
to modify the separator…I guess it's been feature-requested and discussed million times before, but I would really, really appreciate if the devs include a BibTeX-key constructor in Zotero GUI. This would make things so much easier.