Unexpected behaviour of heading 2

This is a Navigator view of a part of a document, created years ago with Open Office and updated with LibreOffice. Yesterday I noticed the errors in the headings 2 after 11.2.
The error must have been there since some time. I notice them in all the backups of this document. I got the 11.3 and 11.4 right with restarting numbering of the paragraphs. However, when I save and reload the document, the errors appear again.
How can I solve this?
Thanks!

Screen Shot 07-31-24 at 05.08 PM

tdf#160253

Notwithstanding a possible bug as mentioned by @mikekaganski , common cause to this behaviour is user overspecifying numbering, i.e. Heading n already have an internal reserved list style attached to them through Tools>Header Numbering and user applies redundantly another list style with tool bar button or Format>Bullets & Numbering.

Here it looks like a level-2 numeric numbering has been applied, probably with reset numbering on the second occurrence.

Please attach an excerpt corresponding to chapter 11 for close examination.

Hi,

What do you mean by “excerpt”? Should I attach the entire chapter 11 saved in odt format?

Thanks for your reply.

I suppose your document is quite large. Ionly need the problematic part. Delete what precedes and follows. Attach only chapter 11 but make sure the problem still persists.

I attach a copy of the document. Chapter 11 is now chapter 2 but the problem with heading 2 is still there: 2.2 is followed by 1.1

With paragraph restart numbering I can get the heading right and exporting to pdf is successful. Only the reload of the saved document restores the error.

DBARS_Users_Guide - Copy.odt (41.2 KB)

Observation

Your document uses list styles which have been generated because the document at one time visited Microsoft Word context. (That is most likely the “back story”, because the style names start with “WW8…”, which indicates a typical WinWord incompatibility workaround.)
The issue appears rather stubborn, and the heading styles look to be made dependent on those list styles.

Identifying the cause

  • Did you at some point edit your document using MS Word?
  • Did you originally base your document on a MS Word template?
  • Have you copied the “offending” part from a Word document?
  • Has your document (or partial content) gone through external processing of some kind?

Suggested solution

I am unable to reliably rectify the issue within the document. You may need to copy all content, paste special - unformatted text into a new document, and redo formatting from there.

Hold your horses a little before you go “all in” on my suggestion. Other helpers around here have better understanding of LO internals, and may be able to devise a more efficient solution.

1 Like

The document has been built years ago with Open Office and MS Word was never used for the document. I am quite sure about that because I am the only one updating it. I will wait for further investigations.

Thanks for your reply.

According to the state of the style dictionary, your statement is wrong. It has been manipulated (perhaps created) with M$ Word and chapter numbering has even been customised for some now unkonwn purpose. This customisation is responsible for the current state of affair.

Due to previous saves in DOC(X) format and multiple edits in LO before storing as .odt, your document is now damaged beyond repair.

Ideally, you would delete all WW8xxx list styles, but you can’t do it because these styles are in use and LO doesn’t allow it to avoid data loss.

What “proves” (logically wrong) numbering customisation is the fact tact that Heading 3 is not attached to Tools>Heading Numbering and has received a specific direct-format list styles (and sine list styles don’t exist in Word, I let you imagine the mess this creates).

A possible tedious manual procedure to fix your headings is as follows, but be aware that all headings must be cured, even those apparently good:

  1. put the cursor in a heading
  2. press Ctrl+0 (digit 0) to turn the heading Body Text
  3. press the numbering toolbar button to toggle off numbering
  4. press Ctrl+“level” to re-tag the paragraph as a heading (level= 1 for level 1, 2 for level 2, etc.)

Don’t forget to reconfigure Tools>Heading Numbering to include back the Heading n levels your discarded.


The above procedure is only a quick’n’dirty workaround to fix the issue with headings. It does not solve the general (bad) formatting of the document. There are wy too many direct formatting, such as manual page breaks when many can be made part of paragraph style text flow properties, vertical spacing with empty paragraphs, use of Default Paragraph Style instead of Body Text, absolutely no usage of character styles (not your fault: they don’t exist in M$ Word), spacing /alignment with spaces and tabs instead of defining specific tab stops or ad hoc paragraph styles (in one case of this, a table would have been the correct structure).

My opinion may be very harsh: your document is not semantically structured nor formatted to any standard. Damage cause by contact with M$ Word and later conversion (in multiple steps) to ODF prevents any easy repair. The best you can do is to create a new blank document and to paste your contents as unformatted text to avoid “pollution”. Then style your document.

A simple criterion to know if your document is “correctly” styles is: you should have no empty paragraph and there should be no sequence of multiple spaces or multiple tab characters (and worse: no mix of both).

If you don’t know what styles are, I recommend you read the Writer Guide for an introduction.