# [luatex] lua script on the run

Philipp Stephani st_philipp at yahoo.de
Fri Jan 7 11:42:23 CET 2011

Am 07.01.2011 um 01:49 schrieb Arthur Reutenauer:

>> fonts...
>
>  That's not what Philipp meant: he hinted that there were some
> guidelines to write a robust LaTeX package, which luaotfload.sty
> follows, amongst many others.

As far as I understood, he doesn't want to write a LaTeX package. The packages I mentioned (oberdiek bundle, luatexbase…) are true LaTeX packages *and* at the same time usable from plain TeX, which comes at the price that you have to include lots of code to defend against "unfriendly" contexts: for example, in plain TeX you have no protection against loading a package twice, and you have no guarantees about catcodes.

>
>>        Defining \texperanto and \endtexperanto would do the trick for
>> LaTeX, if I want to use an environment.
>
>  It's rather the other way round: if you define an environment in LaTeX
> (with \newenvironment), LaTeX defines two new commands, \<environment>
> and \new<environment>, for you.  There are several advantages over
> defining them yourself, for example that LaTeX checks that a
> \begin{<environment>} are matched with \end{<environment>}, and that's
> what you should use in a package.

LaTeX always checks that, no matter how the environment commands are defined. In fact, most (all?) environments from the kernel are defined via
\def\X{...}
\def\endX{...}
and not via \newenvironment.