[texworks] Lua scripting

Hans Hagen pragma at wxs.nl
Tue Jun 9 11:26:05 CEST 2009

Jérome Laurens wrote:

> In particular, gathering all the scripts in one script menu is not a 
> good idea if the scripts become numerous.

if teh scripts can adapt menus, then they can also change them depending 
on the task currently done; also, when someone is using texworks for 
latex it makes no sense to show context related menu items vise versa 
and scripts can take care of that

> The example given by Hartmut is typically something that should not 
> appear in a script menu.

you probably refer to my mail (hans)

> More precisely, the parsing of the output log file should be 
> automatically initiated once the typesetting process has successfully 
> ended.

well, in the case of context that could be part of the process that 
processes the file (which is handles outside texworks anyway); all we 
need is a hook that can be called and feeds back into texworks a list of 
  files/lines with errors (if needed at all);

> In short, there should be an "engine" which only purpose is to typeset 
> the current document with latex or texexec or whatsoever and analyze the 
> output for possible errors.
> In case of an error, a visible signal should be sent to the user (like 
> the red traffic light in textures?).

that depends on what the user wants; in my case i can imagine several 
feedback types depending on the kind of document; there is no way that 
the editor itself can know what an error means and where it can / should 
be fixed

> There also can be a tiny stop icon in front of each line where an error 
> occurred, and when you click or roll over this icon, the reason appears 
> in a small note window.

that assumes that the error relates to a line

> Eventually a check box in some preference pane could allow to suppress 
> the parsing of the log.

again, not something you want to hard code

> Extending TeXWorks with scripts is nothing but a plugin design. 
> Unfortunately, scripts won't do everything and other sorts of plugins 
> are necessary.
> For example, configuration files used in syntax coloring are also plugins.

if we have access to the renderer (i.e. can set attributes to chars) it 
can even nbe a script (not that i'm advocating this)

> There should be a unique plugin design to render 
> installation/Uninstallation straightforward.
> The user is not a configure/make fan.

there are several scenarios; in the case of context i can imagine a set 
of ini files to be part of the context distribution that users can drop 
in as replacement for the default ini files

> Finally, lua is powerful but dangerous. TeXWorks should launch scripts 
> in a safe environment to avoid viruses and other kinds of malware.

sure; but on the other hand, i don't expect users to install whatever 
script into texworks; it will normaly come from some tex distribution


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl

More information about the texworks mailing list