[texworks] Lua scripting

Stefan Löffler st.loeffler at gmail.com
Mon Jun 8 09:43:09 CEST 2009


Hi,

Bruno Voisin schrieb:
> There are some packaging systems on OS X (MacPorts, Fink), but they
> imply many system overrides (ie, replacing versions of the Unix
> binaries included in OS X by other versions of the same binaries), and
> for this reason they do not have the favour of a number of OS X users
> (since this implies changing, and hence risks breaking, OS X).

Thanks for the info. It's no problem, though, as the lua dependencies
(hopefully) can easily be downloaded by the programmers and then
included in the application so that the users don't have to care about it.

> Generally, I must say I'm rather scared by all this stuff here
> recently about scripting for TeXworks. TeXworks does very well what it
> was designed for, namely provide a no-nonsense graphical integrated
> environment for editing, typesetting, previewing and printing TeX
> documents. As such, the functions included in the built-in editor are
> all that's needed in normal use (basic search/replace, block comment
> and indent, spell check).
>
> It's not very clear to me what the added scripting functionality might
> be. If that's totally invisible from the user, OK. But please don't
> turn TeXworks into another bloatware.

Now there's one of the beauties in scripting. By default, you get the
nice and clean TW application you get today. But if you want, you *can*
add new functionality to it by downloading additional scripts. There's
no need to do it, but the possibility is there for those who want it.
Another benefit of scripting is that the scripts can be tailored towards
a specific workflow. I for example am using LaTeX pretty exclusively.
I'd appreciate a script that would parse the output of the LaTeX run and
present me with a nice, clean list of all errors, where I just have to
double-click on one to jump to the line in the code producing the error.
Since this is LateX specific (ConTeXt probably uses a different log
format) this can't be included in the TW core. But if someone were to
write a script to do just that, I who uses LaTeX could use it, and
someone else who uses ConTeXt doesn't (he could possibly use a different
script doing the same for ConTeXt, if he wants to). On a sidenote:
precisely this output parser incidentally is what my patch should make
possible ;).

As posted several times on this mailing list, people with all sorts of
different background are trying (and possibly switching to) TW. Some
like a clean interface, like you. Some may come from the emacs/vi world
and miss all sort of fancy functions. Others, coming from the Windows,
may expect hundreds of methods, icons, etc. There's no way of
accommodating them all with TW alone, but if we give them the
possibility to expand the core functionality and simply implement what
they miss I think many people are much more likely to use TW.

As for visibility: some things will be invisible, as they hook into the
code of TW and are run by TW. Others will simply give you an entry in
the Scripts menu. Those "new commands" can't be invisible, but they
shouldn't interfere with your normal work. And in the end, there's
always the option of not using scripts at all ;).

-Stefan


More information about the texworks mailing list