[Dev-luatex] Luatex 0.51.0 announcement

Taco Hoekwater taco at elvenkind.com
Fri Mar 12 15:58:05 CET 2010


Taco Hoekwater wrote:
> Hi,
> 
> I have just uploaded the archives for a new luatex release, 0.51.0.
> 
> New features:
> 

Actually, there is another feature but it is experimental enough that
it is not documented in the manual yet.

   local <node> nodelist, <sp> founddepth =
        tex.linebreak(<node> listhead, <table> parameters)

The understood parameters are as follows (with example code):

     d = false,                       % boolean
     pardir = 'TLT',                  % dir
     pretolerance = 100,              % number
     tracingparagraphs = 0,           % number
     tolerance = 200,                 % number
     looseness = 0,                   % number
     hyphenpenalty = 50,              % number
     exhyphenpenalty = 50,            % number
     pdfadjustspacing = 0,            % number
     adjdemerits = 10000,             % number
     pdfprotrudechars = 0,            % number
     linepenalty = 10,                % number
     lastlinefit = 0,                 % number
     doublehyphendemerits = 10000,    % number
     finalhyphendemerits = 5000,      % number
     hangafter = 1,                   % number
     interlinepenalty = 0,            % number
     clubpenalty = 150,               % number
     displaywidowpenalty = 150,       % number
     widowpenalty = 150,              % number
     brokenpenalty = 100,             % number
     emergencystretch = 0,            % sp
     hangindent = 0,                  % sp
     hsize = 65536*72*4,              % sp
     leftskip = spec,                 % glue_spec node
     rightskip = spec,                % glue_spec node
     parshape = {}                    % tabke
     pdfeachlineheight = -65536000,   % sp
     pdfeachlinedepth = -65536000,    % sp
     pdffirstlineheight =-65536000,   % sp
     pdflastlinedepth = -65536000,    % sp
     pdfignoreddimen = -65536000,     % sp

The 'd' is whether or not this should be taken as a pre-math-display
subparagraph, everything else should be fairly obvious except for
the last 5. The four pdf...line... things are ignored if their value
equals pdfignoreddimen. Parshape is a list of 2-item arrays, like
that returned from tex.parshape:

   local j = tex.linebreak(h,{parshape = {
                      {tex.sp'1in',tex.sp'6in'},
                      {tex.sp'3in',tex.sp'3in'},
                      {tex.sp'4in',tex.sp'2in'},
                      {tex.sp'1in',tex.sp'6in'}}})


It is your own job to make sure that 'listhead' is a proper paragraph
list: this function does not add any nodes to it. To be exact, if
you want to replace the core line breaking, you may have to do the 
following (when you are not actually working in the pre_line_break or
line_break callback, or when the original list starting at listhead
was generated in horizontal mode):

* make sure that all the prev pointers are ok, for example by
   using node.slide(listhead)
* you may have to run lang.hyphenate(), node.ligaturing() or
   node.kerning()
* add an 'indent box' and perhaps a local_par node at the start
   (only if you need them)
* replace any found final glue by an infinite penalty (or add such
   a penalty, if the last node is not a glue).
* add a glue node for the \parfillskip after that penalty.

The result is just a node list, it still needs to be vpacked.

There are a few special things you cannot interface using this function,
because there is no lua glue for the underlying data yet:

   \interlinepenalties
   \clubpenalties
   \displaywidowpenalties
   \widowpenalties

Also, you can't influence font expansion other than via
'pdfadjustspacing', because the settings for that take place elsewhere.
The same is true for hbadness and hfuzz etc. All these are in the
hpack() routine, and that fetches its own variables via globals.

If there are no complaints, I plan to officially document this function
for version 0.60.

Best wishes,
Taco




More information about the dev-luatex mailing list