Scripting in TeXworks

Stefan Löffler has recently posted to the TeXworks mailing list that he’s sorted out a patch to integrate Lua into TeXworks. Many people will be aware that Lua is very much the scripting language of the moment in the TeX world, because of the LuaTeX project. So it makes sense to consider it as a method for scripting TeXworks. The idea has always been that TeXworks will have a simple interface but powerful features available to those who want them. So adding scripting is a vital step forward. With a light-weight scripting system available, power users can code their own features into TeXworks while leaving the basics accessible to everyone.

That doesn’t mean that Lua has to be the (only) language available: Jonathan Kew (TeXworks lead developer) has suggested QtScript (which is JavaScript-like) as a possibility. TeXworks is built using Qt, so there is a definite logic here. As Jonathan himself points out, actually having a patch available certainly means that Lua is likely to be integrated!

9 thoughts on “Scripting in TeXworks

  1. I’m luck that Windows builds are made available by Alain Delmoitte. In the longer term, some kind of installer is going to be needed. I guess Jonathan is hoping for volunteers!

  2. I looked at TeXworks features ( haven’t tried the program tho ) and it seems to me that AUCTeX has all its features. Do you know if this is a roughly correct impression?

    One of its key features, immediate preview of the document, do you know if this is implemented by incremental compiling, or by recompiling the whole doc everytime changes are saved?

    Thanks. — Leo

  3. Simon,

    I think that’s why there are not “official” builds that often 🙂 I get the feeling once you have a “recipe” all is well, but getting to that stage is a pain.

  4. Leo,

    It depends on what you think of as “features”. The aim of TeXworks is to have a relatively “clean” interface that newer users can get to grips with, without dropping powerful features. AUCTeX is built on emacs, which as we know is not everyone’s choice for ease of use! Remember that TeXworks is inspired by the Mac-only TeXshop programme. Emacs it is not 🙂

    TeXworks doesn’t do any kind of incremental compilation. What you get is two windows, with one showing source and the other PDF output. The user decides when to compile, and the magic of SyncTeX lets you go from source to PDF or vice versa. The key point here is that this works with any TeX variant. As I understand it, AUCTeX uses preview-latex, but this is not much use for plain TeX or ConTeXt users. TeXworks is “format neutral”, with nothing in the core code which makes assumptions about which type of TeX is in use.

  5. There’s an interesting TeX editor being developed in the Netherlands called Gummi (<LaTeX, geddit?) that compiles and displays as you write your TeX code. It's Linux-only at present. See
    Gummi is particularly good for teaching TeX, or for someone learning, since you can just type – — — and immediately see the output in the preview window. Runs pdfTeX or xetex.

  6. Hello Dominik,

    Gummi’s been mentioned to me before, but this time I gave it a quick spin. My Ubuntu system doesn’t actually have TeX Live installed at the moment, so I went with compiling Gummi myself rather than using the prebuilt version. Everything looks okay, and in many ways similar to TeXworks. I’m not so sure about “compile as you use”, as I don’t see it working so well with big documents. (I’m also a fan of the TeXworks approach of aiming for cross-platform from the start). I’ll certainly keep an eye on Gummi: perhaps I’ll do some more testing when I update my Ubuntu installation.


Leave a Reply