Skip to main content
Will Price
Inspiring
May 12, 2023
Question

Prevent TOC bringing in headings with character styles?

  • May 12, 2023
  • 3 replies
  • 1338 views

Hello,

 

How do you stop a generated TOC from using character styles applied to paragraph styles?

 

I have a character style (underline) applied on the first letter of every H1, but I don't want it in the TOC.

 

I can't see any option to specify this.

 

Is it possible?

 

Thanks,

Will

This topic has been closed for replies.

3 replies

Will Price
Inspiring
May 12, 2023

Yikes, what a palaver. More hassle than it's worth.

 

I think I'll generate the TOC, copy it into a new text frame and re-style it manually each time.

 

I'll look into GERP and Nested Styles when I have the time. Thanks for the info.

James Gifford—NitroPress
Legend
May 12, 2023

Back up on your layout and use heading styles without any overrides, at least ones you don't want in the TOC.

 

That's often the best approach in many ways, and it rarely takes more than slight simplification of the overall look. It's just easy to make the mistake of using too much styling in the headings without realizing the consequences. 

Will Price
Inspiring
May 12, 2023

This brand has an underline under the first letter of every H1. Character styling felt like the best option.

 

Adding a line under each H1 would be more tedious than re-doing the TOC each time. (I will look info GERP and Nested Styles).

 

I think the TOC should have an override to choose whether character styles are imported. It seems pretty rudimentary.

 

I'll make a feature request. 👍

Willi Adelberger
Community Expert
Community Expert
May 12, 2023

Try to work with GREP and Nested Styles in the Headline Paragraph Styles. Those are ignored in the TOC paragraph styles. If not possible remove them at the end. 

Or make the toc in a different document, bundled in an INDB book file. In that document define the character styles without properties. 

James Gifford—NitroPress
Legend
May 12, 2023

The short answer is that you can't. 

 

There are various approaches and workarounds,  but the fundamental fix is not to use character styles and overrides in TOC elements.