Bug 112301 - Allow specifying the outline level considered to be "chapter" when using the "For" option in the Type tab of the Insert Table of Contents dialog
Summary: Allow specifying the outline level considered to be "chapter" when using the...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/how-can...
Depends on: Clarify-Chapter-Heading-Outline-Level
Blocks: TableofContents-Indexes ODF-spec 130318
  Show dependency treegraph
Reported: 2017-09-09 10:11 UTC by RGB
Modified: 2024-04-29 02:06 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

Using Assign Styles to set (arbitrary) outline levels for a TOC (12.99 KB, application/vnd.oasis.opendocument.text)
2021-03-25 13:55 UTC, sdc.blanco

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2017-09-09 10:11:50 UTC
Suppose you have a book with the following structure:

* Part
** Chapter
*** Section

and that you need partial TOCs on each chapter. 

When you create a TOC it is possible to build it "for the chapter", but Writer considers as "chapter" only level 1 headings. That means you cannot set "Part" as level 1 and "Chapter" as level 2 because partial TOCs will not work as intended.

There are several workarounds for the limitation, but none of them are optimal because they imply more manual work on building the TOCs. Hence the proposal: make it possible to choose which outline level is considered as "chapter" for the TOC.


Related enhancement request:

Bug 94218 - footnote numbering per chapter: define outline level that resets numbering
Comment 1 Buovjaga 2017-09-10 15:36:42 UTC
Regina: is this possible with the current ODF?
Comment 2 Regina Henschel 2017-09-10 23:44:59 UTC
No. The attribute is text:index-scope and it has the literal values "document" and "chapter". For chapter the description is: "A chapter consists of all those paragraphs and headings which have the same immediately preceding heading with outline level 1." So the level is explicitly named as "1".
Comment 3 Thomas Lendo 2017-09-13 19:47:45 UTC
Ok, so it is not possible to implement this enhancement request in LibreOffice today.

Nonetheless I'll change the status to NEW with metabug "ODF-spec". Maybe sometime in the future ODF will allow such feature, then it's ready to implement. Other users can find this bug request easier with no resolution which will prevent duplicates.

From my point of view I would appreciate such feature.
Comment 4 sdc.blanco 2021-03-25 12:05:08 UTC Comment hidden (no-value)
Comment 5 Dieter 2021-03-25 12:51:49 UTC
(In reply to sdc.blanco from comment #4)
> It seems like the following could be used for making a partial TOC.

Yes, it could be a workaround. The problem is, that you have to exclude the PS "Chapter" from chapter numbering to assign level 1 in that PS.
Comment 6 sdc.blanco 2021-03-25 13:55:37 UTC Comment hidden (no-value)
Comment 7 Dieter 2021-03-25 14:16:34 UTC
Your example file doesn't match the original problem:
It has the tite "Appendix" and two headings with PS "Heading 1". You've created a TOC for the whole document, but bug reporter asked for TOC for each chapter.

Steps to reproduce the problem
1. Open attachment 170738 [details]
2. Tools => Chapter Numbering
3. Level 1 = PS Appendix
4. Level 2= PS Heasding 1
5. Place cursor in paragraph that begins with "I guess that"
6. Insert => TOC => Tab "Type"
7. Create index for chapter
8. Create from Additional styles (deselect "Outline" and "Index Marks")
9. Assign Styles => Assign Style "Heading 1" to level 1 => O.K. => O.K.

Actual result
TOC with three entries (because whole doicument ist counted as one chapter due to settings in chapter numbering)

Expected result
TOC with one entry (because "Heading 1" is counted as "chapter", because (for example) cursor is placed at the beginning of this chapter)
Comment 8 Emanuele Gissi 2021-04-14 10:45:09 UTC
As done in a linked bug (https://bugs.documentfoundation.org/show_bug.cgi?id=130318) here is the link to a use case for this feature.
It's the current text of the Italian Fire Safety Code.

Here it is at Github:


See the pdf export at:


I think that a feasible solution for the implementation of this feature, that does not break backwards compatibility, is the following idea from Heiko Tietze:


I would be ready to contribute financial resources for solving this.
Thank you again.