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

How to create variables for "Page [page number] of [total pages in book]"

Participant ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

Hi, helpful people!

 

I'm hoping this is an easy question to answer. It seems simple enough, but I haven't been able to find anything in the available resources.

 

I have a book that consists of a dozen or so chapters of 10-12 pages each, giving me a book of approximately 140 pages.

 

The book applies for multiple different products, where I use conditional text for each product. So the total page count is unique for each product's version of the book.

 

The pages are numbering correctly throughout, but I want to have the page number in the footer read as "Page [page number] of [total pages in book]" -- for example, "Page 47 of 140." I know that the variable "$curpagenum" will give me the current page number, but is there a variable for "total pages in book"? If not, how would I create one? Would I need to make it a user variable that I update each time I create a new version of the book?

 

Thanks, and apologies if this has been addressed elsewhere.

TOPICS
Formatting and numbering

Views

504

Translate

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 ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

Votes

Translate

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 ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

Wow, Jeff. I haven't see that post in a while.

 

Ennar, note that it was written for an earlier version of FrameMaker—it still works, but remember that the old Special menu was renamed Insert. So, Insert > Variables and Insert > Cross-References. Any other questions, just ask.

 

~Barb

Votes

Translate

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 ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

You know about <$curpagenum>. There is also a system variable <$lastpagenum>, but it appears to only reference the current file, and not the last page of the last file in a .book.

 

When I need to do this, I cross-reference to some object that is always on the last page of the last file, often a dedicated paragraph format named "EOD" (possibly invisible), and xref it by <$pagenum>.


The Master Page footer might then have:
Page <$curpagenum> of Xref
where Xref is to the EOD object, format <$pagenum>

Votes

Translate

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 ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

LATEST

A while back my coworker and I commissioned Rick Quatro to write a macro for us that would total the number of pages in a book based on the files selected and put the result in a variable that we then stuck in a footer to give us the x of y. He might be willing to sell that to you if you ask. 

Votes

Translate

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