[luatex] macros to invoke lua in LaTeX

Ulrike Fischer luatex at nililand.de
Thu Mar 5 17:51:54 CET 2009

Am Thu, 05 Mar 2009 17:04:26 +0100 schrieb Hans Hagen:

>> Naturally luatex can add new primitives (and should do it) like 
>> pdftex has done it. And you will never be able to avoid that such a 
>> new primitive clash somehow. But nevertheless I think it would be 
>> very useful if the names of the primitives would use an uniform 
>> prefix -- even more as luatex is not stable and new primitives can 
>> arise or disappear again. Prefixes like \pdf of pdftex and \XeTeX of 
>> xetex create a simple namespace and enable package writers to avoid 
>> _future_ conflicts with new primitives simply by not using the 
>> prefix. 
> there is no such problem:
> - engine starts up with \newthing defined as primitive
> - macro packagesis loaded and defines \newthing itself
> so, how can there be a conflict? only if other packages expect \newthing 
> to be the primitive which they can't because it was always a macro

A new package is written which uses the primitive \newthing and
knows nothing about the old package with the \newthing macro. The
some user loads both packages and gets a conflict. 

This is probably not a real problem in a system like context where
large portions of the code are under your control. But in a system
like LaTeX with its large amounts of packages from various authors,
some small, some large, some old and perhaps not longer maintained
it is much more difficult to know which package is (re)defining
which macro.

> now, nothing prevents a macro package core to provide \prefixednewthing 
> as soon as \newthing shows up in the engine

Sure, if you mean by "macro package" a large, well maintained format
and not one of the small LaTeX-package. The LaTeX kernel e.g. could
do it, like LaTeX3 is doing it for the TeX-primitives. But in the
case of the TeX-primitives this renaming is necessary because there
is no chance to change the names in the engines itself. luatex on
the other side is _new_. Why doesn't it use names where there is
less danger that someone will try to overwrite it? It would be a
pity if you would have to use \latexluanewthing with latex3 and
\ctxluanewthing with context and \memluanewthing in latex2e when
using the memoir class and \komaluanewthing when using a KOMA-class. 

Ulrike Fischer 

More information about the luatex mailing list