When you choose one of the Headings in the Cross-references
tab, you designate a specific heading in the list, not a generic one, like “the most recent heading”.
The running chapter is available in the Document
tab, as type Chapter. The Format column allows to select the heading with or without the number. Level selects which Heading n is considered. In your case, keep level 1.
Writer looks at the first line of the page (for the header – last line for the footer) to determine which Heading 1 is active there. This means the header does not contain the first Heading 1 of the page if it isn’t the first paragraph, but potetially the last Heading 1 of the previous page.
EDIT 2019-0806 to answer a question in a comment below (revised 2019-08-07)
In case you have other paragraph styles you’d like to consider aliases for Heading 1, don’t forget to integrate them to the chapter/outline hierarchy.
For example, your Heading with subtitle has been made a child of Heading 1 through “Inherit from” in the Organizer
tab. But, it looks to me that the paragraph style was created first and attached afterwards to Heading 1. As a consequence, practically no attribute is inherited; they all override those of Heading 1. The simplest way to create child styles is to right-click on the “father” style and New
. The new style is a copy of the father and you only need to change one or two attributes here and there. All the others will keep in sync with the father.
The “exact-copy-thru-right-click” works for all styles except Heading n. These styles are quite singular and are handled differently from others – they have additional internal properties – so LO tries to protect TOCs against unwanted “pollution” by not transferring the Outline level, setting it to “Body text”.
In Outline & Numbering
for Heading with subtitle, you see that this is common text style because its Outline level is Body text
.
To correct this, resist the temptation to set it manually to Level 1
because you would override the value in the ancestor (even if it is presently the same value). Push the Standard
button: it puts all the attributes of this page in “transparent” mode, i.e. all attributes inherit from the ancestor and will be equal to the ancestor values even if you edit the ancestor.
As pointed out in the remark above, you must manually correct the Outline level to Level 1
.
Remark: When checking on the attached file above, the Reset
button seems not to work on first edit of the style, but it OK after a first save. Also, the file may be in some preliminary state because after correcting Heading with subtitle all corresponding entries in the TOC were duplicated. Everything is correct if I delete and recreate the TOC. This may be artefact on my side..
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!