Advice on chapter numbering style, please

I need to create a writer document (using LO Writer 6.2 or higher) that has, next to other stuff not mentioned here for simplicity, numbered articles (starting at 1), numbered annexes (starting at 1), and clauses under both articles and annexes with consecutive second level numbering (first level should be the number of the article / annex). It should
hence look roughly like this:

Article 1. First article heading

1.1 First clause text

1.2 Second clause text

Article 2. Second article heading

2.1 First clause text

2.2 Second clause text



Annex 1. First annex heading

1.1 First clause text

1.2 Second clause text

Annex 2. Second annex heading

2.1 First clause text

2.2 Second clause text


Of course I want LO to assign all the numbers automatically, and I want to say only once that the heading name changes from “Article” to “Annex”, re-starting the counter at 1. I also want all these numbers to be cross-referentiable.

My first guess was to define two derivatives of the “Heading 1” style, one for articles, one for annexes, and one derivative of the “Text Body” style for the clauses. However I have not found any way yet to set the prefix of the heading to “Article” or “Annex” as appropriate and at the same time ensure counting of the clauses of both articles and annexes as sketched above.

Hints much welcome, including pointers to descriptions that have escaped my searches so far.

This Question has already been answered several times on this site, e.g. 66606/writer-how-to-have-several-numbering-styles-on-heading-in-the-same-document or 24246/different-chapter-title-numbering.

Answer to question 24246 offers a twisted solution where you reserve levels 1-5 (Heading 1 to 5 for your articles and sub-parts and levels 6-10 (Heading 6 to 10 for the annexes. This requires to customise Tools>Chapter Numbering to create the illusion of two independent heading lists and similarly to modify paragraph styles Contents 6-10 to force the TOC to have similar appearance in levels 1-5 (articles) and 6-10 (annexes).

It is quite simple but it keeps a huge inconvenient: the first annex will start at level 6 and it will be logically considered part of the last article. This has serious consequences, notably on the Navigator.

Answer to question 66606 proposes a more robust solution (which can be generalised to as many independent numbering sequences as you like) but it is more difficult to understand by beginners. The idea is to keep the “standard” Heading n hierarchy for your articles and to create a new hierarchy for the annexes.

What is needed:

  • a dedicated sequence counter defined by a list style, name it Annex Nbr
  • a set of paragraph styles similar to Heading n (you may name them Annex n) which will be linked to the list style above and attached to the required outline level

The assignment to an outline level will automatically include these headings into the TOC at the appropriate level. Nothing needs to be done here.

The only typing issue results from the fact that the Annex n styles format list items belonging to the list controlled by the sequence counter Annex Nbr. They are no longer recognised by Writer as members of the heading machinery, which means they won’t automatically be assigned the correct list level (this list level is no longer synchronised with outline level). Therefore, you must type outline_level - 1 Tab characters at the head of your annex heading to get correct numbering: none for level 1, 1 for level 2, …

To have “Annex” automatically inserted in front of the number, configure Annex Nbr in Cutomize tab to add "Annex " (with trailing space as Separator Before at level 1.

All your Annex n paragraphs are recognised as headings because they are attached to an outline level. Consequently, they are also listed under Headings in the cross-reference dialog.

to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!*

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

@ajlittoz: Thanks much, I’ve gone straight to the solution sketched out in 66606, which works fine for me. (Can’t upvote your reply, as I don’t have sufficient ‘karma’ - sorry…)