Zadání soutěže: http://katedry.osu.cz/kma/TeXperience2012/?q=node/2 LUATEX News since 0.40.0LUATEX intro general fonts TEX lua finally bonus What is LuaTEX • LuaTEX combines pdfTEX with the Lua script interpreter, Aleph's direction model, and font loading code from Fontforge • Input and output are Unicode enabled. • The use of OpenType (system) fonts is possible. • LuaTEX comes with a number of Lua utility libraries built in. • Additional engine extensions are present: − Attribute registers; − Category code tables; − OpenType math engine; − Hyphenation separated from font encoding. • LuaTEX is on TEX Live since 2008. • Work in progress, version 1.0 is expected in 2012.LUATEX intro general fonts TEX lua finally bonus Lua scripting • The core scripting command is \directlua. • The \directlua argument is expanded immediately, then passed on to the Lua interpreter. • \latelua postpones expansion and Lua interpretation until the output routine. • Via ‘callbacks', Lua code can intercept (and sometimes replace) internal LuaTEX code. • Lua code can access LuaTEX internals and feed back information to the typesetting engine.LUATEX intro general fonts TEX lua finally bonus Lua scripting example Source: The value of $\pi/2 = \directlua{tex.print(math.pi/2)}$, and this is \directlua{ if \the\pageno==4 then tex.print('page four') else tex.print('not page four') end}. Result: The value of π/2 = 1.5707963267949, and this is page four.LUATEX intro general fonts TEX lua finally bonus Lua libraries slnunicode For dealing with Unicode strings lpeg Parsing expression grammars luasocket Network interface luazip Zip file reading lfs File system interface callback Set up callback functions fontloader For loading OpenType fonts mplib Metapost graphics creation kpse Kpathsea file searching tex Introspective into the typesetting engine font Internal font interface node Manipulation of data structures token Manipulation of token lists pdf Interface to the backend PDF generationLUATEX intro general fonts TEX lua finally bonus General changes since TEX Live 2009 • Many of the source files have been converted to CWEB. • There is a source revision number in the banner. • The horizontal nodes that are added during line breaking now inherit the attributes from the nodes inside the created line. • All lua errors now report file and line numbers to aid in debugging. • LuaTEX can use kpathsea to find lua require() files.LUATEX intro general fonts TEX lua finally bonus Libraries and other third-party inclusions • Mplib is updated to version 1.211. • Libpng is now at version 1.2.40. • New synctex code is imported from TEXLive. • The lua file from the luamd5 library (which provides the md5.hexsuma function) is now embedded in the executable. • LuaTEX now has support for dynamic loading of external precompiled lua libraries. • The backend messages that complain about unfound files now report the name of the file LuaTEX was searching for.LUATEX intro general fonts TEX lua finally bonus Font related changes • It is no longer possible for fonts from included PDF files to be replaced by / merged with the document fonts of the enveloping PDF. • Support for Type3 .pgc files has been removed. • It is now possible to use Apple .dfont font files. • Some variables are added to the font table to allow proper setting of the size parameters for LuaTEX's ...withdelims math primitives. • Artificial slanting or extending now also works for non-Type1 fonts.LUATEX intro general fonts TEX lua finally bonus ‘TEX’-side extensions and changes • \input and \openin now accept braced file names. • The new primitives \aligntab and \alignmark are aliases for the use of & and # in alignments. • Similarly, \Usuperscript, \Usubscript, \Ustartmath, and \Udisplaymath can replace ^, _, $ and $$. • \latelua is now allowed inside leaders. • The new primitive \gleaders provides ‘globally aligned' leaders. • From now on LuaTEX handles only 4 direction specifiers: TLT (latin), TRT (arabic), RTT (cjk), and LTL (mongolian). • The \pdfcompresslevel is now effectively fixed as soon as output to the PDF file has occurred. • \pdfobj has gained an extra optional keyword: uncompressed. This forces the object to be written to the PDF in plain text.LUATEX intro general fonts TEX lua finally bonus Lua table extensions • There is a new callback: process_output_buffer, for post-processing of \write text to a file. • lfs.readlink("file") returns the content of a symbolic link (unix only). • lfs.shortname("file") returns the short (FAT) name of a file (windows only). • kpse.version() returns the kpathsea version string. • kpse.lookup({...}) offers a search interface similar to the kpsewhich program. • node.vpack(n) packs a list into a vlist node, like \vbox. • node.dimensions(n) returns the natural dimensions of a node list. • hlist nodes now have a subtype to distinguish between hlists generated by the paragraph breaking, explicit \hbox commands, and other sources.LUATEX intro general fonts TEX lua finally bonus Lua table extensions (cont.) • pdf.registerannot() reserves a PDF object number. • pdf.obj(...), pdf.immediateobj(...), and pdf.reserveobj(...) are similar to the corresponding pdfTEX primitives. • There are new Lua variables to control e.g. the PDF catalog. • tex.badness(f,s) interfaces to the ‘badness' internal function. • tex.linebreak(n, {...}) allows running the paragraph breaker from pure lua. • tex.sp("1in") converts lua-style string units to scaled points. • tex.shipout(n) ships out a constructed box. • tex.nest[] and tex.nestptr together allow read-write access to the semantic nest (mode nesting).LUATEX intro general fonts TEX lua finally bonus Finally • Of course the manual has been updated as well :) • The LuaTEX website is http://www.luatex.org • LuaTEX 0.60.2 is on TEXLive 2010.LUATEX intro general fonts TEX lua finally bonus Bonus slide: LuaTEX 0.64 • Lua assignments to internal glue parameters are now allowed. • Mplib version 1.503 is included. • New lua library epdf for introspection of PDF inclusions. • Input-ed lua files are now mentioned in the --recorder output. • LuaTEX now uses Poppler instead of xpdf. • There is now a LuaTEX ‘short reference'. • New lua subtables for setting category codes et cetera. • CIDset tables are added to the output PDF. • OCP support has been dropped. • LuaTEX 0.64.0 is on TLContrib.          LuaTEX 0.60 an overview of changes since 0.40 General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         General changes  Many of the source Vles have been converted to CWEB.  There are now revision numbers in the banner again.  The horizontal nodes that are added during line breaking now inherit the attributes from the nodes inside the created line.  All lua errors now report Vle and line numbers to aid in debugging.  LuaTEX can now optionally use kpathsea to Vnd lua require() Vles.  The print precision for small numbers in lua code ‘tostring()’ has been improved.  Lots of code cleanups. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Embedded libraries and other third-party inclusions  MetaPost is now at version 1.211.  Libpng is now at version 1.2.40.  New synctex code is imported from TEXLive.  The lua Vle from the luamd5 library (which provides the md5.hexsuma function) is now embedded in the executable.  The lua co-routine patch (coco) is now disabled on linux powerpc (because it caused crashes).  LuaTEX now has support for dynamic loading of external compiled lua libraries. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Font related  The backend message cannot open Type 1 font file for reading now reports the name of the Type1 font Vle it was looking for.  It is no longer possible for fonts from included PDF Vles to be replaced by / merged with the document fonts of the enveloping PDF.  Support for Type3 .pgc Vles has been removed.  For ttc fonts, now the used subfont name and its index id are printed to the terminal, and if the backend cannot Vnd a ttc subfont, the run is aborted.  It is now possible to use Apple .dfont font Vles.  The loading speed of large fonts via the fontloader library, and the inclusion speed for sub-setting in the backend have both been improved. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Font related (cont.)  The variables .Mathconstants.FractionDelimiterSize and .Mathconstants.FractionDelimiterDisplayStyleSize are added to the font table. This allows proper setting of the size parameters for LuaTEX’s ...withdelims math primitives.  ArtiVcially slanted or extended fonts now work via the PDF text matrix so that it now also works for non-Type1 fonts. The lua .slant and .extend font keys are now obeyed in all cases.  There is a new allowed key: .psname. This value should be set to the original PostScript font name of the font. Fonts inside dfont and ttc collections are fetched using this Veld.  A change to the relative ordering inside font name discovery for use by the backend: now it tries .psname Vrst, as that is much less likely to contain spaces.  lua-loaded fonts now support a .nomath key to speed up loading the lua table. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         ‘TEX’-side extensions and changes  \input and \openin now accept braced Vle names.  The \endlinechar can now be set to any value between 0 and 127.  The new primitives \aligntab and \alignmark are aliases for the use of & and # in alignments.  \latelua is now allowed inside leaders.  The new primitive \gleaders provides ‘globally aligned’ leaders.  From now on LuaTEX handles only 4 direction speciVers: TLT (latin), TRT (arabic), RTT (cjk), and LTL (mongolian). Other direction speciVers generate an error. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         ‘TEX’-side extensions (cont.)  The \pdfcompresslevel is now eUectively Vxed as soon as output to the PDF Vle has occurred.  \pdfobj has gained an extra optional keyword: uncompressed. This forces the object to be written to the PDF in plain text.  Two new token lists are provided: \pdfxformresources and \pdfxformattr, as an alternative to \pdfxform keywords.  \pdfrefxform [width ] [height ] [depth ] scales a form object; similar principle as with \pdfximage: depth alone doesn’t scale, it shifts vertically.  \pdfrefximage [width ] [height ] [depth ] overrules settings from \pdfximage for this image only.  Removed obsolete pdf TEX primitives: \pdfoptionalwaysusepdfpagebox \pdfoptionpdfinclusionerrorlevel \pdfforcepagebox \pdfmovechars General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Lua table extensions  There is a new callback: process_output_buffer, for post-processing of \write text to a Vle.  The callbacks hpack_filter, vpack_filter and pre_output_filter pass on an extra string argument for the current direction.  fontloader.open("font") previously cleared some font names that it should not.  font.id("tenrm") returns the internal id number for that font.  os.name now knows about cygwin and kfreebsd.  lfs.readlink("file") returns the content of a symbolic link (unix only).  lfs.shortname("file") returns the short (FAT) name of a Vle (windows only).  kpse.version() returns the kpathsea version string.  kpse.lookup({...}) oUers a search interface similar to the kpsewhich program. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Lua table extensions (node table)  node.vpack(n) packs a list into a vlist node, like \vbox.  node.protrusion_skippable(n) returns true if this node can be skipped for the purpose of protrusion discovery.  node.dimensions(n) returns the natural dimensions of a (horizontal) node list.  node.tail(n) returns the tail node of a node list.  Each glyph node now has three new virtual read-only Velds: width, height, and depth (values in scaled points)  glue_spec nodes now have an extra boolean read-only Veld: writable. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Lua table extensions (node table)  hlist nodes now have a subtype to distinguish between hlists generated by the paragraph breaking, explicit \hbox commands, and other sources.  node.copy_list(n) now allows a second (stop) argument.  node.hpack(n) now accepts cal_expand_ratio and subst_ex_font modiVers.  node.hpack(n) and node.vpack(n) also return the badness of the created box, and accept an optional direction argument. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Lua table extensions (pdf table)  pdf.mapfile("...") and pdf.mapline("...") are aliases for the corresponding pdf TEX primitives.  pdf.registerannot() reserves a PDF object number and returns it.  pdf.obj(...), pdf.immediateobj(...), and pdf.reserveobj(...) are similar to the corresponding pdf TEX primitives.  new read-write string keys: pdf.catalog pdf.info pdf.names pdf.trailer pdf.pageattributes pdf.pageresources pdf.pagesresources General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Lua table extensions (tex table)  tex.badness(f,s) interfaces to the ‘badness’ internal function.  tex.linebreak(n, {...}) allows running the paragraph breaker from pure lua.  tex.sp("1in") converts lua-style string units to scaled points.  tex.tprint({...},{...}) is like a sequence of tex.sprint(...) calls.  tex.shipout(n) ships out a constructed box.  tex.nest[] and tex.nestptr together allow read-write access to the semantic nest (mode nesting). General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Finally  Of course the manual has been updated as well :)  The LuaTEX website is http://www.luatex.org  LuaTEX 0.60.2 is on TEXLive 2010. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .         Bonus slide: LuaTEX 0.63  In the tex library: assignment to internal glue parameters is now allowed.  Mplib version 1.502 is included.  New lua library epdf for introspection of PDF inclusions.  Input-ed lua Vles are now mentioned in the .fls Vle for --recorder.  LuaTEX now uses Poppler.  There is now a LuaTEX ‘short reference’.  New virtual tables: tex.catcode[], tex.lccode[], tex.sfcode[], tex.uccode[], tex.mathcode[] and tex.delcode[].  Add CIDset tables to the output PDF.  Drop OCP support. General changes Embedded . . . Font related ‘TEX’-side . . . Lua table extensions Bonus slide: . . .