Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@unhammer
Created August 27, 2010 08:27
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 unhammer/553037 to your computer and use it in GitHub Desktop.
Save unhammer/553037 to your computer and use it in GitHub Desktop.
writer2latex patch for LyZ
=== modified file 'chrome/content/lyz/lyz.js'
--- old/chrome/content/lyz/lyz.js 2010-06-20 01:25:54 +0000
+++ new/chrome/content/lyz/lyz.js 2010-08-27 08:05:37 +0000
@@ -265,7 +265,7 @@
},
- createCiteKey: function(id,text,bib){
+ createCiteKey: function(id,text,bib,obj_key){
var win = this.wm.getMostRecentWindow("navigator:browser");
var ckre = /.*@[a-z]+\{([^,]+),{1}/;
var oldkey = ckre.exec(text)[1];
@@ -276,6 +276,11 @@
text = text.replace(oldkey,citekey);
return [citekey,text];
}
+ else if (this.prefs.getCharPref("citekey") == "writer2latex"){
+ var citekey = obj_key;
+ text = text.replace(oldkey,citekey);
+ return [citekey,text];
+ }
var creators;
var authors;
var author;
@@ -402,7 +407,7 @@
var id =Zotero.Items.getLibraryKeyHash(items[i]);
translation.setItems([items[i]]);
translation.translate();
- var ct = this.createCiteKey(id,text,bib);
+ var ct = this.createCiteKey(id,text,bib,items[i].key);
tmp[id] = [ct[0],ct[1]];
}
return tmp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment