# Separate page count for each style? [closed]

My document has several styles with headers. I would like to have my headers in the following form:

Text X of Y

where X is the page number for the corresponding style and Y is the page count for that style so that my headers would look something like this:

Chapter 1 page 1 of 10
Chapter 2 page 4 of 23
etc.


I can manage changing the page numbers for each style but I don't know how to count all the pages of a certain style only rather than the whole document. Can you help?

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2015-11-13 08:54:14.944652

Sort by » oldest newest most voted

Problem solved with a workaround:

1. Make a bookmark on the last line of a style: Insert > Bookmark
2. Name it like "LastPageSTYLENAME" where STYLENAME is the name of the corresponding style.
3. Make a cross-reference to it where you want the "page count for style field" to be: Insert > Cross-reference
4. Select type "Bookmark", select the bookmark you made, select "Page" for the "Insert reference to" option and click insert.
more

Well done. Good lateral thinking. I completely forgot about bookmarks and cross-references.

( 2013-11-09 03:49:57 +0200 )edit
1

This workaround works pretty well but is sensitive to the bookmark being accidentally deleted, especially in a multi-user environment.

This feature would be particularly useful for documents with a header section (cover, table of contents etc) but where the main text is to be formatted with "page n of x", which is a structure we use at work for our reports.

I see the bug/feature request is still outstanding.

( 2016-05-31 05:44:19 +0200 )edit

There is currently no field available to obtain a page count for a part / chapter / section within a document as this is not supported by the ODF v1.2 specification. Instead <text:page-count> (7.5.18.2) relates to the document as a whole:

The <text:page-count> element displays the value of the meta:page-count attribute of the <meta:document-statistic> element of a document. 19.332

It is probably possible to write a macro to calculate a required page count, but you will need to write the macro.

more

Question1:

Is there a workaround for this other than writing a macro? I read something about adding a bookmark somewhere and a cross-reference to it. Would it work?

Question 2:

How can I make a feature request for the LibreOffice developers to include a "Page count for style" feature in the future?

( 2013-11-08 13:11:08 +0200 )edit

( 2013-11-09 03:56:28 +0200 )edit
2

Reported as Bug 71583.

( 2013-11-13 17:16:05 +0200 )edit

Thanks. I have confirmed the bug report.

( 2013-11-14 00:07:50 +0200 )edit

Awesome. Let's hope the feature gets implemented.

( 2013-11-14 15:44:02 +0200 )edit

If you make different sections, and each section having a different stylem you should be able to page count by section and therefore by style?

more