TOC in Writer is built from data collected from document text. This data is flagged by specifying an outline level in a paragraph style. Usually the “standard” paragraph styles are Heading 1 to Heading 10 which are assigned to the corresponding level at factory. Other paragraph styles may be used, as you did, when different formatting is needed in parallel to the built-in styles, e.g. chapter headings with ordinary numbering and appendices with Roman numbering, which is not your case.
TOC entries are styled Contents 1 to Content 10, no matter which style was used to collect the entry, built-in Heading n or user-styles. Only the outline level is important here. Consequently, you only need to customise Contents n to set indentation to your liking.
However, this will be difficult because your document is a real mess (no offence intended).
you have a mixture of Heading n and user styles
If your purpose is “semantic styling” (which is a very good approach), you should use
Chapter Numbering to replace Heading 4 and Heading 5 with Disease and Medications in the configuration. This also automatically takes care of the outline level paragraph styles without the need to manually set it. It also advertises the use of the paragraph styles, integrating them harmoniously with the TOC engine.
you didn’t use the automatic numbering feature of
Instead, you seem to have defined a manual numbering with default
Bullets & Numbering which is akin to manual formatting and will lead you into nightmarish numbering problems. When outline and TOC are concerned, always use the dedicated
Chapter Numbering sequence as it never interferes with any numbered list. It is also easier to create a numbering scheme without the fear to break some other list. Fortunately, your
Chapter Numbering is presently set to
None otherwise you’d have experienced conflict between chapter and list numbering resulting in unexpected numbers.
The only reason to use a custom list style (= numbering style) here would be the ability to manage TOC-excluded headings with a consistent numbering. But doing it reliably requires advanced skill with Writer.
I noticed that your document was probably initially created with M$ Word, as your “custom numbering style” is named WWWNum1. But there are many “fossil styles” due to the approximate conversion from M$ format.
page styles are converted from Word
Pay special attention to this as in extreme cases, translation ends up with one page style per page, preventing central layout control (You’d have to tune every page style individually instead of a couple of them corresponding to the main parts of the document: cover, TOC, contents, post-topic material, …).
I’d highly recommend to get rid of all conversion issues to copy and paste as unformatted text the whole document into a blank file and to restyle it consistently.
IMHO, your first task is to think over the outline of the document and to design a consistent numbering with a dedicated list style. Don’t rely on
Bullets & Numbering for such a complex document. It is a false friend who will play nasty tricks on your back. Define which paragraph styles go to which level (in case you want to differentiate headings to be included or not in TOC). For headings not in TOC (outline level = Text Body), you’ll have to set manually the list level by pressing
Tab at the very beginning n-1 times (where n = desired heading level) because the outline level can’t be stored in the paragraph style (otherwise the heading is included in the TOC).
However I consider your present TOC scheme as reader-confusing because numbering is not continuous (some numbers are missing from the expected sequence). This is direct consequence of your decision of not including some headings into the TOC.
TOC layout is done by configuring Contents n. I suggest you changed slightly your TOC
Entries structure lines by adding a T between E# and E (stop position at 0). Tick also Tab position relative to paragraph style indent so that you can align page number position by setting the same value in each level (instead of doing a complex math to “guess” the real position). With this new T, you can now set the indents in Contents n for Before text as 1cm, 1.5cm, 2cm, 2.5cm, … and all First line as -1cm. This will implement what you are looking for. Then tune the distances for optimal result.
If page number alignment appears ragged (because you don’t/can’t use Align at right in 2-column), a work around is to assign a character style to the page number # where you set the font size to a fixed value. As the digits will then have the same width, the “raggedness” disappears.