If ...
- you have a main ODT pod template that imports a sub-pod template via a do ... from pod statement,
- you use Renderer attribute managePageStyles with a value being an integer number,聽because you need to force page numbering from pages imported from sub-pod templates,
Then ...
- page styles must be explicitly set on your pod template.
Set a page style manually
By default, LibreOffice (LO) does not explicitly set the page style in a document. If you want to do it manually, open your sub-pod template, and, in the Styles sidebar, double-click on the desired page style. LO will define, on the first paragraph from the current page, a page break flagged with the selected page style. In the following example, I just created a complex sub-pod template: the page style is not explicitly set.
Indeed, if I check the first paragraph's parameters, no page break is set.
If I open the聽Styles sidebar and double-click on the default page style, nothing seems to happen.
But, behind the scenes, LO has applied a page break to the first paragraph.
Set a page style using osub
If you want to ensure a sub-pod template has a default page style being explicitly set, osub.py is made for you. When calling osub.py with, as arg, the absolute path to a sub-pod-template:
- if no default page style is explicitly applied, it will add, to the first paragraph of the first page, a page break being similar to the one added by LO when applying the page style manually, as in the example of the previous section,
- if a page style is already set, osub.py will leave the file untouched.
Reference
All program options are documented hereafter.
usage: osub.py [-h] [-c] path
聽
positional arguments:
聽 path 聽 聽 聽 聽 is the path to the odt file to update or check. When importing,
聽 聽 聽 聽 聽 聽 聽 聽via a do...pod statement, a sub-pod template into a main one,
聽 聽 聽 聽 聽 聽 聽 聽using parameter "managePageStyles" being an integer value, page
聽 聽 聽 聽 聽 聽 聽 聽styles must explicitly be defined in the sub-pod template. If
聽 聽 聽 聽 聽 聽 聽 聽it is not the case on the passed file, the default page style
聽 聽 聽 聽 聽 聽 聽 聽will explicitly be set (on the first document paragraph).
聽
optional arguments:
聽 -h, --help 聽 show this help message and exit
聽 -c, --check 聽set this option if you want to check the explicit presence of
聽 聽 聽 聽 聽 聽 聽 聽page styles in the file, without performing any actual change
聽 聽 聽 聽 聽 聽 聽 聽on it.