[luatex] pre_output_filter: How to get the vertical list of the full page?

Hans Hagen j.hagen at xs4all.nl
Thu May 3 11:50:55 CEST 2018


On 5/3/2018 11:35 AM, Henri Menke wrote:
> On 05/03/2018 07:13 PM, Hans Hagen wrote:
>> On 5/1/2018 11:50 PM, Henri Menke wrote:
>>> On 02/05/18 03:17, Hans Hagen wrote:
>>>> On 5/1/2018 12:16 PM, Henri Menke wrote:
>>>>> Dear list,
>>>>>
>>>>> It seems as if the pre_output_filter only gives you the nodes in the
>>>>> body block but without the \headline and \footline.  I would have
>>>>> expected that those are included because \plainoutput performs
>>>>>
>>>>>      \shipout\vbox{\makeheadline\pagebody\makefootline}
>>>>>
>>>>> and I would have expected to get the vlist defined by the above \vbox
>>>>> inside the callback.  Am I doing it wrong or am I using the wrong
>>>>> callback?
>>>> you can for instance use vpack_filter
>>>
>>> But how do I detect whether what is being packed is the main vertical
>>> list?  According the manual `groupcode` should be <empty> for the main
>>> vertical list but that just never happens.  With the following MWE
>>>
>>>       \directlua{
>>>       callback.register("vpack_filter",
>>>                         function(head,groupcode)
>>>                             print('"' .. groupcode .. '"')
>>>                             return head
>>>                         end)
>>>       }
>>>
>>>       Hello World!
>>>
>>>       \bye
>>
>> build_page_filter
> 
> Sorry for being such a pain in the neck :(
> 
> How can I access the material to be pushed from within this callback?
> Box 255 (the shipout box) is nil.  The reason I am asking this is
> because I want to implement visual debugging like in ConTeXt.  Therefore
> I want to walk the main vertical list on shipout and sprinkle it with
> whatits to draw rules for boxes, glues, kerns, etc.
> 
> \directlua{
> callback.register("buildpage_filter",
>                    function() print(tex.box[255]) end)
> }
> 
> Hello World!
just hook code into the shipout routine at the tex end: take the box, 
pass it to soem lua code and walk over its content (there is no shipout 
callback - as it's not needed)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list