A field in the header can be used to repeat some heading.
The page heading context is computed at top of every page by looking up the state of the first line of text. It is a kind of “back-scanning”(+) to discover the most recently used paragraph attached to an outline level. Then “back-scanning” continues with one-step shallower level until level 1 is reached. At the end of this “back-scan”, we have the collection of active headings and they can be inserted with ad hoc fields.
(+) I have no idea about the exact algorithm used, so don’t take my description too literally.
This is fine most of the time. But I stumble on a “special” requirement. The document has the following structure:
1. Level-1 heading
Text for level-1 argument
1.1. Level-2 heading
Development of level-2 topic
Back to a second level-1 argument
In this schematic structure, the level-2 block behaves like some sort of list [item] expected to be also part of the TOC with heading consistent numbering, i.e. not a numbering for an independent list.
Header should display the most current “relevant” heading. This is done by requesting level-10 heading. Automatic fallback of the heading field engine ensures this (if level 10 is not found, try level 9; if level 9 is not fount, try level 8; …; if level 1 is not found, return "void).
Everything works fine up to the paragraph “Back to a second level-1 argument”. The specification calls for “relevant” heading. There, heading for level 1 is expected. But the standard algorithm returns level 2. This is not a bug.
How can I handle this very special requirement? How can I tell Writer I demote my context to some level? What I’d like to is to flag the beginning of “Back to …” as being now in outline level context n instead of the one implied by the standard algorithm?
LO 24.8.6.2, Fedora 41 with KDE Plasma desktop, .odt