We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

How to get #pages in a chapter (e.g. #pages using a Page Style)?

asked 2020-06-08 23:05:24 +0200

jimav gravatar image

I have a document with several "chapter"s. Each "chapter" uses its own Page Style, with it's own footer, and restarts page numbering at 1 on the first page (specified in the manual Break which switches to the next chapter's Page Style).

How can I put the total number of pages in the current chapter in the footer (e.g."Page 1 of 17" where there are 17 pages in the current chapter)?

Note that Insert->Field->Page Count (or Insert->Field->Statistics... Pages/AsPageStyle) inserts the total number of pages in the whole document, not the number of pages which use the current Page Style.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2020-06-09 07:09:09 +0200

ajlittoz gravatar image

See my answer in question https://ask.libreoffice.org/en/question/193822/writer-section-page-count-in-footer/

It provides a fully automatic solution without the need of manually setting a variable.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

edit flag offensive delete link more

answered 2020-06-08 23:15:38 +0200

RGB-es gravatar image

Right now there is no way of doing that automatically. A workaround is to define a variable and cross reference it in the footer, to then manually redefine it at the beginning of each chapter assigning to that variable the number of pages of that chapter. See this article for a detailed explanation of this workaround: Writer: An Extreme Example of “Variables” Use

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-06-08 23:05:24 +0200

Seen: 41 times

Last updated: Jun 09 '20