Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I get the {toc} macro to exclude certain headings, such as the table of contents header itself

Jennifer Peterson March 1, 2013

When I use {toc} it lists its own header "Table of Contents" in the table of contents. How do I get it to ignore certain parts of the space, like tip boxes?

4 answers

1 accepted

0 votes
Answer accepted
Pepe
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 1, 2013

Your only real configuration option is to limit the depth that is shown so you have a couple options.

1. Don't include a heading above your toc

2. Use a h1 above the toc and h2 or less in the document - configure the marco to show a depth of 2 to 7

#1 is the best way to not show the toc heading and limiting your toc depth is usually a good thing anyway.

5 votes
Jan Anderson March 13, 2015

By the way, someone else has provided the answer to my "exclude multiple headings" question. In Exlude headings you simply put: (Table of Contents|Assumption). Very nice and easy.

1 vote
Jan Anderson March 13, 2015

Put "Table of Contents" in the Exclude Headings field. Then it doesn't really matter where you place it or even what Heading type you put on it.  But you first have to add and Save the Table of Contents heading (it shows in Preview) BEFORE you will be able to exclude it.

What I am trying to figure out is how to exclude 2 or more headings. Haven't quite figured that one out yet.

image2015-3-13 11:20:12.png

0 votes
Sneha_Ganesh June 6, 2019

I tried this workaround for "mini-TOC".

 

Scenario:

Using current TOC Macro, my test page would look like this:

 

FRUITS

  • Apple
  • Mango
  • Grapes

VEGGIES

SNACKS

 

To include a Mini-TOC within the First heading:

  1. Insert TOC Macro
  2. Edit the TOC Macro
  3. In the Include and Exclude fields,

I use the following Regex :

In the Include field start word with .*       Example .* FRUITS

In the Exclude field end word with .*        Example SNACKS.*

 

If you want to include more than a word use this format .*(Apple|Mango|Grapes)

If you want to exclude more than a word use this format (SNACKS|VEGGIES).*

 

Result:

FRUITS

Some types of fruits

  • Apple
  • Mango
  • Grapes

Apple 

A fruit a day keeps the doctor away

Mango

A fruit a day keeps the doctor away

Grapes

A fruit a day keeps the doctor away

VEGGIES

SNACKS

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events