<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.luatex.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Taco</id>
	<title>LuaTeXWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.luatex.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Taco"/>
	<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php/Special:Contributions/Taco"/>
	<updated>2026-05-03T01:05:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=User_talk:Taco&amp;diff=10138</id>
		<title>User talk:Taco</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=User_talk:Taco&amp;diff=10138"/>
		<updated>2023-02-14T13:06:04Z</updated>

		<summary type="html">&lt;p&gt;Taco: /* The Wiki has a lot of spam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The Wiki has a lot of spam ==&lt;br /&gt;
the Wiki has a lot of spam pages pealse clean it--[[User:Hubaishan|Hubaishan]] ([[User talk:Hubaishan|talk]]) 12:32, 14 February 2023 (CET)&lt;br /&gt;
* deleted lots of spam pages and users, thanks for pointing it out [[User:Taco|Taco]] ([[User talk:Taco|talk]]) 14:06, 14 February 2023 (CET)&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Token_filter&amp;diff=110</id>
		<title>Token filter</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Token_filter&amp;diff=110"/>
		<updated>2011-06-30T11:03:13Z</updated>

		<summary type="html">&lt;p&gt;Taco: with \XeTeXinterchartoks replacement example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Syntax =&lt;br /&gt;
&lt;br /&gt;
This [[Callbacks|callback]] is called whenever TeX needs a new token. No arguments are passed to the callback, and the return value should be either a Lua table representing a to|-|be|-|processed token, a table consisting of a list of such tokens, or&lt;br /&gt;
something else like \type{nil} or an empty table. Your lua function should therefore look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function()&lt;br /&gt;
    return &amp;lt;table&amp;gt; token&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Lua function does not return a table representing a valid token, it will be immediately called again, until it eventually does return a useful token or tokenlist (or until you reset the callback value to nil). If your function returns a single usable token, then that token will be processed by luatex immediately. If the function returns a token list (a table consisting of a list of consecutive token tables), then that list will be pushed to the input stack at a completely new token list level.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following examples aren&amp;#039;t mutually exclusive; however, if one wanted to register them all in the same callback, special care would be needed, as explained [[Callbacks#Several_functions_in_a_callback|in the main page on callbacks]]. Here each call to &amp;lt;tt&amp;gt;callback.register()&amp;lt;/tt&amp;gt; removes whatever there might have been in the callback beforehand.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== Faking \XeTeXinterchartoks ==&lt;br /&gt;
&lt;br /&gt;
Lua code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% luatexinterchartoks.lua&lt;br /&gt;
&lt;br /&gt;
charclasses = charclasses or {}&lt;br /&gt;
&lt;br /&gt;
function setcharclass (a,b)&lt;br /&gt;
   charclasses[a] = b&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local i = 0&lt;br /&gt;
while i &amp;lt; 65536 do&lt;br /&gt;
  charclasses[i]  = 0&lt;br /&gt;
  i = i + 1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
interchartoks =  interchartoks or {}&lt;br /&gt;
&lt;br /&gt;
function setinterchartoks (a,b,c)&lt;br /&gt;
   interchartoks[a] = interchartoks[a] or {}&lt;br /&gt;
   interchartoks[a][b] = c&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local nc, oc&lt;br /&gt;
oc = 255&lt;br /&gt;
&lt;br /&gt;
function do_intertoks () &lt;br /&gt;
  local tok = token.get_next() &lt;br /&gt;
  if tex.count[&amp;#039;XeTeXinterchartokenstate&amp;#039;] == 1 then&lt;br /&gt;
      if tok[1] == 11 or  tok[1] == 12 then&lt;br /&gt;
        nc = charclasses[tok[2]] &lt;br /&gt;
        newchar = tok[2]&lt;br /&gt;
      else &lt;br /&gt;
        nc = 255&lt;br /&gt;
        newchar = &amp;#039;&amp;#039;&lt;br /&gt;
      end&lt;br /&gt;
      local insert  = &amp;#039;&amp;#039;&lt;br /&gt;
      if interchartoks[oc] and interchartoks[oc][nc] then&lt;br /&gt;
          insert = interchartoks[oc][nc] &lt;br /&gt;
          local newtok = tok&lt;br /&gt;
          if insert&amp;lt;100 then&lt;br /&gt;
            local dec = math.floor(insert / 10) + 48;&lt;br /&gt;
            local unit = math.floor(insert % 10) + 48;&lt;br /&gt;
            newtok = {&lt;br /&gt;
              -- \XeTeXinterchartokenstate=0 \the\toks&amp;lt;n&amp;gt; \XeTeXinterchartokenstate=1&lt;br /&gt;
              token.create(&amp;#039;XeTeXinterchartokenstate&amp;#039;),&lt;br /&gt;
              token.create(string.byte(&amp;#039;=&amp;#039;),12),&lt;br /&gt;
              token.create(string.byte(&amp;#039;0&amp;#039;),12),&lt;br /&gt;
              token.create(string.byte(&amp;#039; &amp;#039;),10),&lt;br /&gt;
              token.create(&amp;#039;the&amp;#039;),&lt;br /&gt;
              token.create(&amp;#039;toks&amp;#039;),&lt;br /&gt;
              token.create(dec,12),&lt;br /&gt;
              token.create(unit,12),&lt;br /&gt;
              token.create(string.byte(&amp;#039; &amp;#039;),10),&lt;br /&gt;
              token.create(&amp;#039;XeTeXinterchartokenstate&amp;#039;),&lt;br /&gt;
              token.create(string.byte(&amp;#039;=&amp;#039;),12),&lt;br /&gt;
              token.create(string.byte(&amp;#039;1&amp;#039;),12),&lt;br /&gt;
              token.create(string.byte(&amp;#039; &amp;#039;),10),&lt;br /&gt;
              {tok[1], tok[2], tok[3]}}               &lt;br /&gt;
          end&lt;br /&gt;
          tok = newtok&lt;br /&gt;
      end&lt;br /&gt;
      oc = nc&lt;br /&gt;
  end&lt;br /&gt;
  return tok&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
callback.register (&amp;#039;token_filter&amp;#039;, do_intertoks)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LaTeX package file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% luatexinterchartoks.sty&lt;br /&gt;
\newcount\XeTeXinterchartokenstate&lt;br /&gt;
&lt;br /&gt;
\newcount\charclasses&lt;br /&gt;
\def\newXeTeXintercharclass#1%&lt;br /&gt;
  {\global\advance\charclasses1\relax&lt;br /&gt;
   \newcount#1&lt;br /&gt;
   \global#1=\the\charclasses&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
\newcount\cchone&lt;br /&gt;
\newcount\cchtwo&lt;br /&gt;
&lt;br /&gt;
\def\dodoXeTeXcharclass&lt;br /&gt;
    {\directlua{setcharclass(\the\cchone,\the\cchtwo)}}&lt;br /&gt;
&lt;br /&gt;
\def\doXeTeXcharclass%&lt;br /&gt;
   {\afterassignment\dodoXeTeXcharclass\cchtwo }&lt;br /&gt;
&lt;br /&gt;
\def\XeTeXcharclass%&lt;br /&gt;
   {\afterassignment\doXeTeXcharclass\cchone }&lt;br /&gt;
&lt;br /&gt;
\protected\def\XeTeXdointerchartoks%&lt;br /&gt;
   {\directlua{setinterchartoks(\the\cchone,\the\cchtwo,\the\allocationnumber)}}&lt;br /&gt;
&lt;br /&gt;
\protected\def\dodoXeTeXinterchartoks%&lt;br /&gt;
   {\newtoks\mytoks\afterassignment\XeTeXdointerchartoks\global\mytoks }&lt;br /&gt;
&lt;br /&gt;
\protected\def\doXeTeXinterchartoks%&lt;br /&gt;
   {\afterassignment\dodoXeTeXinterchartoks\cchtwo }&lt;br /&gt;
&lt;br /&gt;
\def\XeTeXinterchartoks%&lt;br /&gt;
   {\afterassignment\doXeTeXinterchartoks\cchone }&lt;br /&gt;
&lt;br /&gt;
\luatexdirectlua{require(&amp;#039;luatexinterchartoks.lua&amp;#039;)}&lt;br /&gt;
&lt;br /&gt;
\endinput&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test document:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\documentclass{article}&lt;br /&gt;
&lt;br /&gt;
\usepackage{luatexinterchartoks}&lt;br /&gt;
\usepackage{color}&lt;br /&gt;
&lt;br /&gt;
\begin{document}&lt;br /&gt;
&lt;br /&gt;
\newXeTeXintercharclass \mycharclassa&lt;br /&gt;
\newXeTeXintercharclass \mycharclassA&lt;br /&gt;
\newXeTeXintercharclass \mycharclassB&lt;br /&gt;
\XeTeXcharclass `\a \mycharclassa&lt;br /&gt;
\XeTeXcharclass `\A \mycharclassA&lt;br /&gt;
\XeTeXcharclass `\B \mycharclassB&lt;br /&gt;
% between &amp;quot;a&amp;quot; and &amp;quot;A&amp;quot;:&lt;br /&gt;
\XeTeXinterchartoks \mycharclassa \mycharclassA = {[\itshape}&lt;br /&gt;
\XeTeXinterchartoks \mycharclassA \mycharclassa = {\upshape]}&lt;br /&gt;
% between &amp;quot; &amp;quot; and &amp;quot;B&amp;quot;:&lt;br /&gt;
\XeTeXinterchartoks 255 \mycharclassB = {\bgroup\color{blue}}&lt;br /&gt;
\XeTeXinterchartoks \mycharclassB 255 = {\egroup}&lt;br /&gt;
% between &amp;quot;B&amp;quot; and &amp;quot;B&amp;quot;:&lt;br /&gt;
\XeTeXinterchartoks \mycharclassB \mycharclassB = {.}&lt;br /&gt;
&lt;br /&gt;
\begingroup&lt;br /&gt;
\XeTeXinterchartokenstate = 1&lt;br /&gt;
aAa A a B aBa BB&lt;br /&gt;
\endgroup&lt;br /&gt;
&lt;br /&gt;
\end{document}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Writing_Lua_in_TeX&amp;diff=58</id>
		<title>Writing Lua in TeX</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Writing_Lua_in_TeX&amp;diff=58"/>
		<updated>2010-12-28T09:04:24Z</updated>

		<summary type="html">&lt;p&gt;Taco: Reverted edits by 168.99.199.24 (talk) to last revision by Patrick&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Embedding Lua code in a TeX document =&lt;br /&gt;
&lt;br /&gt;
Although it is simpler to put Lua code in Lua files, from time to time one may want or need to go Lua in the middle of a document. To this end, LuaTeX has two commands: &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;\latelua&amp;lt;/tt&amp;gt;. They work the same, except &amp;lt;tt&amp;gt;\latelua&amp;lt;/tt&amp;gt; is processed when the page where it appears is shipped out, whereas &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; is processed at once; the distinction is immaterial here, and what is said of &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; also applies to &amp;lt;tt&amp;gt;\latelua&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; can be called in three ways:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\directlua {&amp;lt;lua code&amp;gt;}&lt;br /&gt;
\directlua name {&amp;lt;name&amp;gt;} {&amp;lt;lua code&amp;gt;}&lt;br /&gt;
\directlua &amp;lt;number&amp;gt; {&amp;lt;lua code&amp;gt;}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those three ways are equivalent when it comes to process &amp;lt;tt&amp;gt;&amp;lt;lua code&amp;gt;&amp;lt;/tt&amp;gt;, but in the second case processing will occur in a chunk named &amp;lt;tt&amp;gt;&amp;lt;name&amp;gt;&amp;lt;/tt&amp;gt;, and in the third it will occur in a chunk whose name is the entry &amp;lt;tt&amp;gt;&amp;lt;number&amp;gt;&amp;lt;/tt&amp;gt; in the table &amp;lt;tt&amp;gt;lua.name&amp;lt;/tt&amp;gt;. The difference manifests itself only when errors occur, in which case the name of the chunk, if any, is reported.&lt;br /&gt;
&lt;br /&gt;
Each call to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt;, named or not, is processed in a separate chunk. That means that any &amp;lt;tt&amp;gt;local&amp;lt;/tt&amp;gt; variable is defined for this call only and is lost afterward. Hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\directlua{&lt;br /&gt;
  one = 1&lt;br /&gt;
  local two = 2&lt;br /&gt;
}&lt;br /&gt;
\directlua{&lt;br /&gt;
  texio.write_nl(type(one))&lt;br /&gt;
  texio.write_nl(type(two))&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will report &amp;lt;tt&amp;gt;number&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;nil&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;texio.write_nl&amp;lt;/tt&amp;gt; writes to the log file). On the other hand, Lua code is completely insensitive to TeX&amp;#039;s grouping mechanism. In other words, calling &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; between &amp;lt;tt&amp;gt;\bgroup&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;\egroup&amp;lt;/tt&amp;gt; doesn&amp;#039;t affect the code to be processed.&lt;br /&gt;
&lt;br /&gt;
= TeX catcodes in Lua =&lt;br /&gt;
&lt;br /&gt;
By default, the code passed to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; is treated as normal TeX input and only then sent to the Lua interpreter. This may lead to unwanted results and must be acknowledged.&lt;br /&gt;
&lt;br /&gt;
== Expansion ==&lt;br /&gt;
&lt;br /&gt;
As with any other special, the code in &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; (and the &amp;lt;tt&amp;gt;&amp;lt;name&amp;gt;&amp;lt;/tt&amp;gt;, if specifed) is fully expanded. This means that macros can be safely passed to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; if one wants their values, but that they should also be properly escaped when needed. For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\def\macro{1}&lt;br /&gt;
\directlua{&lt;br /&gt;
  myvar = \macro&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
defines &amp;lt;tt&amp;gt;myvar&amp;lt;/tt&amp;gt; as the number &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;. To store the control sequence &amp;lt;tt&amp;gt;\macro&amp;lt;/tt&amp;gt; instead, another course of action is needed: see the [[#Backslash|section on backslash]] below.&lt;br /&gt;
&lt;br /&gt;
== Line ends ==&lt;br /&gt;
&lt;br /&gt;
When TeX reads a file, it normally turns line ends into spaces. That means that what looks like several lines is actually fed to the Lua interpreter as one big line. For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\directlua{&lt;br /&gt;
  myvar = 1&lt;br /&gt;
  anothervar = 2&lt;br /&gt;
  onelastvar = 3&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
amounts to the following, if it were written in a separate Lua file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myvar = 1 anothervar = 2 onelastvar = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is perfectly legitimate, but strange things might happen. First, TeX macros gobble spaces as usual. Hence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\def\macro{1}&lt;br /&gt;
\directlua{&lt;br /&gt;
  myvar = \macro&lt;br /&gt;
  anothervar = 2&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will be fed to the interpreter as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myvar = 1anothervar = 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which is not legitimate at all. Second, the Lua comment &amp;lt;tt&amp;gt;--&amp;lt;/tt&amp;gt; will affect everything to the end of the &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; call. That is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\directlua{&lt;br /&gt;
  myvar = 1&lt;br /&gt;
--  anothervar = 2&lt;br /&gt;
  onelastvar = 3&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will be processed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myvar = 1 -- anothervar = 2 onelastvar = 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which works but only defines &amp;lt;tt&amp;gt;myvar&amp;lt;/tt&amp;gt;. Third, when reporting error, the Lua interpreter will always mention the line number as 1, since it processes one big line only; that isn&amp;#039;t extremely useful when the code is large.&lt;br /&gt;
&lt;br /&gt;
The solution is to set &amp;lt;tt&amp;gt;\endlinechar=10&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;\catcode`\^^M=12&amp;lt;/tt&amp;gt;. In both cases, line ends will be preserved and the code will be processed as it is input.&lt;br /&gt;
&lt;br /&gt;
== Special characters ==&lt;br /&gt;
&lt;br /&gt;
In TeX, some characters have a special behavior. That must be taken into account when writing Lua code: one must change their catcodes beforehand if one wants to handle them as Lua would, as has just been done for line ends. That means that &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt;, as such, is clearly insufficient to write any extended chunk of code. It is thus better to devise a special macro that sets the catcodes to the appropriate values, reads the Lua code, feeds it to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt;, and restores the catcodes. The following code does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\def\luacode{%&lt;br /&gt;
  \bgroup&lt;br /&gt;
  \catcode`\{=12&lt;br /&gt;
  \catcode`\}=12&lt;br /&gt;
  \catcode`\^^M=12&lt;br /&gt;
  \catcode`\#=12&lt;br /&gt;
  \catcode`\~=12&lt;br /&gt;
  \catcode`\%=12&lt;br /&gt;
  \doluacode&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
\bgroup&lt;br /&gt;
\catcode`\^^M=12 %&lt;br /&gt;
\long\gdef\doluacode#1^^M#2\endluacode{\directlua{#2}\egroup}%&lt;br /&gt;
\egroup&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that not all special characters are set to normal (catcode 12) characters; that is explained for each below. Note also that &amp;lt;tt&amp;gt;\doluacode&amp;lt;/tt&amp;gt;, internally called by &amp;lt;tt&amp;gt;\luacode&amp;lt;/tt&amp;gt;, is defined to get rid of anything up to the line end, and then pass anything up to &amp;lt;tt&amp;gt;\endluacode&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt;. Discarding what follows &amp;lt;tt&amp;gt;\luacode&amp;lt;/tt&amp;gt; is important, otherwise a simple code as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\luacode&lt;br /&gt;
myvar = 1&lt;br /&gt;
\endluacode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would actually create two lines, the first being empty; it is annoying because errors are then reported with the wrong line number (i.e. any error in this one-line code would be reported to happen on line 2).&lt;br /&gt;
&lt;br /&gt;
However, the rest of the line after &amp;lt;tt&amp;gt;\luacode&amp;lt;/tt&amp;gt; could also be processed, instead of discarded, to manage special effects (e.g. specifying a chunk&amp;#039;s name, storing the code in a control sequence, or even setting which catcodes should be changed or not).&lt;br /&gt;
&lt;br /&gt;
=== Backslash ===&lt;br /&gt;
&lt;br /&gt;
The backslash in TeX is used to form control sequences. In the definition of &amp;lt;tt&amp;gt;\luacode&amp;lt;/tt&amp;gt; above, it isn&amp;#039;t changed and thus behaves as usual. It allows commands to be passed and expanded to the Lua code. Anyway a backslash in Lua is also an escape character in strings. Hence, if one wants to store the name of a macro in Lua code, the following won&amp;#039;t work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\luacode&lt;br /&gt;
myvar = &amp;quot;\noexpand\macro&amp;quot;&lt;br /&gt;
\endluacode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
because to the Lua interpreter the string is made of &amp;lt;tt&amp;gt;\m&amp;lt;/tt&amp;gt; followed by &amp;lt;tt&amp;gt;acro&amp;lt;/tt&amp;gt;; since &amp;lt;tt&amp;gt;\m&amp;lt;/tt&amp;gt; is not defined in Lua, the string is read as &amp;lt;tt&amp;gt;macro&amp;lt;/tt&amp;gt;, but in other circumstances strange things might happen: for instance, &amp;lt;tt&amp;gt;\n&amp;lt;/tt&amp;gt; is a newline. The proper way to pass a macro verbatim is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\luacode&lt;br /&gt;
myvar = &amp;quot;\noexpand\\macro&amp;quot;&lt;br /&gt;
\endluacode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which Lua will correctly read as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myvar = &amp;quot;\\macro&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the backslash escaped to represent itself. Another solution is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myvar = [[\noexpand\macro]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
because the double brackets signals a string in Lua where no escape sequence occurs (and the string can also run on several lines). Note however that in the second case &amp;lt;tt&amp;gt;myvar&amp;lt;/tt&amp;gt; will be defined with a trailing space, i.e. as &amp;lt;tt&amp;gt;&amp;quot;\macro &amp;quot;&amp;lt;/tt&amp;gt;, because of TeX&amp;#039;s habit to append a trailing space to unexpanded (or unexpandable) control sequences.&lt;br /&gt;
&lt;br /&gt;
=== Braces ===&lt;br /&gt;
&lt;br /&gt;
One may want to define a string in Lua which contains unbalanced braces, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\luacode&lt;br /&gt;
myvar = &amp;quot;{&amp;quot;&lt;br /&gt;
\endluacode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the braces&amp;#039; catcodes hadn&amp;#039;t been changed beforehand, that would be impossible. Note, however, that this means that one can&amp;#039;t feed arguments to commands in the usual way. I.e. the following will produce nothing good:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\luacode&lt;br /&gt;
myvar = &amp;quot;\dosomething{\macro}&amp;quot;&lt;br /&gt;
\endluacode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;\dosomething&amp;lt;/tt&amp;gt; will be expanded with the left brace (devoid of its usual delimiter-ness) as its argument, and the rest of the line might produce chaos. Thus, one may also choose not to change the catcodes of braces, depending on how &amp;lt;tt&amp;gt;\luacode&amp;lt;/tt&amp;gt; is most likely to be used. Note that strings with unbalanced braces can still be defined, even if braces have their usual catcodes, thanks to the following trick:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\luacode&lt;br /&gt;
myvar = &amp;quot;{&amp;quot; -- }&lt;br /&gt;
\endluacode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the code is passed to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt;, braces are balanced because the Lua comment means nothing to TeX; when passed to the Lua interpreter, on the other hand, the right brace is ignored.&lt;br /&gt;
&lt;br /&gt;
=== Hash and comment ===&lt;br /&gt;
&lt;br /&gt;
The hash sign &amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt; in Lua is the length operator: prefixed to a string or table variable, it returns its length. If its catcode weren&amp;#039;t taken care of, LuaTeX would pass to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; a double hash for each hash, i.e. each &amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt; would be turned into &amp;lt;tt&amp;gt;##&amp;lt;/tt&amp;gt;. That is normal TeX behavior, but unwanted here.&lt;br /&gt;
&lt;br /&gt;
As for the commen sign &amp;lt;tt&amp;gt;%&amp;lt;/tt&amp;gt;, it is useful in Lua when manipulating strings. If it weren&amp;#039;t escaped it would discard parts of the code when TeX reads it, and a mutilated version of the input would be passed to the Lua interpreter. In turn, discarding a line by commenting it in &amp;lt;tt&amp;gt;\luacode&amp;lt;/tt&amp;gt; should be done with the Lua comment &amp;lt;tt&amp;gt;--&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Active characters ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;~&amp;lt;/tt&amp;gt; character is generally active and used as a no-break space in TeX. It it were passed as is to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt;, it would expand to uninterpretable control sequences, whereas in Lua it is used to form the unequal operator &amp;lt;tt&amp;gt;~=&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other possible active characters should be taken care of, but which characters are active is unpredictable; punctuation marks might be so to accommodate special spacing, as with LaTeX&amp;#039;s &amp;#039;&amp;#039;babel&amp;#039;&amp;#039; package, but such tricks are unlikely to survive in LuaTeX (cleaner methods exist that add a space before punctuation marks when necessary).&lt;br /&gt;
&lt;br /&gt;
=== Other characters ===&lt;br /&gt;
&lt;br /&gt;
When processing verbatim text in TeX, one generally also changes the catcodes of &amp;lt;tt&amp;gt;$&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;amp;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;^&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;_&amp;lt;/tt&amp;gt; and the space character, because they too are special. When passed to the Lua interpreter, though, their usual catcodes won&amp;#039;t do any harm, that is why they are left unmodified here.&lt;br /&gt;
&lt;br /&gt;
== \luaescapestring ==&lt;br /&gt;
&lt;br /&gt;
Although it can&amp;#039;t do all of what&amp;#039;s been explained, the &amp;lt;tt&amp;gt;\luaescapestring&amp;lt;/tt&amp;gt; command might be useful in some cases: it expands its argument (which must be enclosed in &amp;#039;&amp;#039;real&amp;#039;&amp;#039; braces) fully, then modify it so that dangerous characters are escaped: backslashes, hashes, quotes and line ends. For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\def\macro{&amp;quot;\noexpand\foo&amp;quot;}&lt;br /&gt;
\luacode&lt;br /&gt;
myvar = &amp;quot;\luaescapestring{\macro}&amp;quot;&lt;br /&gt;
\endluacode&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will be passed to Lua as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myvar = &amp;quot;\&amp;quot;\\foo \&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that &amp;lt;tt&amp;gt;myvar&amp;lt;/tt&amp;gt; is defined as &amp;lt;tt&amp;gt;&amp;quot;\foo &amp;quot;&amp;lt;/tt&amp;gt;, with the quotes as parts of it. Note that the trailing space after &amp;lt;tt&amp;gt;\foo&amp;lt;/tt&amp;gt; still happens.&lt;br /&gt;
&lt;br /&gt;
= From Lua to TeX =&lt;br /&gt;
&lt;br /&gt;
Inside Lua code, one can pass strings to be processed by TeX with the functions &amp;lt;tt&amp;gt;tex.print()&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;tex.sprint()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tex.tprint()&amp;lt;/tt&amp;gt;. All such calls are processed at the end of a &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; call, even though they might happen in the middle of the code. This behavior is worth noting because it might be surprising in some cases, although it is generally harmless.&lt;br /&gt;
&lt;br /&gt;
== tex.print() ==&lt;br /&gt;
&lt;br /&gt;
This function receives as its argument(s) either one or more strings or an array of strings. Each string is processed as an input line: an end-of-line character is appended (except to the last string), and TeX is in state &amp;lt;tt&amp;gt;newline&amp;lt;/tt&amp;gt; when processing it (i.e. leading spaces are skipped). Hence the two equivalent calls:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tex.print(&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;)&lt;br /&gt;
tex.print({&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
are both interpreted by TeX as would the following two lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a&lt;br /&gt;
b&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus `a b&amp;#039; is produced, since line ends normally produce a space.&lt;br /&gt;
&lt;br /&gt;
The function can also take an optional number as its first argument; it is interpreted as referring to a catcode table (as defined by &amp;lt;tt&amp;gt;\initcatcodetable&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;\savecatcodetable&amp;lt;/tt&amp;gt;), and each line is processed by TeX with that catcode regime. For instance (note that with such a minimal catcode table, braces don&amp;#039;t even have their usual values):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\bgroup&lt;br /&gt;
\initcatcodetable1&lt;br /&gt;
\catcode`\_=0&lt;br /&gt;
\savecatcodetable1&lt;br /&gt;
\egroup&lt;br /&gt;
&lt;br /&gt;
\directlua{tex.print(1, &amp;quot;_TeX&amp;quot;)}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string will be read with &amp;lt;tt&amp;gt;_&amp;lt;/tt&amp;gt; as an escape character, and thus interpreted as the command commonly known as &amp;lt;tt&amp;gt;\TeX&amp;lt;/tt&amp;gt;. The catcode regime holds only for the strings passed to &amp;lt;tt&amp;gt;tex.print()&amp;lt;/tt&amp;gt; and the rest of the document isn&amp;#039;t affected.&lt;br /&gt;
&lt;br /&gt;
If the optional number is &amp;lt;tt&amp;gt;-1&amp;lt;/tt&amp;gt;, or points to an invalid (i.e. undefined) catcode table, then the strings are processed with the current catcodes, as if there was no optional argument. If it is &amp;lt;tt&amp;gt;-2&amp;lt;/tt&amp;gt;, then the strings are read as if the result of &amp;lt;tt&amp;gt;\detokenize&amp;lt;/tt&amp;gt;: all characters have catcode 12 (i.e. `other&amp;#039;, characters that have no function beside representing themselves), except space, which has catcode 10 (as usual).&lt;br /&gt;
&lt;br /&gt;
== tex.sprint() ==&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;tt&amp;gt;tex.print()&amp;lt;/tt&amp;gt;, this function can receive either one or more strings or an array of strings, with an optional number as its first argument pointing to a catcode table. Unlike &amp;lt;tt&amp;gt;tex.print()&amp;lt;/tt&amp;gt;, however, each string is processed as if TeX were in the middle of a line and not at the beginning of a new one: spaces aren&amp;#039;t skipped, no end-of-line character is added and trailing spaces aren&amp;#039;t ignored. Thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tex.sprint(&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is interpreted by TeX as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
without any space inbetween.&lt;br /&gt;
&lt;br /&gt;
== tex.tprint() ==&lt;br /&gt;
&lt;br /&gt;
This function takes an unlimited number of tables as its arguments; each table must be an array of strings, with the first entry optionally being a number pointing to a catcode table. Then each table is processed as if passed to &amp;lt;tt&amp;gt;tex.sprint()&amp;lt;/tt&amp;gt;. Thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tex.tprint({1, &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;}, {&amp;quot;c&amp;quot;, &amp;quot;d&amp;quot;})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is equivalent to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tex.sprint(1, &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;)&lt;br /&gt;
tex.sprint(&amp;quot;c&amp;quot;, &amp;quot;d&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= The expansion of \directlua =&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; is fully expandable; i.e. it can be used in contexts where full expansion is required, as in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\csname\directlua{tex.print(&amp;quot;TeX&amp;quot;)}\endcsname&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which is a somewhat convoluted way of saying &amp;lt;tt&amp;gt;\TeX&amp;lt;/tt&amp;gt;. Besides, since Lua code is processed at once, things that were previously unthinkable can now be done easily. For instance, it is impossible to perform an assignment in an &amp;lt;tt&amp;gt;\edef&amp;lt;/tt&amp;gt; by TeX&amp;#039;s traditional means. I.e. the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\edef\macro{\count1=5}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
defines &amp;lt;tt&amp;gt;\macro&amp;lt;/tt&amp;gt; as &amp;lt;tt&amp;gt;\count1=5&amp;lt;/tt&amp;gt; but doesn&amp;#039;t perform the assignment (the &amp;lt;tt&amp;gt;\edef&amp;lt;/tt&amp;gt; does nothing more than a simple &amp;lt;tt&amp;gt;\def&amp;lt;/tt&amp;gt;). After the definition, the value of &amp;lt;tt&amp;gt;\count1&amp;lt;/tt&amp;gt; hasn&amp;#039;t changed. The same is not true, though, if such an assigment is made with Lua code. The following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\edef\macro{\directlua{tex.count[1] = 5}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
defines &amp;lt;tt&amp;gt;\macro&amp;lt;/tt&amp;gt; emptily (since nothing remains after &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; has been processed) &amp;#039;&amp;#039;and&amp;#039;&amp;#039; sets count 1 to 5. Since such a behavior is totally unexpected in normal TeX, one should be wary when using &amp;lt;tt&amp;gt;\directlua&amp;lt;/tt&amp;gt; in such contexts.&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Traversing_TeX_nodes&amp;diff=56</id>
		<title>Traversing TeX nodes</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Traversing_TeX_nodes&amp;diff=56"/>
		<updated>2010-12-28T08:12:31Z</updated>

		<summary type="html">&lt;p&gt;Taco: Reverted edits by 193.212.103.173 (talk) to last revision by Patrick&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Traversing TeX nodes ==&lt;br /&gt;
&lt;br /&gt;
Put this code at the beginning of any TeX file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\directlua{&lt;br /&gt;
 local glyph = node.id(&amp;#039;glyph&amp;#039;)&lt;br /&gt;
 local hlist = node.id(&amp;#039;hlist&amp;#039;)&lt;br /&gt;
 local vlist = node.id(&amp;#039;vlist&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
 function gothru(h,prof)&lt;br /&gt;
   for t in node.traverse(h) do&lt;br /&gt;
     texio.write_nl(string.rep(&amp;quot;...&amp;quot;,prof) .. &amp;#039;NODE type=&amp;#039; ..  node.type(t.id) .. &amp;#039; subtype=&amp;#039; .. t.subtype )&lt;br /&gt;
     if t.id == hlist or t.id == vlist then&lt;br /&gt;
       texio.write(&amp;#039; w=&amp;#039; .. t.width .. &amp;#039; h=&amp;#039; .. t.height .. &amp;#039; d=&amp;#039; .. t.depth .. &amp;#039; s=&amp;#039; .. t.shift )&lt;br /&gt;
	   gothru(t.list,prof+1)&lt;br /&gt;
     end&lt;br /&gt;
     if t.id == glyph then&lt;br /&gt;
       texio.write(&amp;#039; font=&amp;#039; .. t.font .. &amp;#039; char=&amp;#039; .. t.char .. &amp;#039; width=&amp;#039; ..  font.fonts[t.font].characters[t.char][&amp;#039;width&amp;#039;])&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 callback.register(&amp;#039;pre_linebreak_filter&amp;#039;,&lt;br /&gt;
   function(h)&lt;br /&gt;
      gothru(h,0) &lt;br /&gt;
      return true &lt;br /&gt;
   end&lt;br /&gt;
   )&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will display a list of all nodes on the terminal and in the log file. For example, for the document&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\font\x=omlgc&lt;br /&gt;
\x bl? bla bla bla&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which contains a Greek letter (in UTF-8), you will get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
This is luaTeX, Version 3.141592-snapshot-2007062922 (Web2C 7.5.6)&lt;br /&gt;
(&lt;br /&gt;
NODE type=whatsit subtype=6&lt;br /&gt;
NODE type=hlist subtype=0&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=98&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=108&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=941&lt;br /&gt;
NODE type=glue subtype=0&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=98&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=108&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=97&lt;br /&gt;
NODE type=glue subtype=0&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=98&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=108&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=97&lt;br /&gt;
NODE type=glue subtype=0&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=98&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=108&lt;br /&gt;
NODE type=glyph subtype=0 font=51 char=97&lt;br /&gt;
NODE type=glue subtype=0&lt;br /&gt;
Underfull \hbox (badness 10000) in paragraph at lines 14--15&lt;br /&gt;
&lt;br /&gt;
[1] )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be aware of the fact that the nodes will be created only if the glyph requested indeed exists in the font.&lt;br /&gt;
&lt;br /&gt;
[[User:Yannis.Haralambous|Yannis.Haralambous]] 02:52, 4 July 2007 (EDT)&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=53</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=53"/>
		<updated>2010-12-28T00:04:18Z</updated>

		<summary type="html">&lt;p&gt;Taco: Reverted edits by 62.90.255.28 (talk) to last revision by Patrick&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to the LuaTeX wiki ==&lt;br /&gt;
&lt;br /&gt;
This is a wiki for [http://www.luatex.org LuaTeX], a typesetting engine derived from &lt;br /&gt;
[http://en.wikipedia.org/wiki/TeX TeX] that includes [http://www.lua.org Lua] as an embedded scripting language.&lt;br /&gt;
&lt;br /&gt;
We are [[Special:Recentchanges|currently editing]] [[Special:Allpages|{{NUMBEROFARTICLES}}]] articles.&lt;br /&gt;
&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Help:Formatting How to edit wiki pages]&lt;br /&gt;
* [[Bug tracking|Bug tracking]]: Mantis [http://tracker.luatex.org bug tracker]&lt;br /&gt;
&lt;br /&gt;
== Getting help ==&lt;br /&gt;
&lt;br /&gt;
* There are two mailing lists related to LuaTeX, [http://tug.org/mailman/listinfo/luatex one for general discussions and questions about LuaTeX (&amp;quot;luatex users&amp;quot;)] and [http://www.ntg.nl/mailman/listinfo/dev-luatex one more related to the development of LuaTeX (&amp;quot;dev-luatex&amp;quot;)]&lt;br /&gt;
* There is also [http://www.tug.org/mailman/listinfo/lualatex-dev a LuaLaTeX (LaTeX with LuaTeX) mailing list].&lt;br /&gt;
* [http://tex.stackexchange.com/ tex.stackexchange.com] is a q&amp;amp;a site for questions related to TeX, and you can ask (and answer) LuaTeX related questions there.&lt;br /&gt;
* The [http://www.luatex.org/svn/trunk/manual/luatexref-t.pdf online reference manual (pdf)] describes every aspect of LuaTeX, but is rather technical and concise.&lt;br /&gt;
&lt;br /&gt;
== Some topics from the old wiki at bluwiki.com ==&lt;br /&gt;
&lt;br /&gt;
(Thanks to [http://omega.enstb.org/yannis/ Yannis Haralambous])&lt;br /&gt;
&lt;br /&gt;
* An example of code [[traversing TeX nodes]] before an horizontal list goes through the line breaking engine;&lt;br /&gt;
* An example of code [[traversing tokens]] just before execution or expansion;&lt;br /&gt;
* you want to [[explore the table obtained from a TrueType font]], loaded by &amp;lt;tt&amp;gt;font.read_ttf&amp;lt;/tt&amp;gt;;&lt;br /&gt;
* you want to [[explore the internal font table]] of a pre-loaded font or of a font you have loaded by &amp;lt;tt&amp;gt;\font&amp;lt;/tt&amp;gt; and then used for at least one glyph;&lt;br /&gt;
* how to [[use a TrueType font]] without going through a TFM or a OFM file;&lt;br /&gt;
* how to do &amp;lt;i&amp;gt;kinsoku&amp;lt;/i&amp;gt; ([[Japanese and more generally CJK typesetting]]);&lt;br /&gt;
* you want a newline in your log file or on the terminal? add &amp;lt;tt&amp;gt;\string\n&amp;lt;/tt&amp;gt; to your string;&lt;br /&gt;
* you want to [[sort a token list]];&lt;br /&gt;
* you want to [[split a comma-separated list]];&lt;br /&gt;
* you want to [[encrypt your document using ROT13]];&lt;br /&gt;
* you want to [[typeset non-TeX files by converting them using Lua code]];&lt;br /&gt;
* example code to [[mirror characters with Bidi_Mirrored property]];&lt;br /&gt;
* using mplib to write [[metapost with LuaTeX]]&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=7</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=7"/>
		<updated>2010-12-05T12:35:16Z</updated>

		<summary type="html">&lt;p&gt;Taco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to the LuaTeX wiki ==&lt;br /&gt;
&lt;br /&gt;
This is a wiki for [http://www.luatex.org LuaTeX], a typesetting engine derived from &lt;br /&gt;
[http://en.wikipedia.org/wiki/TeX TeX] that includes [http://www.lua.org Lua] as an embedded scripting language.&lt;br /&gt;
&lt;br /&gt;
We are [[Special:Recentchanges|currently editing]] [[Special:Allpages|{{NUMBEROFARTICLES}}]] articles.&lt;br /&gt;
&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Help:Formatting How to edit wiki pages]&lt;br /&gt;
* [[Mailing Lists|Mailing List]]: List archives at [http://www.tug.org/pipermail/luatex/ mailman interface]&lt;br /&gt;
* [[Bug tracking|Bug tracking]]: Mantis [http://tracker.luatex.org bug tracker]&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=6</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=6"/>
		<updated>2010-12-05T12:25:33Z</updated>

		<summary type="html">&lt;p&gt;Taco: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a wiki for [http://www.luatex.org LuaTeX], a typesetting engine derived from &lt;br /&gt;
[http://en.wikipedia.org/wiki/TeX TeX] that includes [http://www.lua.org Lua] as an embedded scripting language.&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=5</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=5"/>
		<updated>2010-12-05T12:21:08Z</updated>

		<summary type="html">&lt;p&gt;Taco: /* Welcome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This wiki is for [http://www.luatex.org LuaTeX], a typesetting engine derived from [http://www.tug.org TeX] that is using [http://www.lua.org Lua] as an embedded scripting language.&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=4</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.luatex.org/index.php?title=Main_Page&amp;diff=4"/>
		<updated>2010-12-05T12:20:57Z</updated>

		<summary type="html">&lt;p&gt;Taco: /* Welcome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Welcome =&lt;br /&gt;
&lt;br /&gt;
This wiki is for [http://www.luatex.org LuaTeX], a typesetting engine derived from [http://www.tug.org TeX] that is using [http://www.lua.org Lua] as an embedded scripting language.&lt;/div&gt;</summary>
		<author><name>Taco</name></author>
		
	</entry>
</feed>