Created attachment 129020 [details] example-document-inGreek It would be helpful if i could insert a table of contents for specific levels, that i will choose in a "form" of range (from heading (level) 2 to heading (level) 3), for my document. For example, in the document i'm attaching (it is in Greek language), i would like to be able to insert a table of contents, after every occurrence of heading 2, which will list heading 3 entries of ONLY that heading (heading 2). The result i want to have will be like, ΑΡΘΡΟ 1 (Heading 2) 1-1. (Heading 3) 1-2. (Heading 3) 1-3. (Heading 3) 1. In the page number 6 of the document, at the end of the heading in the top of page press enter. 2. Press F10 and choose from "Insert menu" - "Table of Contents and Index" - "Table of Contents, Index or Bibliography". 3. In the "Create Index or Table of Contents" section of the "Type" tab, choose For "Chapter" and Evaluate up to level "3". This is the place, where i think it would be helpful, to be able to choose the level of heading in the "For" and also to specify the headings which i want to include, for example from heading 2 to heading 3.
As the name TOC says it's used to list the whole content (with a limitation for those users who weirdly structure their documents with more than four levels). But introducing a 'from' option violates the core idea. So why don't you go with an alphabetical or user-defined index? That requires to explicitly link a heading to the index but it has all flexibility you want. https://help.libreoffice.org/Writer/User-Defined_Indexes
Reading the ticket again I think the enhancement request is valid, more or less. The user-defined ToC works in the same way as regular headings. Both can be done based on the 'entire document' or for the current 'chapter'. The latter is almost what is requested here but works on top level heading (h1). The solution, if possible (needDevEval), is to have another option 'heading' in the dropdown 'Create Index or Table of Contents' that works for the current active heading, whether it is h2 as requested with a ToC for the childrens h3,h4 etc., or when started from h3 for the items below respectively. It makes sense to set a minimum value for the 'Evaluate up to level'. The function should be available for all types.
Please add keyword 'needsUXEval' and CC 'libreoffice-ux-advise@lists.freedesktop.org' if input from UX is needed.
(In reply to ratrace from comment #0) > It would be helpful if i could insert a table of contents for specific > levels, that i will choose in a "form" of range (from heading (level) 2 to > heading (level) 3), for my document. I believe this is now FIXED (based on bug 130318 ) or WFM. In LO 7.6: 1. Place cursor after the level 2 heading to be indexed. 2. Open ToC dialog, select For: Chapter and set: Evaluate up to level: 3 Result: As described in OP. Level 2 Heading Only level 3 headings