[luatex] lua script on the run

Philipp Stephani st_philipp at yahoo.de
Fri Jan 7 11:38:26 CET 2011

Am 07.01.2011 um 01:27 schrieb Luis Rivera:

> On 6 January 2011 16:41, Philipp Stephani <st_philipp at yahoo.de> wrote:
>> Am 06.01.2011 um 23:25 schrieb Luis Rivera:
>>> 1. If I were to store the macro in a style sheet (texperanto.sty), I'd
>>> probably remove the call to luaotfload, right?
>> And add lots of other non-functional code whose sole purpose is to make the file robust and format-independent. See luaotfload.sty or most Heiko packages for good examples (I think these are mostly auto-generated).
> So perhaps luaotfload.sty does more tricks than simply loading otf
> fonts...

There is nothing simple about loading OTF fonts; luaotfload contains more than 10000 lines of code.
But what I mean with making the file robust is protection against catcode changes, using LaTeX if it's available, disabling loading the file twice, and so on.

>>> 2. That still leaves aside the case where the call for the macro
>>> \texperanto makes all changes local to the group.
>> You could define a macro pair \starttexperanto/\stoptexperanto that enable/disable the callback.
> This seems to be ConTeXt's way to handle it (\start&\stop<language>),
> afaict. Defining \texperanto and \endtexperanto would do the trick for
> LaTeX, if I want to use an environment.

Yes, but languages have little to do with input any more once you use Unicode.

> I still have to figure out how to tie this to polyglossia, to get the
> right hyphenation and captions; but that's another matter.

polyglossia requires XeLaTeX, it doesn't work with plain LuaTeX or LuaLaTeX.

BTW, you should _not_ do something like replacing ^c by ĉ. If you want ĉ, type ĉ. Use a keyboard layout that contains that character, an input method, or some auto-correction function of your text editor, but don't transform text while processing. This is true no matter whether you write text files, HTML, TeX, or whatever. Babel-like shorthands are completely obsoleted by Unicode and cause more problems than they solve.

More information about the luatex mailing list