# [Dev-luatex] A few idle questions...

Hans Hagen pragma at wxs.nl
Wed May 7 15:27:31 CEST 2008

```David Kastrup wrote:
> Hans Hagen <pragma at wxs.nl> writes:
>
>> David Kastrup wrote:
>>> Hans Hagen <pragma at wxs.nl> writes:
>>>
>>>> David Kastrup wrote:
>>>>
>>>>> Yes, that is the kind of thing I had been thinking of.  Another is
>>>>> output routine programming: a function
>>>>> get_more_main_vertical_list_material_from_TeX would be quite handy in
>>>>> some applications, and yielding to TeX until the next pass would seem to
>>>>> make for some very straightforward and understandable programming.
>>>> you can already use a callback to collect material that is added to
>>>> the vertical lists
>>> I don't understand.  What callback, and where is the material supposed
>>> to originate?
>> vpack_filter
>> buildpage_filter
>>
>> at that point you can save the list passed to the function and return
>> nothing
>
> I am afraid that is not useful for what I had in mind, since what I had
> in mind requires actual typesetting, so I need to inject material into
> TeX (unhboxing into vertical boxes, for example) and take a look at the
> results.  I can reinject material into TeX while being caught in the
> output routine, but the callback would not seem like a suitable context
> for that.  Namely: I can't finish the job using just Lua.
>
> I suppose I have to do my own experiments here, I just wanted to hear
> about existing experiences and/or approaches.

as a variant on coroutines you can just print to tex things like
tex.sprint("\\directlua{nextstage()}" intermixed with other tex code

this works ok but is not always beautiful but for the moment it is the
only way to go

-----------------------------------------------------------------