Writer header question

I’m trying to make a simple document with boarders and background in the header. I also want different headers (chapter titles on each page).

In the header format I’ve unchecked “same content on left and right pages” and “same content on first page” yet when if I make a change to one header they all change.

That and my header boarders and gradient area do not show.

I’m attaching my document and screenshots of my setups. Can someone tell me what I’m doing wrong?

MoI Guide.odt (11.4 KB)

There are two flaws in your design.

  • a misconception about what page styles are for
    Page styles define a layout and properties for a set of contiguous pages. This set begins at some boundary where you request activation of a page style and ends when a new page style activation is met. The “new” page style may be the same. What is important is the existence of the boundary.

    A boundary is created with Insert>More Breaks>Manual Break where you can request a specific page style after the break. This is not the same as Ctrl+Enter which creates a simple page break without interrupting the sequence of the pages because it does not explicitly change the page style.

    When you ask for a different header on first page and/or left/right pages, this takes effect within the sequence of pages between the boundaries, independent from contents. Thus the “different” headers are:

    • one for the very first page of the sequence
    • either one for the remaining pages or alternation on left and right pages for the remaining ones

    As you can see, this is not related to chapters in any way. What you need to do is create a “boundary” at start of every chapter.

But this will not solve your request for a different header contents for every chapter.

A page style can have only one header: if you change it in some chapter, this new value will be the same everywhere, even if you created the “boundary” I mentioned above because the header is attached to a page style.

Requesting different headers for first, left and right pages does not change the problem because these pages have nothing to do with chapters. Due to your next flaw, you would end up with one page style per chapter which is not user-friendly while Writer has tools to make do with a single page style. And there is no longer a need to create systematically a “boundary”.

  • use of direct formatting instead of styles
    To achieve your request, you must tell Writer what is a chapter heading so that it can retrieve it and send it into the header.

    Writer is designed around the notion of styles which is a semantic markup where you, the author, tell Writer the significance of paragraphs and words within paragraphs. It would be long to explain the comfort you gain from it and the power it gives you for formatting documents. Read the Writer Guide for an introduction to styles.

    In your present case, you vertically space your lines with empty paragraphs and you add your formatting manually instead of customising styles. This is apparent in the way you decorate your header instead of modifying paragraph style Header.

Writer offers the built-in family of paragraph styles Heading 1 to markup your chapter headings, sub-chapters, sub-sub-…

So, assign style Heading 1 to your chapter headings.

Now, we’re ready to modify your header so that the chapter heading (title) is automatically captures and displayed. The tool is called a field. Instead of duplicating your chapter heading with the risk of forgetting to do it when you change the heading in the text, Insert>Fields>More Fields and go to the Document tab to retrieve the Chapter information.

But there is a catch. The capture engine looks only at the first paragraph of the page. Therefore if you (erroneously) use empty paragraphs to vertically space your text, this first paragraph is not a Heading 1. Consequently the chapter name will be void and you’ll be surprised to see that it appears only on page 2 and following.

So you have to learn how to incorporate vertical spacing inside the definition of paragraph style. There is also the possibility to force a page break before the paragraph so that Heading 1 is always at top of page.

As you see, there are many things at your disposal to facilitate your work. But you must take the time to read and practice a bit. Reading the documentation is not a waste of time because your productivity will be boosted after that.


Thank you!

It took me a while to digest, read and make changes.

Now I have a new document with Heading 1. While on the Heading 1 line I clicked Tools>Chapter numbering… (see “chapter numbering” screenshot). I added "Chapter " in the before box.

Then I setup my header with background and boarders. In the header I clicked Insert>Fields then inserted Chapter number. I put a space and a tilda in a different font then Insert>Fields and inserted Chapter name.

Ideally I’d like the chapter number and title in the header only and not in the body text. Is there a way to hide Heading 1?

Thank you

MoI Guide 2.odt (10.6 KB)

Workaround tip:

Edit the Paragraph Style named Heading1: use small character size, white character color, and zero size intents and spaces.

Are you sure that you want NOT display the chapter number and title in the text body at least on the first page of a chapter?
MoI Guide 2 _Zizi64.odt (11.0 KB)

1 Like

Yes, I’m sure. Thank you for the work-around!

The workaround by @Zizi64 is good but whatever way you tweak Heading 1 font size and spacing, the heading will occupy some space, at least 2pt (font minimum size) plus some spacing.

If you really want chapter headings to be totally invisible, i.e. need absolutely zero space, go to Heading 1 Font Effects and enable Hidden attribute.

CAUTION! Works with but I kind of remember that in previous releases if a heading was entirely Hidden it was altogether ignored and numbering could be unexpected! Since you didn’t mention your LO version, check first.

1 Like

I have version: I made a backup copy and setting font effect to hidden worked great.

I hope this is my last question. How do I add a blank page at the end with no header?

Use a different Page Style.