Fixing Word Wrap in FrameMaker Table of Contents

Sometimes headings are longer than you like, creating uncomfortable line breaks in a generated table of contents.

But setting up your TOC entries to break across two lines is pretty easy, once you have tab stops set up and you understand how to work with nonbreaking spaces, margins, and tab stops.

Using something earlier than FrameMaker 2020?

I’ve outlined an extra step for folks using FrameMaker versions prior to FrameMaker 16.0.1 (or 16.0.2, currently in beta)

Variations that require special handling in the TOC

Here are the three situations that I encounter, in order of frequency:

  • A single-line heading that breaks in the TOC
  • A multi-line heading that breaks in both content and TOC
  • A long heading that nearly fits, but drops the page number to the following line

See the sections below for specifics on solving your particular line break problem. If I’ve missed any, add a comment below. Of course, I’d also love to hear if these solutions help you out!

A single-line heading that breaks in the TOC

This is far and away the most common issue in my long TOC entries. It’s also probably the easiest to solve. There are two components to getting this cleaned up.

First is the settings for the paragraph style. By setting the First and Left indents to the appropriate location, the content will nest on the second line automatically. NOTE: if you are displaying section or chapter numbering, you may have to set the Left margin (represented by the lower triangle) to the same position as your tab stop, as you would for a list paragraph.

Once the left edges align properly, you may have text that runs up or into the column-ish area where page numbers exist.

You can use nonbreaking spaces (NBS) to drag that extra content down to the next line. The NBS basically tells FrameMaker to treat the text range as a single word. The NBS displays as a small square u-shaped bracket in between the words that are “glued” together. To enter a nonbreaking space, navigate to the location in the content (not the TOC entry!) and press Control+Spacebar on your keyboard.

In this case, the heading works in the content itself, but is too long for the space allotted in the TOC. As a result, the word and is running into the area reserved for the page reference. This is easily fixed by replacing the ordinary space between and and small with an NBS.

After updating the book, the entry looks like this:

It’s important to note that you can use as many NBS as you like to keep phrases together in the TOC.

A multi-line heading that breaks in both content and in TOC

If you have a heading that forces multiple lines in the content, you may still be able to use NBS to dictate breaks, but you can also use a forced line break (shift+return) in the content to designate where the heading should break in both content and TOC.

NOTE: Forced line breaks and NBS should be placed in the content. A line break (or NBS) placed in the TOC will be washed out with the next book update.

A long heading that drops the page reference to the next line

In the image above, the page reference of the Advantages section drops to the next line. It requires a very narrow character count range to drop only the page reference, but it does happen. The most elegant way to fix this problem is to edit the headline so that it contains more or less characters than the current version.

If editing the headline is not possible, you can also try narrowing the margins of your TOC entry. Reducing the overall width of the text area by even 1/8″ for that style in the TOC can push the long heading into two lines, giving you the ability to use an NBS to manage breaks more easily.

For users of legacy versions of FrameMaker

Sometime between the initial release of FrameMaker 2017 and now (FrameMaker 2020, v16.0.1) Adobe patched a small oddity in multi-line TOC entries. In versions prior to 16.0.1, you may need to enter a second tab character before the <$pagenum> entry in your TOC paragraph style to push the page number out to the proper position when broken into two lines.

Join over 4,300 of your peers and get my latest content sent to you for free, along with some of my all-time favorites.

Guaranteed spam-free! Powered by ConvertKit

1 Comment

  1. Christian on September 29, 2022 at 1:06 am

    Hi!
    Thanks, but all your ways are way too manual. Especially when using Mini-TOCs it is not possible to edit the TOC manually. I know that these are the common ways to correct the line breaks. But I recommend using this technique here:
    https://community.adobe.com/t5/framemaker-discussions/in-fm-10-table-of-contents-wraps-ok-except-the-page-number/m-p/3481473?profile.language=de

    By setting these “crazy” word spacing values in your TOC paragraph formats the words will break into the next line automatically before they collide with the page number.

    At the moment I created a document in >20 languages and this method works very good. Every TOC in every language looks good by default.

    But it seems you have to have TOC lines long enough to include at least 4-5 words. A few years ago I tried the “word spacing” method with TOCs that had the space of a HALF page only. There I had the situation that only 2-3 word fitted into one line per heading. Then this method worked still good – but not perfect in all situations.
    But with TOC lines over the whole page width it seems to work just fine.

    Good luck 🙂

Leave a Comment