Skip to main content
Bob_Niland
Community Expert
Community Expert
July 19, 2011
Question

Character Formats showing up in TOC

  • July 19, 2011
  • 3 replies
  • 835 views

TOC entries for, say, "Heading4", are nominally controlled by the paragraph format of the generated "Heading4TOC" format.

Sometimes the body narrative will have local mods to the Heading4 text. Depending on what you're doing, you may want those mods to show up in the TOC, or you may not. In my case, I did not, and was surprised to see a TOC entry show up in color.

It turns out that if you apply a Character Format to text used for TOC (and perhaps IX, LOF etc) generation, that ChrFmt is retained when rendering the TOC.

So if you want the local enhancement to appear in the TOC, use Chr Fmt. I verified this by setting a heading word to Character Format "Symbol" (which applies the Symbol font`, all else As-Is). The TOC entry had that word in Symbol glyphs.

if you don't want the local enhancement to appear in the TOC, use local overrides. I verified this by just doing a Format > Font > Symbol on the same word of the heading. The TOC entry had that word in roman.

_______

In my case, I have a table imported (as EPS) from a spreadsheet. I want the table title to appear in TOC, but of course Frame can't "see" that text. So the anchor line is that title in Heading4, which does appear in TOC. This particularly H4 has a local color override that is set invisible via Color Views. I want the TOC entry to be visible, but the Heading4 text in the body to be invisible. This works if the Heading4 has the invisible color applied with the graphics tools. It doesn't work if I use an invisible text Character Format.

Another way to hack this particular problem is to put the Heading4 title in a text frame behind the imported image. Then it requires no character formatting magic. But you can't see it during edit, and you need to hope that the table white fills really are, and aren't just transparent.

    This topic has been closed for replies.

    3 replies

    David_Crowe
    Inspiring
    August 18, 2011

    The TOC will only reproduce the character format of the heading if it has that character format in its catalogue. In your test example, if “Symbol” doesn’t exist in the TOC’s Character Format catalogue, you won’t get a symbol.

    Building on this, you can control the appearance of the TOC entry by defining the character format – if you wish, differently from how it is defined in the main text. So your Heading 4 override may be coloured white in the main text, but black in the TOC.

    That seems the easiest solution.

    Bob_Niland
    Community Expert
    Community Expert
    August 18, 2011

    The TOC will only reproduce the character format of the heading if it  has that character format in its catalogue.

    Thanks for contributing that. It stands to reason that if TOC gen is honoring and replicationg the ChFmt, the easiest way to implement that is just to drag the format in with the text being cloned.

    Building on this, you can control the  appearance of the TOC entry by defining the character format – if you  wish, differently from how it is defined in the main text. So your  Heading 4 override may be coloured white in the main text, but black in  the TOC.

    Thanks again. I'm going to use this starting now, since the present manual set has need of it.

    The key aspects of the implementation:

    1. The ChFmt name needs to be something very self-evident to future document stewards, like "Hide_Except_TOC".
    2. In all .fm files except TOC, its definition is
      all As-Is, except for Color,
      which is an existing author-use-only color "Invisible Text" already set Invisible by Color Views during render.
    3. In the TOC file, the definition of "Hide_Except_TOC" is
      100% As-Is.
      (first time I've ever defined a format like that)
    August 17, 2011

    This is one of the reasons I almost always use a List of Markers to create a TOC, rather than a "regular" TOC file.

    Another advantage is that with a marker it's easy to have slightly different text for the TOC, especially good for manuals where the headings are often too verbose to easily fit on the smaller line measure of most TOCs.

    And with markers, one doesn't have to deal with the complications of using white text.

    August 17, 2011

    I don't know if this works in indexes. I just tried this and it didn't work for me. Of course, I am trying to use two different formats for the GroupTitleIX separators. No matter what format you apply, the GroupTitle stays with the original format.

    Bob_Niland
    Community Expert
    Community Expert
    August 17, 2011

    I don't know if this works in indexes.

    Well, thinking a bit about it, and despite my saying "perhaps in indexes", I can't see how it would work. But there is a Plan B.

    Index entries are driven by the Marker Text, and not the body text at the marker (although the default marker text is whatever you highlighted, but with formatting and format overrides ignored).

    TOC text entries, by contrast, are copies of the entire paragraph at the marker. How Frame is doing that copy is obviously controlling whether character formats come with it.

    However, if you need character formatting in IX entries, the Marker Text dialog appears to allow and honor Character Catalog constructs. I just tried inserting a <Bold> in a trial marker text, and it worked. Note, "<Bold>topicword" gets treated as a distinct IX entry from "topicword".