Indentation in numbering styles for headlines don't apply to table of contents

I am using LibreOffice on Manjaro 23 (Linux).
In my document I created new paragraph styles for the chapter headlines. I changed the numbering style so that there is no ‘.’ following the number in list level 1, but a ‘.’ is seperating numbers in all other levels. Additionally I defined quite a large space after the numbering, depending on the level.
It looks like this: (I had to change spaces to underscores, just to show here, what I mean)

1____Headline One
1.1___Headline OneOne
1.1.1__Headline OneOneOne

Now my problem is, that in the table of contents there is only a single space character between the level 1 numbering and the chapter title. I would like to change this, but can’t figure out how. Also I would like to change the numbering style for the table of contents to have a ‘.’ following the level 1 numbering. It would also be nice, just to manually change indentation of the different levels in the table of contents.

Is anything of the above possible?

First of all, it is not necessary to define “new paragraph styles” for headings. You can just customise built-in Heading n. Built-in styles are not “sacred” in any way; they are not protected against change. So, it is easier to modify them because you don’t need then to integrate them in other mechanisms like automatic numbering or TOC collection.

Using spaces to layout text is a bad idea because base space width depends on font, Writer can expand space width on its own and position after the spaces depends on text preceding it (e.g. start of the heading after 1 is not the same as after 15). Defining tab stop is a more reliable way to control your layout.

Issue #1: headings
Removal of last dot in numbering is done in Tools>Heading Numbering (Chapter Numbering before 7.6), Numbering tab. Note there is no final dot in default configuration.

Starting position of heading is configured in Customize tab. Aligned at is for number position. Set both Tab stop at and Indent at to the same position for the heading text. Chose Numbering followed by Tab stop to cause heading to start automatically at the defined position.

Issue #2: table of contents
TOC formatting is controlled by Contents n paragraph style. But layout is configured by Insert>TOC & Index>TOC, Index or Bibliography, Entries tab.

You can add a dot after the chapter number by typing a dot and a space in the blank entry box between N# (E# before 7.6) and E.

Since some 7.x release, heading text captured for TOC undergoes some stripping where initial spaces are removed. Consequently aligning heading in TOC requires a tab stop. Consequently, you’ll add a T descriptor in the entry, so that it looks like:
I have not represented here the empty entry boxes. Note that the box between N# and T now only contains a dot because spacing will be done by the tab.

Leave the tab position at 0 (relative to paragraph style indent).

It is now time to customise the Contents n corresponding to the level. In Indents & Spacing, set Before text to the distance you want your heading aligned. In First Line, enter a negative distance telling how far from the heading your numbering will start.

You may find the above instructions complex if you’re not familiar with styling gymnastics. But this is the price to the tremendous versality offered by Writer. Nearly any conceivable layout/formatting is possible for headings and TOC, except inline heading (or rather it requires a really contorted workaround) and inline TOC (without line break between entries).

Thanks alot for your detailed answer. To the first point, I did not use space characters to simulate an indent. I used the indentation and tab stop fields. Actually I could manage almost all of the stuff you mentioned, except for the thing with inserting another tab stop between numbering and chapter name. It completly destroys the structure. It somehow fills the space between these two with dots and sends the chapter name to the far right, where the page number should be, although character style is (none), ‘fill with’ is empty and ‘align right’ is deactivated. The page numbers are send to a new line. But I solved this by changing the contents styles of the used levels and their indentation parameters. Also I managed some problem I did not mention yet. The last chapter has no numbering and should be aligned with the numbers of the level 1 chapters, which is not possible if is set to outline level 1. I set it to outline level 10, but its style to level 1 and deleted the numbering field. Now everything is fine. Thanks again!

Since headings are part of an “internal” list, you can’t tune alignment at left (indent + first line indent) in the paragraph style because the list style takes over these settings. Since heading numbering is done with an internal style, you can only control it with Tools>Heading Numbering.

Inserting a new tab in the Entries structure line is tricky: you must click in the entry box at left of E before pressing Tab stop button.

If you get a leading line with your heading starting at right margin, you simply forgot to change left indent (Before Text and First Line in the Contents n paragraph style.

Your dirty trick for unnumbered chapter may cause inconsistency in header or other constructions requiring that the “logical” level of your chapter be the correct one. The correct way to do this is:

  • set Heading 1 paragraph style indents (Before text and First Line) as if your numbering was manual, i.e. Before Text to align all the headings at right of left margin by 1cm or so and First Line to the negative of the indent to flush the number to left margin.
  • touch Tools>Heading Numbering, Position tab to refresh the settings and OK to update the layout so that the indent is not counted twice.
  • style your last chapter Heading 1 if it is not already done
  • put the cursor at the very beginning of the heading and press Bksp
    This creates an unnumbered heading and removes the application of the list style. You only have the effect of the paragraph style, explaining why I suggested to customise Heading 1.