The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE
The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE
luatools --generate This command will generate the relevant databases. Optionally you can provide --minimize which will generate a leaner database, which in turn will bring down loading time to (on my machine) about 0.1 sec instead of 0.2 seconds. The --sort option will give nicer intermediate (.lua) les that are more handy for debugging. When done, you can use luatools roughly in the same manner as kpsewhich, for instance to locate les: luatools texnansi-lmr10.tfm luatools --all tufte.tex You can also inspect its internal state, for instance with: luatools --variables --pattern=TEXMF luatools --expansions --pattern=context This will show you the (expanded) variables from the conguration les. Normally you don't need to go that deep into the belly. The luatools script can also generate a format and run LuaTEX. For ConTEXt this is normally done with the TEXexec wrapper, for instance: texexec --make --all --luatex When dealing with this process we need to keep several things in mind: • LuaTEX needs a Lua startup le in both ini and runtime mode • these les may be the same but may also be different • here we use the same les but a compiled one in runtime mode • we cannot yet use a le location mechanism A .luc le is a precompiled Lua chunk. In order to guard consistency between Lua code and tex code, ConTEXt will preload all Lua code and store them in the bytecode table provided by LuaTEX. How this is done, is another story. Contrary to these tables, the initialization code can not be put into the format, if only because at that stage we still need to set up memory and other parameters. In our case, especially because we want to overload the io handler, we want to store the startup le in the same path as the format le. This means that scripts that deal with format generation also need to take care of (relocating) the startup le. Normally we will use TEXexec but we can also use luatools. Say that we want to make a plain format. We can call luatools as follows: 20 Initialization revised
luatools --ini plain This will give us (in the current path): 120,808 plain.fmt 2,650 plain.log 80,767 plain.lua 64,807 plain.luc From now on, only the plain.fmt and plain.luc le are important. Processing a le test \end can be done with: luatools --fmt=./plain.fmt test This returns: This is luaTeX, Version 3.141592-0.1-alpha-20061018 (Web2C 7.5.5) (./test.tex [1] ) Output written on test.dvi (1 page, 260 bytes). Transcript written on test.log. which looks rather familiar. Keep in mind that at this stage we still run good old Plain TEX. In due time we will provide a few les that will making work with Lua more convenient in Plain TEX, but at this moment you can already use for instance \directlua. In case you wonder how this is related to ConTEXt, well only to the extend that it uses a couple of rather generic ConTEXt related Lua les. ConTEXt users can best use TEXexec which will relocate the format related les to the regular engine path. In luatools terms we have two choices: luatools --ini cont-en luatools --ini --compile cont-en The difference is that in the rst case context.lua is used as startup le. This Lua le creates the cont-en.luc runtime le. In the second call luatools will create a cont-en.lua le and compile that one. An even more specic call would be: luatools --ini --compile --luafile=blabla.lua cont-en luatools --ini --compile --lualibs=bla-1.lua,bla-2.lua cont-en This call does not make much sense for ConTEXt. Keep in mind that luatools does not set up user specic congurations, for instance the --all switch in TEXexec will set up all patterns. Initialization revised 21
- Page 1: MKII CONTEXT CONTEXT The history of
- Page 4 and 5: XXI The luacation of TEX and ConTEX
- Page 6 and 7: 4 Introduction
- Page 8 and 9: Keep in mind that the functionality
- Page 10 and 11: tricky part of this conversion is t
- Page 12 and 13: prologues := 1 ; mpprocset := 1 ; W
- Page 14 and 15: code. However, the signicantly larg
- Page 16 and 17: \input zip:///somezipfile.zip?name=
- Page 18 and 19: ecause we could move all kind of po
- Page 20 and 21: If an acrhive is not a real TEX tre
- Page 24 and 25: I know that it sounds a bit messy,
- Page 26 and 27: By combining Lua with TEX, we can d
- Page 28 and 29: 26 An example: CalcMath
- Page 30 and 31: collapser was written. In the (pre)
- Page 32 and 33: 30 Going utf
- Page 34 and 35: In practice we prefer a more abstra
- Page 36 and 37: of making that table accessible for
- Page 38 and 39: Therefore, it will be no surprise t
- Page 40 and 41: {"special","pdf: 1 0 0 rg"}, {"font
- Page 42 and 43: some neat feature of \TeX, once you
- Page 44 and 45: OPENTYPE 144 17.571.732 ENC 268 782
- Page 46 and 47: The font denition callback intercep
- Page 48 and 49: When processing a not so large le b
- Page 50 and 51: letter 105 i spacer 32 letter 116 t
- Page 52 and 53: egister 2 3190 dimen other_char 50
- Page 54 and 55: This example uses an active charact
- Page 56 and 57: function tex.printlist(data) callba
- Page 58 and 59: 56 Token speak
- Page 60 and 61: Interesting is that upto now I didn
- Page 62 and 63: do end local function nextbyte(f) r
- Page 64 and 65: \ctxlua{collectgarbage("setstepmul"
- Page 66 and 67: Collecting tokens can take place in
- Page 68 and 69: where TEX has to convert to and fro
- Page 70 and 71: When experimenting with the new imp
luatools --ini plain<br />
This will give us (in the current path):<br />
120,808 plain.fmt<br />
2,650 plain.log<br />
80,767 plain.lua<br />
64,807 plain.luc<br />
From now on, only the plain.fmt and plain.luc le are important. Processing a le<br />
test \end<br />
can be done with:<br />
luatools --fmt=./plain.fmt test<br />
This returns:<br />
This is luaTeX, Version 3.141592-0.1-alpha-20061018 (Web2C 7.5.5)<br />
(./test.tex [1] )<br />
Output written on test.dvi (1 page, 260 bytes).<br />
Transcript written on test.log.<br />
which looks rather familiar. Keep in mind that at this stage we still run good old Plain TEX.<br />
In due time we will provide a few les that will making work with Lua more convenient<br />
in Plain TEX, but at this moment you can already use for instance \directlua.<br />
In case you wonder how this is related to ConTEXt, well only to the extend that it uses a<br />
couple <strong>of</strong> rather generic ConTEXt related Lua les.<br />
ConTEXt users can best use TEXexec which will relocate the format related les to the regular<br />
engine path. In luatools terms we have two choices:<br />
luatools --ini cont-en<br />
luatools --ini --compile cont-en<br />
<strong>The</strong> difference is that in the rst case context.lua is used as startup le. This Lua le creates<br />
the cont-en.luc runtime le. In the second call luatools will create a cont-en.lua<br />
le and compile that one. An even more specic call would be:<br />
luatools --ini --compile --luafile=blabla.lua<br />
cont-en<br />
luatools --ini --compile --lualibs=bla-1.lua,bla-2.lua cont-en<br />
This call does not make much sense for ConTEXt. Keep in mind that luatools does not set<br />
up user specic congurations, for instance the --all switch in TEXexec will set up all<br />
patterns.<br />
Initialization revised 21