Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Last active March 15, 2021 17:25
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 bdarcus/6c625051d67b072d7fcfb03fafd574a8 to your computer and use it in GitHub Desktop.
Save bdarcus/6c625051d67b072d7fcfb03fafd574a8 to your computer and use it in GitHub Desktop.
better bibtex post-script
// https://github.com/retorquere/zotero-better-bibtex/issues/1759
switch (Translator.header.label) {
case "Better BibLaTeX":
if (reference.has.keywords) {
reference.has.keywords.name = "tags";
}
if (reference.has.title) {
const titles = reference.has.title.value.match(/(.+?)([?:;])(.*)/);
if (titles) {
let title = titles[1] + (titles[2] === "?" ? "?" : "");
reference.add({
name: "title",
value: title,
});
reference.add({
name: "subtitle",
value: titles[3].trim(),
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment