Skip to content

Instantly share code, notes, and snippets.

@willfurnass
Created February 20, 2016 16:19
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 willfurnass/a95b6eb62c09c3d12231 to your computer and use it in GitHub Desktop.
Save willfurnass/a95b6eb62c09c3d12231 to your computer and use it in GitHub Desktop.
Patch Zotero's translators/BibTeX.js so non-empty shortTitle values used as BibTeX key when exporting Zotero library.
--- BibTeX.js.orig 2015-07-03 07:18:37.000000000 +0100
+++ BibTeX.js 2015-08-09 14:21:08.779706944 +0100
@@ -1176,7 +1176,11 @@
if(!type) type = "misc";
// create a unique citation key
- var citekey = buildCiteKey(item, citekeys);
+ if (item.shortTitle==''){
+ var citekey = buildCiteKey(item, citekeys);
+ } else {
+ var citekey = item.shortTitle
+ }
// write citation key
Zotero.write((first ? "" : "\n\n") + "@"+type+"{"+citekey);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment