How can I make the sub-heading level listed in the header vary?

Hi,

A question that has really been vexing me. I am formatting a book-length document (my PhD), and have been trying to split the left and right page headers so that they respectively show the ‘chapter title’ on every left page (excluding first page of the chapter), and the ‘sub-section’ heading on the right page.

Broadly, I have been trying to follow something like the document set up suggested by ajlittoz here, without total success, because the (very clear) instructions there are for having the document title on the left header, and the chapter on right, which is close to what I want, but not quite.

Specifically, I am trying to figure out if there is a way to set the ‘right hand’ header so that it ‘varies’ the text to refer to whatever the lowest sub-heading is at that point in the document (that is, in the chapter numbering order). I attach a partial assembly of half the PhD document (with all kinds of messes in it, of course), so I can demonstrate what I mean.

PhD asembly template for LibreOffice question.odt (308.5 KB)

Taking the example of Chapter I in that document, what I would like to achieve is that on all left (i.e. even) pages, the header gives the chapter title (“I. THE EFFECTIVE AS THE ACTUAL AND THE CALCULABLE”), but that for right (i.e. odd) pages, it is the lowest sub-heading that is displayed, e.g. on page 25 the header should read “§I.2. The Efficacy of Axiomatisation in Abstract Set Theory and the Hilbert Programme”, but on page 27 it should now read “§I.2.i.The Double Unity of Theories in Remarks on the Formation of Abstract Set Theory” (given we are now one level lower).

Is it clear what I’m trying to do? And is there a way to make the level from the chapter number displayed ‘dynamic’ like that, or is using Insert>Field>More Fields, Document tab, Heading Type (which is what I’ve been doing) always going to lock that field to one ‘level’?

Thanks for any insight anyone has
Working on Windows 10, LibreOffice version 7.4.4.2., save format .odt.

What you request is quite simple and easy to implement.

Insert>Field>More Fields, Document tab, Heading (Chapter prior to 24.x) type, format whater-you-want and configure Up to level to the maximum level you want to display.

Say, you request 5. If there is no Heading 5 active at top of page, Writer will look up all preceding levels in descending order (i.e. [5,] 4, 3, 2, 1) until it finds an active heading. This heading will be reported in the field.

Up to level does not match “exactly” on that level but has fallbacks on previous levels. And before the first Heading 1, no heading is active, but Writer correctly returns a “void” entry, as expected.

"Quality" remarks

You don’t seem to apply character styles for stylistic variations within paragraphs. You follow the faulty “Word method” of direct formatting. This will seriously hamper your capacity to tune your thesis presentation in the end. Direct format is your worst enemy on sophisticated documents. In particular all your footnotes are plagued with direct formatting which seem to duplicate the character style. This will mask any modification you make to paragraph style Footnote.

You want indented paragraphs for your discourse. Don’t do tgis with a Tab. This is another pernicious form of direct formatting:

  • you rely on repeated implicit tab stops which may defer between computers,
  • a tabulation has a strong semantic significance related to tabular data, which is not the case of your argumentation,

Apply built-in First Line Indent which is configured for this purpose. Indentation distance can be tuned in the paragraph style definition.

Part I heading: you have 2 Heading 1 paragraphs in a row, the heading proper (bold) and a “sub-heading” (not bold). Next time you type a Heading 1, it will be "PART III*! Either you make the sub-heading part of the heading paragraph itself (and use a character style), or you create a separate paragraph style (with different typographical attributes) you attach to outline level 1 if you want it in the TOC.

The latter case detaches the style from chapter numbering, thus not logically disturbing numbering and giving you maximum versatility to format your sub-heading.

Avoid empty paragraphs to vertically space your text. The presence of such empty paragraphs shows you have not abstracted the structure enough.

I don’t understand the beginning of the document. It looks like a global TOC. In this case, you’ll replace it with the “automatic” TOC and that’s OK. If this is not the case, it is awfully direct formatted without structuring. So, review it.

Thanks. However—and I’m sure I’m just being an idiot here—I can’t see heading as a type under Insert>Field>More Fields, Document. I only see Chapter, which obviously re-inserts the chapter name. What am I missing here?

As to the other (helpful, thanks) comments on “direct formatting”, yes, I’m aware of that. In effect, we had a conversation along these lines when I asked some more basic questions about headings back last autumn, and I took your advice very much to heart, but at that point Chapter I was already more or less complete with a bunch of “word-style” formatting all over it, so one of the last editing tasks will be to go back and fix it best I can; obviously the later chapters that we written directing in “semantic formatting” are in better shape.

And yes, that weird old table of contents is to be automated out while I do the final work on the document. The “Parts” doubling I hadn’t caught, will rectify it as you suggest.

Heading is the wording in 24.8.6.2. “Recent” releases tried to better abstract the concepts. In this case “heading” is more general than “chapter” because a heading may label other paragraphs than chapters. And you aren’t an idiot, but a careful reader. Cheers.

All clear! Thanks. I’m sure there will be a couple of other questions before I get this thing submitted (after 7 years…), but I have in any case enjoyed getting to know the contours of Writer better. A powerful tool.

1 Like