What are some examples of programming in LuaTeX?
For example, suppose we want to typeset a table showing the sum of the roll of two dice and want the output to look like this: This is easy in LuaTeX. Once a Lua instance starts, TeX does not see anything until the Lua instance exits.
What is the difference between pdfTeX and LuaTeX?
From the user perspective we have pdfTeX as stable and more or less frozen 8 bit engine, XeTeX as unicode input and font aware engine using libraries for font handling, and LuaTeX as engine that is programmable and delegates as much as possible to Lua, with the objective to keep the core engine lean and mean.
Are there any fonts that can be used in LuaTeX?
There are three closely related projects (see download for svn details): The first two projects result in a collection of OpenType fonts that can be used in LuaTeX and XeTeX.
Which is the wrapper around the LuaTeX primitive \\ directlua?
Both are wrappers around the LuaTeX primitive \\directlua, which you should never need to use. In general, you will define a function inside a \\startluacode block, and then define a TeX command that calls the function using \\ctxlua, especially because \\ctxlua has a few idiosyncracies.
What kind of parser is used in LuaTeX?
LuaTeX includes a general parser based on PEG (parsing expression grammar) called lpeg, and it makes writing little parsers positively joyful. (Once you’ve got the knack of it, at least.)
Is the Lua code in a TeX document valid?
The main thing about Lua code in a TeX document is this: the code is expanded by TeX before Lua gets to it. This means that all the Lua code, even the comments, must be valid TeX! A string like “\ndefined” will cause an immediate failure. $2 + 5 eq \\ctxlua{ context ( 3+5)} $, but is equal to \\ctxlua{ context ( 2+5)} .
What’s the difference between regex and Lua pattern matching?
Instead of using regex, the Lua string library has a special set of characters used in syntax matches. Both can be very similar, but Lua pattern matching is more limited and has a different syntax.