Accessibility

TechNote

How to Obtain the Total Page Count across All Files in a FrameMaker Book

If you insert the "$lastpagenum" variable in the header or footer of a file within a book, the header or footer will show the number of pages for the individual file rather than the entire book. To include the total number of pages of a book (e.g., "4 of 200"), you can use a cross-reference to a special paragraph you create in the last file of the book.

This procedure works best when all files in the book use the same master pages, and it should be completed after all chapters have been added to the book.

To obtain total page count, complete the following steps:

1. Set up the files in the book to use continuous page numbering:

a. Open the FrameMaker book file.

b. Select a file that you want to include in the total page count and then choose File > Set Up File.

c. Choose Continue from the Page Numbering pop-up menu and then click Set.

d. Repeat steps 1a-1c for additional files. If you do not want to include certain files in the total page count (e.g., TOC, IX), place them at the end of the book by choosing File > Rearrange Files.

2.Create a new paragraph that contains only the page count of the last file in the book:

a. Open the last file in the book that you want to include in the total page count and then choose View > Master Pages.

b. Place an insertion point in the header or footer of any master page, and then press Return to create a new paragraph. (If you cannot see the insertion point, you may have to enlarge the text frame of the header or footer.)

c. Choose Format > Headers & Footers > Insert Page Count to insert the page count variable in the new paragraph.

d. Choose Format > Paragraphs > Designer and create a new paragraph tag called PageCount. Select Store in Catalog and Apply to Selection, and then click Create. You will reference the PageCount paragraph tag from other files in the book.

e. To hide the PageCount paragraph so it won't appear on body pages, either reduce the text frame of the header or footer or set the paragraph's color to white.

f. Save the file without closing it and then click the book file window to make it active.

g. Choose File > Import > Formats; make sure that the last file of the book appears in the Import from Document pop-up menu.

h. In the Import and Update field, select Paragraph Formats and Variable Definitions, and then move the files you want included in the total page count to the Update window. Move the files you do not want included to the Don't Update window.

i. Click Import and then close the last file in the book.

3. Change the header or footer formats in all files of the book to cross-reference the PageCount paragraph:

a. Open the first file included in the total page count and then choose View > Master Pages.

b. Choose Special > Cross-Reference, and then click Edit Format.

c. Click Add to create the cross-reference.

d. In the Name field, type "TotalPages." Remove the contents of the Definition field, and then select "<$paratext>" from the Building Blocks scroll list.

e. Click Done. Click Done again.

f. Modify the page number format of the header or footer of each master page. For example, change "Page #" to "Page # of".

g. Place the cursor after "of" and then choose Special > Cross-Reference to insert a cross-reference. In the Document field, select the file that will be last in your book to display the total page count.The file should still be open.

h. In the Paragraph Tag list, select the PageCount paragraph tag. You should see only one paragraph listed. (The number of pages may not be accurate.) Select this paragraph; in the Format field, select the TotalPages cross-reference format and then insert the cross-reference.

i. Repeat steps 3a-3h for any remaining master pages whose body pages need to display the page number.

j. Save the document and then return to the book file window.

k. Choose File > Import > Formats; select Page Layouts and Cross-Reference Formats, and then in the Import From Document field, select the first file in the book. Import the formatting to all the files in the book that need to reference the total page count.

4. From the book file, choose File > Generate/Update.

Note: You may need to repeat step 4 to see the correct total page count. (Often the page count may be incorrect if you added pages to any file in the book other than the last one.)

If this procedure is implemented incorrectly, the generate process may get stuck in a loop and FrameMaker will return the error, "Book not self-consistent."

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:317108
OS:Unix

Products Affected:

framemaker