Ask Your Question
0

How to add certain heading on table of contents ?. Ex: heading 4 only or heading 2 and heading 3

asked 2019-11-07 19:48:54 +0100

Horehore gravatar image

updated 2020-09-08 15:26:49 +0100

Alex Kemp gravatar image

How to add certain heading on table of contents ?. Ex: heading 4 only or heading 2 and heading 3

edit retag flag offensive close merge delete

Comments

1

Built-in controls in TOC generation dialog allows you to limit TOC content to a maximum level, i.e. if you choose 4, Heading 1 to Heading 4 are included. You can't with the built-ins select only level 4 or omit initial levels.

In your Heading 4 example, if levels 1-3 will never be part of any TOC, there is a dirty workaround with custom paragraph styles permitting to keep the appearance of chapter numbering in the text and ito insert only the target levels in the TOC. Once again, only if levels 1-3 never take part in any TOC.

If this is the same as your need, I'll explain the dirty trick in an answer.

ajlittoz gravatar imageajlittoz ( 2019-11-07 20:28:26 +0100 )edit

@ajlittoz Please go ahead an post your "dirty work-around"! Should be interesting. ;) (And include the info in the comment, of course, which is the basic answer!)

David gravatar imageDavid ( 2019-11-08 17:57:47 +0100 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2019-11-09 07:22:38 +0100

It's quite easy. Just disable generation of the ToC from the outline, and explicitly define styles used in the ToC in [x] Additional stylesAssign styles....

edit flag offensive delete link more

Comments

@Mike Kaganski's answer pointed me to reconsider my workarounds which where the only possibilities in pre-6.x versions. The current TOC controls in Insert>TOC & Index>TOC, Index & Bibliography make it much easier to build "selective" TOCs. Follow his suggestion, it is the right answer.

ajlittoz gravatar imageajlittoz ( 2019-11-09 09:33:53 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-11-07 19:48:54 +0100

Seen: 301 times

Last updated: Nov 09 '19
https://ask.libreoffice.org/en/question/216329/how-to-add-certain-heading-on-table-of-contents-ex-heading-4-only-or-heading-2-and-heading-3/?sort=latest
ask.libreoffice.org
crawl=CC-MAIN-2021-10
64019
application/http; msgtype=response
sha1:YVDZ4D6WHPDBSCTGO7QM4XIRF7GQ2V7P
<urn:uuid:d10861e0-1fd5-46e4-beab-8a3aef38f55b>
2021-03-01T12:57:19Z
89.238.68.146
application/xhtml+xml
sha1:RHSXJ75HCB227T47YINPHGZSBIKIVXNK
<urn:uuid:c0e57973-dbc7-40ce-b289-9376764a848a>
https://ask.libreoffice.org/en/question/216329/how-to-add-certain-heading-on-table-of-contents-ex-heading-4-only-or-heading-2-and-heading-3/?sort=latest
response
<urn:uuid:fc64e57b-d2ce-4c7b-acd9-683916151de3>
isPartOf: CC-MAIN-2021-10
publisher: Common Crawl
description: Wide crawl of the web for February/March 2021
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-127.ec2.internal
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/