Chapter numbering - is it really so difficult?

I have been trying LO and its predecessors (StarOffice, OpenOffice) for last 18 years. Now, as always, I have to go back to Microsoft Office - and reason? In MS office the normal chapter numbering (1, 1.1, 1.2, 2, 2.1, 2.2, 2.3 …) is working. In LibreOffice NOT. It’s as always - several hours of wild ride through different settings of Heading styles, numbering, outline and reset numbering… ending with totally destroyed document.

Please, decide to implement such a basic functionality in next 20 years. Now I leaving LO and going back to MS, which I hate, but which works actually.

V.K.
Here is the document, which does not work. 1.1 is following the chapter 3.2 and 1.2 is following the chapter 4.

numbering.odt

Beginning analysis. Indeed, something is broken, it also happens on Heading 1. Investigating.

The contributors of this site are mostly enthusiastic users of LO, not developers. It is not in their skills to implement anything or fix bugs.

However, they have gained a deep understanding of LO (notably Writer for me) working and of the “correct” “comfortable” way of using it.

Contrary to your affirmation, chapter numbering works well and reliably in Writer. But, and this may be the source of your ranting, it is not enabled by default.

I don’t understand your need to fiddle with outline settings: Heading n are connecting to the ad-hoc outline level. Reset numbering also has no practical use because chapter numbering has a single sequence in a document and is not supposed to restart in the middle.

Yes, you must customise the numbering sequence because what you want is not the same as your neighbour and a “standard” sequence, fitting everyone’s needs, can’t be defined.

Yes, you can customise Heading n if you don’t like the default just as you can customise Body Text for the bulk of your text.

If you must do it for every document you create, you’re ready to learn how to create templates. In a template, you record all your personal settings and styles. Afterwards, you open your own template and, magically, Writer is preset to your own preferences, saving you several hours of wild ride every time.

Remember that every new tool requires a change of routine. It might be time to read the various guides about styles and templates. With these features, you’ll find that Writer outbeats Word.

EDIT

From close examination of the XML structure, your document is plagued with a high level of M$ Word pollution.

Since Word has a less developed notion of styles (basically, only paragraph styles), user is left with the only possibility of using direct formatting to achieve his goal. When document is imported into Writer, the .docx filter does its best to guess what was at stake. This leads to unnecessary multiplication of character and list styles, plus some direct formatting left.

This is patent in your document where Heading n are replaced by derived styles. Though they are still based on the original Heading n, they have lost their relationship with the dedicated outline counter. This can be seen by the number of WWNumx “list” styles which are attached to the “outline” paragraphs instead of the dedicated counter.

The net result is your imported Heading 1 belong in an independent numbering sequence.

When you create new headings and style them with the drop-down menu, they receive pure unpolluted style Heading n attached to the “Outline” (internal name) sequence. Since you have yet no other paragraph pertaining to this sequence, the heading is numbered from 1.

The problem comes from two main causes:

  • Your document was heavily worked upon in Word and has way too much direct-formatting which hides the simple underlying structure. Word tags the text with this direct-formatting and it is innocuous because it only works like this. However, the quantity of “patching” defeats Writer import filter.

  • You added direct-formatting in Writer, e.g. the page break before Heading 1 which is better located in Text Flow of the style definition, and you messed up styles definitions while trying to fix the problem, e.g. removing Heading n from dependency on Heading or setting “Next Style” to Heading 2 in Heading 2.

One partial way to fix the chapter numbering problem is:

  • put the cursor in a heading
  • give it style Body Text and Format>Clear Direct Formatting or Ctrl>``M`
  • give it back Heading n style

This procedure will restyle the paragraph to a pure Writer-grade style.

Of course, it is tedious because you must do it to every paragraph in the outline.

Another look at your document shows you don’t use efficiently the style machinery. Your text paragraphs are style Default Style which should never be used in a document. Standard style for that is Body Text. Default Style is the ancestor of all other styles. Changing its properties propagates to all others. This is a quick way to modify the general aspect of a document. Some styles like Heading, Index, Text Body or Table Contents “intercept” attributes and force different value along the way, permitting to split the “style sheet” in families dedicated to various purposes.

I see, for example, that you used this feature with your Outline n family, though there is no use of it in the sample.

Not sure about the status of the default, Default and Default-LT-<german_word> families. They may be fossils from earlier versions in Word. Word is known to keep useless outdated styles (in .doc files, replaced text was never deleted and you could recover sensitive information by lookinf “binarily” to the file)

Cleaning an imported Word document is very difficult apart from radical measures like pasting plain text into Writer and restyling the document. This may be the most reliable way if you start by creating a template with all needed styles. Then pasting into a blank document based on the template gives you a “neutral” text which you style Body Text. After tat, you style the chapter and sub-chapter headings. About 75% of the job is done. You are left with the “special” paragraphs: lists, quotations, tables.

Wanted to mention that one can search for paragraph styles, use “Find All” in F&R dialog, and perform the cleanups and style re-assignment to all the paragraphs at once.

Some numbering styles were used in the document, instead of Chapter Numbering (which is configured partially, to have numbers for levels 2 and later, but not 1); so I’d also clear numbering (F12) when cleared styles, and then re-applying Heading N, with properly configured Chapter Numbering, it would be easier IMO.