I want to test if
- the current page when I generating layout, and
- the page where the layout appears after the work of the page builder,
are the same page. In code it could look so:
I can solve the task using the aux file and two passes, but: probably such module exists already?
I hope an use case explains my intentions better than the text of the original question.
For the left and right pages, I have different layout of noteboxes.
Now consider the actions:
I emit a heading
I want to put a notebox. The current page is the left page. Currently I'm near the bottom of the page, but there is enough space. So, I emit the notebox in the design for the left page.
I emit some other thing, which completes the page.
The page builder is activated. For some good reason, it decides that it is very good to make a page break before the heading.
Therefore, the heading and the notebox appear on the next page. But the next page is the right page, and the design of the notebox is for the left page. Bad.
My idea is to track the pages of the noteboxes on the first pass. And on the second pass, if the current page is not the page where a notebox appears, force the page builder to work.