Invalid page count in multiple page numbering with template and page styles

Using LibreOffice 5.1 on Ubuntu 16.04.

I was looking through this forum and online searches with page numbering with multiple page styles. However, I have not been able to find something that allows me to do a Template to start from.

Thus I started a Template to start from as I need to create 3 documents in the same style. I have achieved several things in this template but there are still some issues I was hoping someone could please help me resolve.

The issue is primarily in showing the correct Page Count within a set of pages defined by a Page Style.


In the Template I was able to have five (5) different Page Styles. And on each page style I am able to start new numbering.

However the issues are:

1) Total Page Count in Template shows 9 although I have a total of 5 pages (ie Page Styles as well).

2.a) In Template (in footer for each Page Style) I tried to: Insert > Fields > More Fields > Variable: Set Page Variable(ON), Show Page Variable.

2.b) I don’t know what exactly this does but when I add more pages within a Page Style it shows them as 1/1, 2/2 rather than 1/2, 2/2 etc.

3) In Template (in footer for each Page Style) I also tried to: Insert > Fields > More Fields > Formula. However this does not work either. I set Formula by seeing a post that said set Formula to be Page Count - the Page Number there this Page Style starts. But my Page Count is wrong to begin with.


What I would like to happen

Ideally I would like to show 4 numbers, of which # 1 is achieved and # 3 is most important.

  1. Actual Page Number in light of set of pages defined by a Page Style.

  2. Actual Page Number in light of entire document even though I set Page Number for a Page Style to Restart Numbering.

  3. Page Count within a set of pages defined by a Page Style.

  4. Total Page Count of entire document. I thought this would be the easiest. Not sure why it is showing 9 when I have 5 currently.


Thank you much for your help and suggestions.

Mono