Writer: Headers with chapters & page numbers not excluding on non-chapters displaying properly?

Greetings

I solved a previous related issue with chapters not showing up in header.
NOW the problem is:
1 before the header 1 it displays garbled non-sensical text before the HEADER 1 instances as in this screenshot?

how do I fix this?

Please upload a real, ODF type sample file here.

Thanks in advance & thanks for reply

Yes, here attached is ZIP file with the ODT
book1_test.odt.zip (71.1 KB)

Perhaps I could have it like this for before chapter 1:

Page ii • Introduction: Here Is intro • It’s Best To Wait To “Get Sick”

^^ that would be roman numerals before chapter to indicate page numbers
^^^ shows introduction before chapter 1 and after last chapter?

Your question is still obscure. Is it about the header? Or a matter of TOC?

Two remarks:

  • screenshots don’t help much to diagnose an issue, notably if you don’t enable the visual hints from the View menu. At least, Formatting Marks and Field Shading are recommended. Adding the various boundaries is also helping.
  • there is no need to zip .odt document: they already are a ZIP-container, so zipping them again does not reduce much their size (and you force us to uncompress them to make them usable).

You’ve created an horrible mess with faulty configuration of Tools>Heading Numbering: you attached paragraph style Header to level 1.

Style Header is apply to your header (as expected). But, since a header is repeated “unchanged” (as far as the header structure is concerned) on every page, Writer is confused about which level-1 heading should be considered. Doing so probably results in a loop in the heading tree and Writer is unable to correctly reference your intended level-2 Heading 2 heading.

To make things worse, a bookmark is defined in the header (from XML encoding analysis) but this bookmark is so twisted (I am not sure to read correctly the XML) that it seems to be self-referencing, which could explain why displayed text is having the hiccup. The situation seems to settle starting at the second page. On the first page, there is a mixture of a loop and use of a cache.

Even fixing Tools>Heading Numbering does not correct the first heading.

So, I deleted Default Page Style heading and recreated it. To my surprise, the header does not show what I expected: the chapter title without “Page 2”. Apparently, your document contains shadow level-1 headings (they are listed grayed out in the Navigator). I could no find their definition in the XML (to get rid of them).

IMHO, you must restructure your document, avoiding self-referencing bookmarks, twisted level hierarchy and other upsetting choices (such as attaching Heading 1 to level 2).

Avoid direct formatting (DF). Your sample document already contains 300 DF paragraph style occurrences (inherited from the full document?) and more than 500 DF character style occurrences. I have not counted the DF list style occurrences: they are too numerous. You must be aware that every DF instance creates a single-use anonymous style (paragraph, character, list and frame), contributing to document size inflation and degradation of performance. Learn to work with styles. They are more reliable than DF and allow a very user-friendly control over document formatting and layout.

I suggest you restart from scratch. Design your set of styles: ~30 paragraph styles are what you need (including the 20 built-in Heading n and Contents n for the TOC), ~10 character styles and 1 or 2 list styles. Pages style count is harder to evaluate because it depends on the sophistication of your layout: it goes from 2 (First Page for the cover and Default Page Style for the rest) to 3 styles per “part” (“part” = front matter, TOC, chapters – sharing the same 3-set – , index).

Once your style collection is set, paste your existing text as unformatted; select all; apply Body Text (shortcut: Ctl+0, digit zero not capiltal letter O); apply heading styles to heading and finish with character styles inside paragraphs.

THanks for reply but re-designing everything and 'starting from scratch" seems too far gone now.

  1. I already thought I “started from scratch” and redid everything! :frowning:
    2> this concept of “creating new styles” seems far beyond me.
  2. Is there a way to correct the initial problem I reported with the text within the headers of the page BEFORE the H1 tags as originally mentioned?
    4 Perhaps there is a way to: simply exclude every header chapter and page number mention before rhe first Chapter 1 mention and AFTER the last chapter mention?
  3. If I " restart from scratch " again: is saving the original 600 page document in TXT format, then appplying "body text " format to the entire document, then setting Header 1 for each chapter title enough to go by?
  4. Perhaps I could separate everything before Chapter 1 into a separate file AND after last chapter into a separate file?
  5. OK I made a new TEST document attached here; how do I make it so the header BEFORE the chapter 1 is no counting regular pages? It should be roman numerals and showing “introduction” Rathe than chapter 1?
    book2TEST.odt (26.0 KB)

Can anyone assist here?

I started a new document BUT I wish to make 110% certain I am doing it properly?

My suggestion to restart from scratch comes from my inability to remove stray “sticky” wrong data from your sample document (e.g. the “shadow” headings I mentioned)

Because you are not used to it. But, as soon as a document is larger than 3 pages and requires reviewing and additions, you can’t go through it without styles. Start with built-in styles and customise them to your taste. Remember that from an author’s point of view, style names don’t describe the visual effect but the significance you grant to paragraph. Thus headings are styled Heading n (n equal to level); the main topic of your discourse is Body Text. In a novel, characters’ dialogues will be Dialogue (to be created); in a academic paper, quotations are Block Quotation, etc. You play the same game with character styles: Emphasis instead of “italic”, thus you can change it to red colour and name Emphasis is still valid, while an italic turned red becomes meaningless.

Creating new styles is as easy as using them. However, you need to think in advance about the significance of your paragraphs and the nuances you’ll introduce for words you want to highlight. Don’t be too detailed. You’ll need at most 5-10 new paragraph styles to expand the built-in ones and approximately 5-10 character styles (and this is already a considerable number only needed in a complex technical document).

I am not sure to understand the question. It seems to ask for different headers in different parts of the book. A header is an attribute of a page style. Consequently, if you want/need a different header you must apply a different page style.

This is where I can’t give a generic estimate of the number of page styles because it is too dependent on the “aesthetic” side of the work. I’d say four: the cover, “front material”, chapters, “back material”.

A page style is active for a whole sequence of pages delimited by a “boundary”. This boundary is a special form of page break. It is created by Insert>More Breaks>Manual Break. This opens a dialog where you can choose which page style becomes active after the break (therefore the page style must be created before using the command) and, optionally, you can also define the starting page number of the sequence.

The cover is usually styled built-in First Page, main topic Default Page Style (or the alternating pair Left Page and Right Page). You’re left with creating custom styles for you front and back material. In case the header/footer in these parts only contain fields, i.e. for page number or heading retrieval, no manually typed texts, you can use the same style for both front and back material.

As a first approximation, I’d say yes, but I don’t know how sophisticated your book is. Anyway, you can start with it and see if you need to refine the scheme. In any case, resist the temptation to “fix” the variants with direct formatting (DF). In a 600-page book, DF is your worst enemy. Work with styles, otherwise you’ll meet formatting hell (and “hell” is not an understatement).

If you don’t master styles yet, don’t follow this track. The feature to split a document into separate files is called master+subdocuments. It bring its share of additional difficulties. It requires an even stricter method and discipline across the various files. Present computer performance and storage size allow to handle “comfortably” documents over 1000 pages if there are a moderate number of tables and pictures. But my statement is true only if there is no DF and you style everything. In presence of DF, performance will dramatically drop

As I mentioned above, use page styles between the special page breaks. Each page style can have its own separate page number “style” (numeric, Roman, alphabetical, …) or even no page number at all.

“Introduction” may be either typed manually or be a Heading 1 heading in its own right and echoed in the header with a field.

Anyway, your book2TEST is still faulty in that it still contains and displays the “shadow” headings I could not find in the file.


One final remark: your cover (which can be assigned *First Page* page style) is a perfect example of DF: you position the *Title* paragraph by preceding it with empty *Body Text* paragraphs. This must never be done because empty paragraphs will sooner ot later play nasty tricks on your back. They are really layout killers when you tune and optimise formatting in the latter stages of publishing. Among their nastiness is the distortion they introduce in header computation. If they ever appear at top of page, they prevent correct chapter heading retrieval.
Vertical spacing is a (non negligible) part of paragraph significance. Therefore, this cover spacing should be included in *Title* paragraph style. And don't neglect you can both act on spacing above and below. I see too many people, notably on *Body Text*, using only spacing below. This is not important when you have a long series of identical paragraphs. But when you mix several paragraphs under different styles, combinations of below (preceding paragraph) + above (next paragraph) allow very nice spacing contexts in a very simple way (think of a heading followed by another one at a different level or by main topic).

Thanks for reply

Question:

  1. Why is my file I uploaded here “still faulty” EVEN AFTER I followed directions to copy/paste into a new document AND control+0 (zero no O)
  2. Is there something I can do to correct this based on the file I uploaded ?

For book1_test.odt I think the problem arises from not starting the document with a level 1 heading. You should right click on Heading 1 paragraph style in the Sidebar and select New. Name it Front Matter and click OK.

Click in fnort matetr and apply the new Front Matter style

The Front Matter paragraph style is level 1 but will not have Heading Numbering applied

OH ok this is confusing!

I try to use the DEFAULT styles for LO writer. is this wrong?

Do you have a good tutorial for how to use it properly especially my situation?

No. But where you need a new style, it is simple to create. Front Matter paragraph stylewill inherit every setting from Heading 1, except the Heading Numbering.

Using book1_test.odt, I would create a new page style for the front matter based on Default Page Style, name it Front Matter.

  1. In the Page tab, set Roman numerals, in the Header tab, click Header on.
  2. Click at the end of the line before Chapter 1 heading then click Insert > More breaks > Manual Break.
  3. In the dialogue that appears, select Page Break, Select Default Page Style, tick the box change page number, OK.
  4. Click in the front matter page and apply the Front Matter page style.
  5. Copy the header from the following page and paste it into the header of Front Matter page.

I would have a page break before each chapter.

  1. Right click Heading 1 paragraph style in the Sidebar and select Edit style
  2. In the Text Flow tab, under Breaks, tick the box Insert. At this point you could select a page style just for the Start of chapter page if you had already defined one.

book1_test126935EA.odt (49.3 KB)

I would refer to the Writer Guide chapter on styles, download from English documentation | LibreOffice Documentation - LibreOffice User Guides and also Designing with LibreOffice linked from English documentation II | LibreOffice Documentation - LibreOffice User Guides