[Dev-luatex] Snapshot 20060915

Taco Hoekwater taco at elvenkind.com
Fri Sep 15 16:39:39 CEST 2006


Here we go again. The new snapshot has the following
changes compared to 20060908:

* There is a new TEX primitive: \formatname. It is similar
   to \jobname (read-only). In initex, the expansion is empty,
   otherwise the expansion is the same as the \jobname from
   the initex run.

* the lua "tex" table has been expanded with a few of the 'convert'
   codes (read-only). The supported ones at this moment are:


   This list looks haphazard,  but it really is not. These are
   all the cases of the 'convert' internal command that do not
   require an argument.

* The metatables of the subtables like tex.dimen[] etc. are now
   adjustable from lua (not that I recommend doing that;-)).

* On the lua side, there is a new global value: "luaid"
   It holds the internal id number of this \directlua instance.

* There is a new lua table, "callback", that has the single function
   "callback.register", used to register callbacks.   This replaces
   the previous concoction (see my message about snapshot 20060901).
   Syntax is :

   callback.register(<callback name>,function (f) ... end)

   where the <callback name> is for the moment, either "input_line"
   or "show_error_hook".

   This function internalizes the callback function in such a way
   that you no longer have to worry about \luacallback (which has
   been removed), nor does it matter if you redefine a function

  The internal testing for callback presence is also quite a bit
  faster, thanks to this change. Callback assignments are global
  and the "input_line" always takes effect starting on the next
  input line to be read from an actual file.

* \detokenizedlua has been removed. It is functionally replaced by
   the new function call tex.write("").

   Each argument to each call of tex.write () counts as an input
   line, but:
   ** all catcodes on that line are either 'space' (for " ") or
      'character' for all others.
   ** there is no \newlinechar appended.

* The implementation of tex.print() has changed as well:

   ** the very last tex.print() line from a \directlua
      will no longer have a trailing \newlinechar
      (this is very convenient when \directlua is used
      within an \edef)
   ** tex.print() is quite a lot faster than before, and the total amount
      of returnable text from a \directlua is now only limited by
      available system RAM. However, each separate tex.print ()
      argument has to fit in TeX's input buffer.

* The new primitive \luastartup can be set inside the format file
   to specify the lua instance number in which a possible runtime
   startup.lua script is executed (initex always uses 0)

* There is a new primitive \scantextokens. Differences with
   eTeX's \scantokens are:

   ** the last line (usually only) from \scantextokens
      does not have a \newlinechar

   ** \scantextokens never raises an eof error.

   This means things like

         {\scantextokens{\ifnum1=1 true}\else false\fi}

   are legal input (but potentially dangerous!).

* If you say
      local d  = tex.dimen["unknowndimen"]
   'd' will now become "nil" instead of raising an error

      tex.dimen["unknowndimen"] = d
    is still (and probably will remain) illegal

Have fun, Taco

Downloading and installation details:

If you go to


you will see that there are two new released files:

* luatex-snapshot-20060915.tar.gz
      This is the source tree.

* luatex-snapshot-20060915-win32.zip
      A cross-compiled (mingw) windows binary. This is a web2c
      based binary, so it needs a texmf.cnf file (It will NOT
      work if you have only miktex installed).

      This executable cannot run dynamically loaded lua dlls. Perhaps
      that can be fixed but I do not know how.

More information about the dev-luatex mailing list