[Writer] How to have several numbering styles on Heading in the same document?

An elaborate document usually consists of “plain” chapters numbered numerically 1, 2, … and optionally appendices numbered alphabetically A, B, …

Since chapter titles (plain and appendices) are meant to end up in the table of contents, it is natural to style them Heading 1. However, it seems the Outline & Numbering settings are global to the document, meaning I can’t switch to another numbering style without affecting all chapters.

I tried to change the numbering style for a specific paragraph from the Format > Paragraph > `Outline & Numbering tab but it does not give the intended result. If I choose a numbering style different from chapter numbering, say Numbering 2, the number is altered in the text body but does not appear in the ToC. Depending on LO release, the chapter title may even be removed from the ToC.

Stranger yet, after fiddling with the numbering style, replacing chapter numbering by any style from the drop-down menu, it is impossible to restore the initial setting as chapter numbering is no longer in the menu.

Is there a procedure to selectively change the numbering style of designated Heading x paragraphs?

I have offered a workaround in my answer here. The main thing to remember with outline numbering is that you are restricted to 10 levels.

In my case that’s a much better solution than petermau’s but still a hack with all the risks at LO evolution.

To sum up: either create a parallel outline hierarchy, not forgetting to manually demote the heading to the appropriate level, or split the standard Heading hierarchy into to sets with manual ToC adjustment.

Thanks

The way I would tackle this would be two have multiple versions of the same Paragraph style. So Heading 1, Heading 1 - version 1. Take the normal Heading 1 and create a new one based on Heading 1. Bring up the STYLES AND FORMATTING sidebar. F11 to turn sidebar on and off, then select STYLES AND FORMATTING, and PARAGRAPH STYLES > Heading 1 say > Right click > new > modify name, and next style > change to your new options. You will then have the choice of two.

The LibO Writer Guide has two very useful chapters on styles, 6 An Introduction to Styles and 7 Working with Styles. And there is the help function also.
LibO 5.1 now has a Style entry on the toolbar. Hope this helps… Peter

Update
So you have Heading 1, Heading 1 - Modified, (both will be indexed in the same manner), Heading 2, Heading 2 modified etc. This way you have two options at each level but different display and indexing. I did not mean swapping the modified for the base styles. Sorry if that was not clear enough…

Should have thought by myself about this lead. However, does not work:

Created new H2 style based on Heading 2. Forced it to take part in outline at level 2, associated with it style Numbering 1. This latter style was modified to have level 1 as 1. and level 2 as A. Took care that the number of displayed levels was correct.

What I get is a heading line with only outline level 1 numbering (although it is forced to be at outline level 2).

It looks like, either:

1 - setting for outline level in paragraph style is only partly effective (para is now an outline para but its level assignment is not understood),

2 - settings in numbering style are not transferred correctly to para style or to outline engine.

What else can I try?

I was not clear myself, either. When you work too much with a tool, you consider implicit things for yourself obvious for others. My H2 was a “modified” version of Heading 2, consequently H2 is “linked to” Heading 2". The surprise was H2 was no longer in “Outline level 2” but in “Body Text” (easy to correct). Nevertheless, I don’t understand why, after forcing level 2, I only get a single number (from level 1) on my line.

Custom heading styles have definitely not the same properties as standard heading styles. To solve the numbering problem, I had to select the H2 line and click on “demote one level” button in the bottom tool bar. Then the numbering style accepted to display a 2-level number.

I don’t find the above answer satisfactory since it involves a lot of manual style editing (practically creating a parallel style hierarchy). Not very user-friendly!

Wouldn’t this be very easy IF Writer would allow to have sections of a document with individual numbering (like section preface, section main, section appendix)? So the number format for headings would not be a property of the paragraph, but of the section, and the format of the page number would be a property of the page (template).
The “solutions” presented so far are all much like a work-around for a design bug, because they really lack elegance.

@lolli: beware! In LO, “section” means a “subarea” where you can have “geometric” properties, mainly number of columns, different from current page style. Here, you mean a part of a document containing complete chapters, i.e. a subdocument. There is no such notion in LO presently. Master+included document can’t be used for this purpose.

I finally found a more acceptable workaround to this question after thinking over the experiments I conducted with this other question. It tries to clarify already given answers with a recipe based on @petermau’s idea which unfortunately missed the point on the list style.

It is still a workaround with serious drawbacks but it works: headings and TOC are automatically updated and remain consistent.

  • Alternate headings

Headings styles for the appendixes define their own hierarchy: they are custom paragraph styles, say Appendix x linked to the corresponding Heading x, so that any change in Heading x cascades to the appendix style.

In Outline & Numbering tab, set Outline level to the required level (when style is created with New… on a heading style, outline level reverts to Text body) and choose a custom numbering style, say Appendix (more on that later, though list style creation should precede heading paragraph style).

Appendix x are now paragraph styles for lists which means their numbering are independent from standard headings (depending on built-in “unreachable” list style Numbering symbols ). Having attached them to an outline level causes them to be captured by the TOC engine and they will end up in the TOC.

List style Appendix must be tuned to duplicate the settings in ToolsChapter Numbering for seamless integration in the document. But the Numbering series can be freely chosen differently from the standard series, e.g. appendixes can be numbered alphabetically while chapters are numbered numerically.

  • Usage in document

This is where you incur inconvenience because the alternate styles are not real heading styles but define a list and the alternate headings must be treated as lists.

Use the Appendix x style as you would use Heading x (right style at the appropriate level), but …

To get correct numbering, you must “shift” the list item to the proper level with Tab s at head of paragraph: no Tab for level 1, one Tab for level 2, etc.

  • TOC and cross-references

Since Appendix x are attached to their outline level, all their properties are captured by the TOC engine, including their exotic numbering, and display as intended in the TOC.

It also works in field insertion when requesting Headings > Chapter or Reference (e.g. to add chapter title and number in the header area).

  • Summary of the inconveniences

  • Duplication of heading hierarchy

  • Duplication of chapter numbering in the list style

  • Manual positioning of alternate headings to corresponding list level