Skip to main content
New Participant
July 16, 2014
Question

Page Number color in TOC

  • July 16, 2014
  • 2 replies
  • 572 views

When creating a TOC, both the text and the page number link to the paragraph in the body of the document. What I need to do is change the color of only the page number in the TOC. When I create a Character format and apply it to the page number, then the hyperlink goes away for the page number (but is still active for the TOC text). How do I change only the color of the TOC page number and retain the hyperlink? For example:

TOC Text .....................PageNumber

Where I want the PageNumber to be red in color but the TOC Text, the dot leader and the PageNumber all hyperlink to the paragraph in the body text. I have tried in both Framemaker V9 and V12.

Thanks,

Bill

    This topic has been closed for replies.

    2 replies

    Bob_Niland
    Brainiac
    July 16, 2014

    > ... the hyperlink goes away for the page number (but is still active for the TOC text).

    Any change in Character Format causes the preceding hypertext Marker to terminate at the change. This was recently discussed here because it can result from any Character Format applied, such as:
    TOC link with a subscript character does not work in PDF

    > Where I want the PageNumber to be red in color but the TOC Text, the dot leader and the PageNumber all hyperlink to the paragraph in the body text

    Even if you can work around the Marker issue, this may not be possible, as the dot leader is considered to be part of the page number, and gets the color in the quick test I did.

    billh60Author
    New Participant
    July 16, 2014

    Thanks for the input.

    Arnis Gubins
    Inspiring
    July 16, 2014

    Not easily. FM uses any change in formatting (the colour in this case) to delimit the range of the hypertext range. IIRC, Rick Quatro has a script that duplicates the hypertext markers at all formatting changes in a paragraph to make it all behave seamlessly. However, you would need to have Framescript for this as well.

    billh60Author
    New Participant
    July 16, 2014

    Thanks. That is the answer I was dreading (but suspecting).

    Best regards,

    Bill

    Bob_Niland
    Brainiac
    July 16, 2014

    > ... the answer I was dreading (but suspecting).

    Well, it's not full drop dead dread. In addition to the aftermarket script that Arnis mentioned ...

    You could do a hand-crafted TOC, if:

    • the TOC isn't terribly long,
    • the TOC is stable (page numbers might change, but the TOC gets added/deleted entries infrequently), and
    • you have some stewardship process to alert future authors that they might need to touch up the TOC by hand.

    I'd start with the generated TOC.

    1. Make a copy of the xyzzyTOC.fm file with a new name, such as xyzzyTOCred.fm (this alerts the alert that it's probably not a Generated file).
    2. Delete the xyzzyTOC.fm from the Book.
    3. Add the xyzzyTOCred.fm to the Book (not as a generated file).
    4. Edit the xyzzyTOCred.fm:
      - Convert the heading string to Xrefs by paratext.
      - Convert the page numbers to Xrefs by pagenum (and apply the red Character Format).
      - There are a number of approaches for the dot leaders, beyond the scope of a casual reply here. Note that they are separately-selectable text elements in a generated TOC.

    This hand-crafted TOC will have its headings and page numbers auto-updated on Update Book. What it won't get is new entries as new headings are added elsewhere. Any deletions will throw unresolved cross-reference errors, and will be easy to find.