Revision history [back]

I don't quite understand what you're trying to achieve. Therefore, if I don"t address your problem, edit your question (don"t use an answer for that) to explain what you expect (the specification) and how you do it (the procedure) and what happens that kills your edit (the problem).

TOCs and indexes are dynamic objects internally generated by Writer. As a consequence, it is not recommended to edit them manually because edits will be lost on next update. You can however customise the appearance of a TOC by modifying paragraph style Contents n where n is the level indicator.

From your screenshots, you'd like to add a yellow background to level 3. Open the styles side-pan with F11 and right-click on Contents 3 to Modify. Either go to Highlighting or Area to set background colour.

Highlighting will only highlight words (character space) and won't merge lines while Area is a true background from margin to margin, including paragraph spacing.

If you cleverly design your Contents n modifications, you no longer need to manually edit your TOC.

Note: the Reset button in the styles dialog is used to revert settings to the value in the ancestor style. It is not supposed to erase attributes to a "neutral" or "void" value. So, the effect is dependent on what you have done (or not) on the ancestor style.

To show the community your question has been answered, click the ✓ next 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!

I don't quite understand what you're trying to achieve. Therefore, if I don"t address From analysis of your problem, edit your question (don"t use an answer sample document, you apparently modified a critical parameter in tab Outline & Numbering of styles Contents 2 and Contents 3. This parameter is Outline level. It is a kind of flag telling Writer that the corresponding paragraph is a heading and at which level in the hierarchy (chapter, sub-chapter, …) it belongs.

When a TOC is requested, Writer scans the document for that) to explain what such flagged paragraphs and associates them with the corresponding level in the TOC.

Since you expect (the specification) and how you do it (the procedure) and what happens that kills your edit (the problem).

TOCs and indexes are dynamic objects internally generated by Writer. As a consequence, it is not recommended to edit them manually because edits marked Contents 2 and Contents 3 as level 3 and 4 respectively, they will be lost on next update. entered in the second and subsequent TOCs.

To fix the problem, just revert Contents 2 and Contents 3 to outline level Body text.

Remark: you apparently want to have TOCs at head of chapter. You can however customise the appearance of a do that be limiting the scope of TOC scanning by modifying choosing Chapter in paragraphCreate Index or TOC style Contents n where n is the level indicator.

From section of the TOC dialog. But for Writer a chapter is anything between Heading 1 paragraphs. You should then use Heading 1 instead of Heading 2 to bound your screenshots, you'd like to add a yellow background to level 3. Open the styles side-pan with F11 and right-click on Contents 3 to Modify. Either go to Highlighting or Area to set background colour.

Highlighting will only highlight words (character space) and won't merge lines while Area is a true background from margin to margin, including paragraph spacing.

If you cleverly design your Contents n modifications, you chapters.

(Your comment deleted, because it is no longer need to manually edit your TOC.

Note: the Reset button in the styles dialog is used to revert settings to the value in the ancestor style. It is not supposed to erase attributes to a "neutral" or "void" value. So, the effect is dependent on what you have done (or not) on the ancestor style.relevant after my editing of this answer.)

To show the community your question has been answered, click the ✓ next 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!

From analysis of your sample document, you apparently modified a critical parameter in tab Outline & Numbering of styles Contents 2 and Contents 3. This parameter is Outline level. It is a kind of flag telling Writer that the corresponding paragraph is a heading and at which level in the hierarchy (chapter, sub-chapter, …) it belongs.

When a TOC is requested, Writer scans the document for such flagged paragraphs and associates them with the corresponding level in the TOC.

Since you marked Contents 2 and Contents 3 as level 3 and 4 respectively, they will be entered picked again in the second and subsequent TOCs.

To fix the problem, just revert Contents 2 and Contents 3 to outline level Body text.

Remark: you apparently want to have TOCs at head of chapter. You can do that be limiting the scope of TOC scanning by choosing Chapter in Create Index or TOC section of the TOC dialog. But for Writer a chapter is anything between Heading 1 paragraphs. You should then use Heading 1 instead of Heading 2 to bound your chapters.

(Your comment deleted, because it is no longer relevant after my editing of this answer.)

To show the community your question has been answered, click the ✓ next 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!