We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Heading in Header

asked 2019-08-06 00:46:09 +0200

lmat gravatar image

updated 2020-08-12 16:45:15 +0200

Alex Kemp gravatar image

I have a book of poetry, and some of the poems are quite long. I would like the name of the poem to show up in the header. The name of the poem will be the most recent "Heading 1"- or "Heading with subtitle"-styled text.

I have dorked around with the header quite a bit and the best I could do is get one of the "Heading 1"-styled text in all the headers (it doesn't change according to the most recent heading text) by clicking Insert > Field > More Fields..., Cross-references, Type: Headings, "Insert reference to": Reference, then selecting one of my Headings, then clicking "Insert". Please let me know what I'm doing wrong, thank you!

Attached is my document.Alfred, Lord Tennyson.odt

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-08-06 08:06:56 +0200

ajlittoz gravatar image

updated 2019-08-07 10:20:02 +0200

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 ... (more)

edit flag offensive delete link more


Awesome! From my reading, it seemed simple to do this with chapters, but I didn't realize that my Heading 1s were chapters!

It is still not picking up Heading with subtitles, though. What is the correct way to handle this?

lmat gravatar imagelmat ( 2019-08-06 13:16:58 +0200 )edit

The answer for Heading with subtitle is too long for a comment. I edit my answer. Stay tuned.

ajlittoz gravatar imageajlittoz ( 2019-08-06 13:25:32 +0200 )edit

I click "Standard" on "Outline & Numbering" of "Paragraph Style: Heading with subtitle" and nothing happens (as you say. I click "Apply" then "Standard" and the values look correct. I click "OK", then come back to the dialogue, and they look wrong again. Truly buggy. I changed Outline Level to "Level 1" (against your recommendation), and the headers look correct, but as you say, the TOC has duplicates. Deleting and recreating TOC did not help. Truly buggy.

lmat gravatar imagelmat ( 2019-08-06 23:37:33 +0200 )edit

I am interested to hear the alternative to "Heading with subtitle". The only difference between this and "Heading 1" should be "space after paragraph". Subtitles ("Heading 2") should be snug against the previous "Heading 1".

lmat gravatar imagelmat ( 2019-08-06 23:41:33 +0200 )edit

I tried another tact: I created a new paragraph style by doing as you say: Right click "Heading 1" then click "New". I only adjusted paragraph spacing, but I see that "Outline & Numbering" says "Text Body" still.

lmat gravatar imagelmat ( 2019-08-06 23:44:51 +0200 )edit

Got it. Edit Table of Contents, Unselect "Additional styles".

I think I'm going back to LaTeX. Everything's visible in one page; no menus, no magic.

You are SUPER-Helpful!

lmat gravatar imagelmat ( 2019-08-06 23:49:57 +0200 )edit

I didn't catch the difference in Spacing after. This difference is a very good reason for a derived paragraph style.

The Text body/Level 1 issue may be a design choice by developers to protect the TOC against undesired effect. I don't remember what I did in my template containing derived Heading n to allow me to have chapters numbered numeric and alphabetic (e.g. annexes) in the same document. I'll edit once again my answer.

ajlittoz gravatar imageajlittoz ( 2019-08-07 07:57:31 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-08-06 00:46:09 +0200

Seen: 429 times

Last updated: Aug 07 '19