Define Chapter Names

I need to insert the title of each chapter into the header of each page, but all the information on how to do this is either out of date (instructing you to look for menu items that no longer exist) or leave out crucial details (like how to define Chapter Names as a field.)

I already have a Table of Contents with all my Chapter Names, so this shouldn’t be that difficult.

So far, I’m able to format the Header (from the “Format Header” drop-down) to size it, set the font and center the text, but anything I manually type in the Header appears above every page.

If I “Insert | Field | Title” (or “Subject” or “More Fields…” | “Chapter Name”), the entry is blank.

Apparently, I need to define what qualifies as a Chapter Name (which I thought I already did using Styles to create my ToC.)

Any help is appreciated.

If the TOC works, you don’t need to define anything else. Go to Insert → Field → More Fields → Document tab, under Type you can pick Chapter and under Format what you want to be displayed (the chapter name, it’s number, etc.). The Level field you find bellow to the right corresponds to the “chapter levels” you find on Tools → Chapter numbering (by default, Heading N paragraph style corresponds to Level N). And that’s it: just insert the field you need in the header.

Thanks for the reply, but as I stated in my question, I tried “More Fields…” | “Chapter Name”) and the resulting entry is blank. :frowning:

Field content for Title and Subject come from File>Properties, Description tab. If you did not fill in this description, the fields are empty. Source for Author is taken from Tools>Options, LibreOffice>User Data.

Chapter name is provided by Insert>Fields>Other or More Fields (no direct access) as @RGB-es wrote.
In Document tab, select Chapter type and format as needed. The Level indicates your focus: 1 for latest Heading 1, 2 for latest Heading 2, etc.

However, if the requested level does not exist, you get the immediately existing lower level, eventually nothing if there is no Heading 1 yet.

I’m not trying to display the author, but thanks for the info.

It sounds like I need to edit the ToC to add “hidden” (non-visible) information that is read when inserting “Chapter” name into the header. If so, I don’t know how to do that.

Don’t edit the TOC, it has nothing to do with chapter names. TOC is a generated table, the items of which (chapters, sub-chapters, etc.) are collected from Heading n paragraphs in your text. This is the same source as for chapter name for headers.

Follow @RGB-es’ procedure. You can also get help from the built-in help (F1)…

In case you still don"t succeed, attach your file to your question.

Unfortunately, as noted in my original question, the procedure suggested by @RGB-es (“More Fields” | “Chapter” | “Chapter Name”) was tried and does not work. All it does is insert a blank space.

I’m afraid I can not attach my document. It is a book I’ve written that I’m submitting to publishers. I may try paring it down to a smaller test file.

Is it a blank space or empty? If you get a blank space, the chapter engine captured it, meaning you have a chapter reduced to a space. This calls for careful examination of your chapter arrangements. If the insert is empty, you didn’t use correctly the Heading n styles, which seems queer as you have a TOC.

(Sorry for the late reply.) I can not tell if the outputed character is an actually space or just empty. I can backspace over it to delete it, or highlight & delete the gray blank to remove it.

Make sure View>Formatting Marks is enabled. Blanks will display with a light gray centered dot.

When backspacing, you delete the field, not just its content.

Also note that the fields in headers only “know” information about the text that is available in the very first paragraph on current page. That means, that for the following structure:

                Page 1
----------------------------------------
|       Header: <Chapter field>        |
|--------------------------------------|
|           Paragraph 1: e.g. epigraph |
| Chapter 1 (Heading 1)                |
|                                      |
| The rest of page paragraphs go here, |
| up to the end of the page, as Text   |
| Body paragraphs                      |
| ...                                  |
| ...                                  |
| ...                                  |
----------------------------------------
                Page 2
----------------------------------------
|       Header: <Chapter field>        |
|--------------------------------------|
| ... and the first chapter text       |
|  continues here                      |
|                                      |
| Chapter 2 (Heading 1)                |
|                                      |
| The text of second chapter (Text     |
| Body)                                |
| ...                                  |
| ...                                  |
----------------------------------------

… the header of the first page does not know about Chapter 1 on the page: it only “sees” the very first paragraph on the page, which happens to be the epigraph; and since there was no chapters before, the field would be empty. On the second page, the very first paragraph does not define new chapter (it is a continuation of the first chapter); so the header of the second page only knows about chapter 1 which was defined previously - and that is what would be displayed in the field, despite Chapter 2 is later defined on the page.

When I defined each chapter name to create my ToC (Select text | Insert | ToC & Index | Index Entry), I never assigned a “1st key”. Do I need to do this for this to work? And does every chapter get its own key? TIA

Oh! You should have started with that information in the question itself. The chapter is defined by paragraph with outline level 1 - normally assigned by dedicated paragraph styles (Heading 1 … ) . Manually inserted index entry is a special entity that does not define any chapter by its own - so it’s natural you don’t get expected results.

(Sorry for the late reply) If I need to create the ToC using another method, I’m not sure how to do that.

You simply type your chapter header as a normal paragraph, and apply Heading N paragraph style. This is the first advice in the Help topic conveniently named “Creating a Table of Contents”.

Okay, I’m closer now but still having trouble. I removed all of my prior Chapter Indexes and redefined every chapter title as “Heading 3”. I then recreated the ToC to read every Header 3 as the chapter name and it correctly rebuilt my ToC. I then inserted “Chapter Name” (“Field” | “More Fields”) in my Header, but it puts the name of Chapter 1 in the header of EVERY page. It doesn’t change with each chapter. What did I do wrong?