[texworks] Macros anyone?

Jonathan Kew jonathan at jfkew.plus.com
Mon Sep 29 00:06:02 CEST 2008


On 28 Sep 2008, at 8:56 PM, Juan Acevedo wrote:

> Hello,
>
> Has anyone got a trick to create macros and assign them keystrokes  
> in TeXworks so far? I just need the simplest things, like inserting  
> \index{} at the touch of one button :-)
> Completion is not an option, as I have to do really many many times.

If you want to add \index{...} commands to existing text, I can see  
this would be tedious.

For typing new material and including \index{} as you go along,  
completion could be reasonably efficient, I would think. If you create  
a new file acevedo.txt inside the ~/Library/TeXworks/completion/  
folder, containing the line

x:=\index{#INS#}

then you'll be able to simply type x<TAB> (or x<ESC> with older  
builds) to get \index{} with the insertion point between the curly  
braces, ready to type the word you want to index.

>
>
> I am working in a Mac. Would Applescript work?

No, sorry.

I expect there will eventually be a scripting/macro facility, but  
there isn't one at present.

JK



More information about the texworks mailing list