Forum How do I...?

Make a column break if below half the column

luizbgomide
I want to make the column break ONLY if the text would start below half the original column.

In other words, I don't want a blank columns space bigger than half a column.

Can that be done using script to check the current position of an item in the page and if bellow half page insert a "column-break-before: always"?
mikeday
Scripts are run before layout, so this would require a process in which Prince twice as described here.
luizbgomide
But if each column break would push the text forward, I don't see how two passes are enough? I would probably have to run many passes (one for each possible column break). Or am I missing something?

Isn't my problem something alike inserting page numbers to links in a table of contents?? This is done in a single pass, write?
csant
The latter is described here.
mikeday
Good point, it would be a multi-pass process that stops only when it can't find any more breaks to insert.