Moving horizontally a whole ensemble of layers in the same run?
Hi Hans, assume we fixed between "\definelayer" and "\flushlayer" a whole ensemble of layers on a page. And by calculating per luacode we determined the leftmost and the rightmost edge of the ensemble and would now like to horizontally centre the ensemble. We don't know the rightmost edge before we placed the last layer. By luacode we can calculate how much the centring movement should be, because we know "\textwidth", but we cannot save the calculated centring value in the context program for another run. Saving the luacode values of hundred of pages in flattened lua tables would be possible, but rather awkward; the problem of relating pages to tables would arise, especially when pages are taken out or additional pages are inserted. Do you know a way to settle the centring in the same context run in which the layers are placed? Could "\flushlayer" perform it somehow? Rudolf
On 12/17/2019 7:18 PM, Rudolf Bahr wrote:
Hi Hans,
assume we fixed between "\definelayer" and "\flushlayer" a whole ensemble of layers on a page. And by calculating per luacode we determined the leftmost and the rightmost edge of the ensemble and would now like to horizontally centre the ensemble. We don't know the rightmost edge before we placed the last layer. By luacode we can calculate how much the centring movement should be, because we know "\textwidth", but we cannot save the calculated centring value in the context program for another run. Saving the luacode values of hundred of pages in flattened lua tables would be possible, but rather awkward; the problem of relating pages to tables would arise, especially when pages are taken out or additional pages are inserted.
Do you know a way to settle the centring in the same context run in which the layers are placed? Could "\flushlayer" perform it somehow?
you need to make a MWE to show what you mean normally \hbox to <somewidth>{\hss<come content>\hss} is good enough for centering 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 -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Rudolf Bahr