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

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 close merge delete

Sort by » oldest newest most voted

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

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?

( 2019-08-06 13:16:58 +0200 )edit
1

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

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

( 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".

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

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

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

( 2019-08-06 23:49:57 +0200 )edit
1

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.

( 2019-08-07 07:57:31 +0200 )edit