Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Page Number color in TOC

Community Beginner ,
Jul 16, 2014 Jul 16, 2014

Copy link to clipboard

Copied

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

Views

501
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2014 Jul 16, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2014 Jul 16, 2014

Copy link to clipboard

Copied

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

Best regards,

Bill

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2014 Jul 16, 2014

Copy link to clipboard

Copied

> ... 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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2014 Jul 16, 2014

Copy link to clipboard

Copied

> ... 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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2014 Jul 16, 2014

Copy link to clipboard

Copied

Thanks for the input.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 16, 2014 Jul 16, 2014

Copy link to clipboard

Copied

LATEST

As far as the original question (linking the entire TOC entry to the source location), I recommend a script that simply copies the hypertext link from the beginning of the entry to the end.

As far as the comment that "the dot leader is considered to be part of the page number, and gets the color in the quick test I did," I also did some experimenting and found that any leader dots can use a different character format than the page number as long as there is a space using the default paragraph font after the tab on the reference page. In more detail, it seems that the leader characters use the character format of the following character, not the character format of the associated tab character. Furthermore, the character format of the page number is determined by the character format of the < in the <$pagenum> building block on the reference page.

--Lynne

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines