Menu

Need training at your office? Request a quote for custom training.

Home / Adobe FrameMaker / Adobe FrameMaker: The page count variable for books

Adobe FrameMaker: The page count variable for books

by Barb Binder, Adobe Certified Instructor on FrameMaker
Updated: Oct 20, 2022

NOTE: This method will still work in any version of FrameMaker. However, the process has been greatly simplified with the Fall 2022 release of FrameMaker (v17). See Adobe FrameMaker: Tracking the Last Page Number in a Book.

In a previous post (Adobe FrameMaker: The page count variable for chapters), we learned how to track and reference the page count of a single chapter. But what about trying to keep track of the last page of a multi-chapter book? That question was posed recently by one of my Advanced FrameMaker students. Turns out it can be done, it just takes a little creativity and more than a little patience. (If you need it, though, it’s well worth the effort.)

Here’s the big picture: you are going to insert a frame on the first page of the last chapter of your book, add the page count variable into the frame, and hide the evidence. You’ll finish up by adding a cross-reference to that variable in the running heads of all the master pages of your book.

Note: Before you start, make sure you have your page numbers displaying properly in your running heads, and that you have set your Page Number properties set to Continue Numbering from Previous Page in Book.

To add the final page count of the book to your running heads:

  1. Open the last chapter in the book list and add a frame in the margin on the first page:
    • Choose View > Toolbars > Graphics Toolbar.
    • Select the Text Frame tool.
    • Draw a small text frame in one of the margins and click Set when presented with this dialog box:
      Adobe FrameMaker: Page Count Variable
  2. Add the Page Count variable to your frame:
    • Click inside the new frame. The frame should be empty, except for your blinking insertion point (and the End of Flow marker, if showing).
      Adobe FrameMaker: The text frame that will hold the Page Count variable
    • Choose Insert > Variable (FrameMaker 2015 and earlier, it’s Special > Variable) to open the Variables panel. Add the Page Count variable (double click to insert, or click once on the name, and click the Insert button on the Variables panel toolbar). The last page number of that chapter will appear at the cursor position.
  3. Hide the variable from your readers:
    • Create a paragraph style for the variable and store it in the Paragraph Catalog. I called mine PageCount.
      Adobe FrameMaker: Page Count Variable
    • You don’t want anyone (besides FrameMaker) to see the variable in the margin, so set the paragraph’s color to White, and create a new style. The frame will still be visible, but the text disappears.
  4. The next step is to add a cross-reference to this now-hidden text.
    • View > Master Pages
    • Locate your Page Number variable (it’s the #) and click an insertion point to the right of it. Tap the spacebar, type the word “of” and tap the spacebar again.
    • Choose Insert > Cross-Reference (FrameMaker 2015 and earlier, it’s Special > Cross-Reference).
    • In the Cross-Reference panel, set the Document to Current, the Source Type to Paragraphs, your Paragraph tag to PageCount, and click on the page number in the Paragraphs list. (Even though it is the only item in the list, you still need to click on it.)
       Adobe FrameMaker: Page Count Variable Adobe FrameMaker: Page Count Adobe FrameMaker: Page Count Variable
    • Click the Edit Format button to set up a custom cross-reference format: give it a name (I again called mine PageCount), delete the current definition, and replace it with <$paratext>. Click on Add, Done, and then Insert to insert the variable into the running head.
    • Adobe FrameMaker: Page Count Variable
  5. Wow—almost there! Finish up by putting the cross-reference in the running heads on each master page of that file. Save your work!
  6. To add the updated running head to all the other files, use File > Import > Formats to import the new cross-reference format, the page layout format and the new paragraph format to the other chapters in your book.

Fussy? Yes! But it works.

Related post

Adobe FrameMaker: The page count variable for chapters

Adobe FrameMaker: Tracking the Last Page Number in a Book

Adobe FrameMaker: Variables

Adobe FrameMaker: Master page basics

Leave a Comment

Your email address will not be published. Required fields are marked *

3 thoughts on “Adobe FrameMaker: The page count variable for books

  1. Hi,

    I found this page while looking for a solution to a similar problem. I’m hoping you can help.

    What I need to do is include the beginning AND ending page numbers for each section in a Table of Contents. I have no problem with the beginning page number (as that’s natural in a TOC) but can’t figure out how to get the $lastpagenum to show up.

    I expected this (on the TOC reference page) to work:

    <$paranum> <$paratext>    <$chapnum>-<$pagenum> — <$chapnum>-<$lastpagenum>
    But this is what shows up on the TOC:
    D. Project Description          D-1 — D-<$lastpagenum>

    Any ideas?

    Thanks.

    1. Hi Kathryn: That’s a tricky one. I think I would switch gears and set the TOC up as a chronological index, and use the <$startrange> and <$endrange> building blocks. Otherwise, you are looking at adding a cross-reference to a reference page. I can’t imagine it would remain after you update your book.

      ~Barb