You may want a header or footer to show the total number of pages of a book—for example, 4 of 200 on page 4 of a 200-page book.
When you insert the page count in a file’s header or footer with the Page Count variable, the header or footer shows the number of pages in that file, not in the entire book. To show the number of pages in a book, you can use a cross-reference to a special paragraph you create.
Set up the files in the book for continuous page numbering.
Display the master page for the last page of the last file in the book, and place the insertion point in an otherwise empty paragraph of the header or footer.
Insert the Page Count variable by choosing
.Create a paragraph style for the paragraph with the page count and store it in the Paragraph Catalog. Having a unique format for this paragraph makes it easier to cross-reference it later.
If you don’t want the page count to appear where you put it, either resize the text frame, so the page count is hidden or set the paragraph’s color to white.
In the other files in the book, insert cross-references to the paragraph with the page count on the master pages in the header or footer. The cross-reference format should use the <$paratext>
building block.