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
296 Unicode math
XXXIII User code Previous versions of LuaTEX had multiple Lua instances but in practice this was not that useful and therefore we decided to remove that feature and stick to one instance. One reason is that all activities take place in the zero instance anyway and other instance could not access variables dened there. Another reason was that every \directlua call is in fact a function call (and as such a closure) and LuaTEX catches errors nicely. The formal \directlua primitive originally can be called in two ways: \directlua {lua code} \directlua name {some text} {lua code} The optional text is then part of the error message when one is issued. The new approach is that the number is used for the error message in case no name is specied. The exact string is set in Lua. This means that in principle the command is backward compatible. Old usage will basically ignore the number and use the one and only instance, while new usage will use the number for an eventual message: \directlua {lua code} \directlua name {some text} {lua code} In the second case the id is ignored. The advantage of the rst call is that it saves tokens at the TEX end and can be congured at the Lua end. In ConTEXt MkIV we have adapted the code that invokes multiple instances by compatible code that provides a modest form of isolation. We don't want to enforce too many constraints, rst of all because users will often use high level interfaces anyway, and also because we assume that users have no bad intentions. The main Lua instance in ConTEXt is accessible by: \startluacode tex.print("lua") \stopluacode This gives: ‘lua’. However, sometimes you don't want user code to interfere too much with the main code but still provide access to useful data. This is why we also provide: \startusercode global.tex.print("user 1") tex.print("user 2") if characters then User code 297
- Page 248 and 249: table can contain information about
- Page 250 and 251: The ConTEXt cross reference mechani
- Page 252 and 253: of them. Each lookup has a detailed
- Page 254 and 255: otf.replacements otf.sequences otf.
- Page 256 and 257: features: analyze=yes, calt=yes, cc
- Page 258 and 259: feature mark, lookup ml_arab_l_16_s
- Page 260 and 261: للِ ه ِ feature init, lo
- Page 262 and 263: features: analyze=yes, calt=yes, cc
- Page 264 and 265: esult: 1: [+TRT] U+6DD: [-TRT]
- Page 266 and 267: 2: [+TRT] U+F01DD: [-TRT] The
- Page 268 and 269: Pro. Dr. Donld E. Knuth feature cal
- Page 270 and 271: 268 Tracking
- Page 272 and 273: The order in which this happens now
- Page 274 and 275: normalizers characters words fonts
- Page 276 and 277: local function hyphenation(head,tai
- Page 278 and 279: 276 The order of things
- Page 280 and 281: of LuaTEX Taco and I worked in para
- Page 282 and 283: Next we see (scaled) Latin Modern:
- Page 284 and 285: As you can see, it is possible to a
- Page 286 and 287: next: U+FF008 { => U+FF06E { => U+F
- Page 288 and 289: end } commands = { { "slot", 1, bas
- Page 290 and 291: (a,b) = (1.20,3.40) So we don't nee
- Page 292 and 293: } description = "SOLIDUS", directio
- Page 294 and 295: ⎧ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎩
- Page 296 and 297: 840 italic 60 top_accent (0,1020) f
- Page 300 and 301: tex.print("access") else tex.print(
- Page 302 and 303: 300 User code
- Page 304 and 305: namespace with code not coming from
- Page 306 and 307: • The code denes a few global tab
- Page 308 and 309: ut this now refers to an index in a
- Page 310 and 311: On the agenda is xing some ‘hyphe
- Page 312 and 313: We also use the opportunity to slow
- Page 314 and 315: Math. Because the TEX Gyre math pro
- Page 316 and 317: Tracing on Taco's machine has shown
- Page 318 and 319: node list callback tasks - 4 unique
- Page 320 and 321: pdftex 1.28 (23) 2.07 (144) 6.96 (2
- Page 322 and 323: July 19, 2009 - The number of files
- Page 324 and 325: July 19, 2009 - The relative number
XXXIII User code<br />
Previous versions <strong>of</strong> LuaTEX had multiple Lua instances but in practice this was not that<br />
useful and therefore we decided to remove that feature and stick to one instance. One<br />
reason is that all activities take place in the zero instance anyway and other instance could<br />
not access variables dened there. Another reason was that every \directlua call is in<br />
fact a function call (and as such a closure) and LuaTEX catches errors nicely.<br />
<strong>The</strong> formal \directlua primitive originally can be called in two ways:<br />
\directlua {lua code}<br />
\directlua name {some text} {lua code}<br />
<strong>The</strong> optional text is then part <strong>of</strong> the error message when one is issued. <strong>The</strong> new approach<br />
is that the number is used for the error message in case no name is specied. <strong>The</strong> exact<br />
string is set in Lua. This means that in principle the command is backward compatible.<br />
Old usage will basically ignore the number and use the one and only instance, while new<br />
usage will use the number for an eventual message:<br />
\directlua {lua code}<br />
\directlua name {some text} {lua code}<br />
In the second case the id is ignored. <strong>The</strong> advantage <strong>of</strong> the rst call is that it saves tokens at<br />
the TEX end and can be congured at the Lua end. In ConTEXt MkIV we have adapted the<br />
code that invokes multiple instances by compatible code that provides a modest form<br />
<strong>of</strong> isolation. We don't want to enforce too many constraints, rst <strong>of</strong> all because users will<br />
<strong>of</strong>ten use high level interfaces anyway, and also because we assume that users have no<br />
bad intentions.<br />
<strong>The</strong> main Lua instance in ConTEXt is accessible by:<br />
\startluacode<br />
tex.print("lua")<br />
\stopluacode<br />
This gives: ‘lua’.<br />
However, sometimes you don't want user code to interfere too much with the main code<br />
but still provide access to useful data. This is why we also provide:<br />
\startusercode<br />
global.tex.print("user 1")<br />
tex.print("user 2")<br />
if characters then<br />
User code 297