Hi, very simple script that adds the last citation you used. I just use "xx" to trigger as I use this alot. %SCRIPT var lineNo = cursor.lineNumber() while (lineNo > 0) { splits = editor.text(lineNo).split("\\cite") //loop to find last line with a citation: if (splits.length > 1) { // identify last citation endingString = splits[splits.length - 1] patt = /\{([^\}]*)\}/ var reference = endingString.match(patt)[1] editor.write("\\citep{"+reference+"}") lineNo = 0 } lineNo = lineNo - 1 }
..
Hi. Brand new to scripting with tex/java whatever :) Just thought others might find this useful. It's a basic autocorrect functionality as in word. Pressing space will autocorrect "doesnt"->"doesn't" for example. If you use this as a trigger: (?<=[^\\^ ]*)[ ] And then this as the script (mostly just a very long dictionary of autocorrects) %SCRIPT // simple script for automatic word completion var myDict = { // note all keys must be lowercase!! "avengence" : "a vengeance" , "adbandon" : "abandon"...