When exporting to PDF I am trying to number my exported pages as headings in a manner which will match a ToC. I have added the following CSS to the Global PDF StyleSheet:
body
{ counter-reset: h2counter; }
h1
{ counter-reset: h2counter; }
h2:before
{ content: counter(h2counter) ".\0000a0\0000a0"; counter-increment: h2counter; counter-reset: h3counter; }
h3:before
{ content: counter(h2counter) "." counter(h3counter) ".\0000a0\0000a0"; counter-increment: h3counter; }
This is not functioning correctly on anything other than H2 titles (H1 are excluded to prevent the master page being numbered). Currently I receive export similar to the below:
Confluence Space-
Master page
Page 1
Nested page second level 1
Nested page second level 2
Nested page third level
Nested page fourth level
Page 2
PDF Export-
{ToC}
Master page title
1. First level heading one
1.1 Second level heading one
1.1 Second level heading two
Third level heading one
Fourth level heading one
2. First level heading two
I understand I have only implemented CSS for numbering of effectively 2 tiers of headings at this stage, I wanted to confirm functionality and it failed. The main issue is the lack of incremental numbering on the second level headings, if I can resolve this I can work on implementing the same fix for third tier onwards, any suggestions would be greatly appreciated.