Created
August 27, 2010 08:27
-
-
Save unhammer/553037 to your computer and use it in GitHub Desktop.
writer2latex patch for LyZ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== 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