Where to add page numbers, master or subdocuments?

In OpenOffice (I am currently porting my documents from there, though I did not use templates), I was always able to use page numbering in sub-documents and they followed through when added to my master document. Now, because I am using templates, it appears that template updates (any change to a template), kind of resets the page field in the footer, that is, it is removed! I am not sure why.

If I insert a page field into the footer of one of my sub-documents, it does not automatically appear in the master when refreshed. It is not until I actually add the page number fields to the different page styles in the master do they actually appear and are somewhat managed correctly. That is, until my template is updated again and brought into the master document, then they disappear.

Since the LibreOffice User Guide is a bit vague on where the page number field should be inserted and maintained (master or sub-document), can someone give me the unofficial rules for this?

Edit yur question (don’t use an answer) to describe the page style(s) attributes in the template, mostly the differences between the template page configuration and the use of the page style in the master and subdocs.

I assume that all the involved pages are styled by the same style (no name difference).

What I’m interested in is whether the footer is already enabled in the template (eventually with the page number field already in place). Do you make any manual change in the subdocs page or do you use the template page style as is?

When using templates, you must be careful of the order of application of the update when there are manual changes.

All pages are using the same style, there are no name differences.

As for the footer, yes it is enabled in the template, but no page number field is there. Is that the problem? Should I remove that from the template, or add the page number field to the footer to get desired results?

For now, I have just been updating the master document footers with the required field for page numbers, it does not really matter whether or not the sub-documents have them.

Bounce, can someone answer my questions above?

When using master and subdocuments, it is fundamental to understand that the master takes the lead when the final document is assembled.

Content of the subdocs is imported into the master and the present configuration of styles in the master drives lay out.

Since all your documents are based on the same template (hence all styles have the same names), you would expect that the complete subdocs formatting would be transferred unaltered to the master.

This assumption is correct for paragraph, character, frame and list styles because there is reason to fiddle with them.

This is not the case for page styles. Remember that pages do not exist per se in Writer. They are utility objects allocated on demand to host text flow. Consequently, pages are allocated in the master based on master page styles. Header and footer are attributes of page styles. Therefore, when master page styles are used (i.e. in the master to allocate pages), there is no reference to the subdocs page styles beyond just the name to display content in the right context.

The lesson is: if you added something in the subdocs with regard to template bare description, this addition is not present in the master and won’t appear there. For instance, you added page number field in a subdoc, the page number won’t transfer to the master, you must also add it there. The same goes for chapter title in headers.

The best way to handle this is to put the page “decoration” in the template. No problem for page number. However, since a page style can have only a single header, you can’t hard code the chapter title in there (otherwise all your chapters will bear the same title). The solution is to use a cross-reference to capture the current Heading 1 content.

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!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

Very good explanation of this design point, finally it is written down somewhere. Can I suggest you adding this to the Writers Guide somewhere? In any case, I accept this solution.

I’m no developer, just an enlightened user. Maybe I should participate in documentation writing. But time is a scarce resource …