Add title numbering - PDF export

Hi,

How can I add the numbering to the various titles in the PDF export?

So when using the PDF export feature in Confluence, you will notice that Confluence will add a table of contents on one of the very first few set of pages. Well as part of the table of contents, are a set of numbers which are associated with each title (section).

How can I get the PDF export to add these numbers to the titles in the various different sections of the PDF document. It just adds the titles in bold but it does not add the title numbers.

 

Thanks, Dan.

1 answer

This needs to be done in the PDF export stylesheet.

As an example, you can open the confluencedefaultpdf.css (the default stylesheet) and have a look how the numbering for the table of contents is done (search for all the formats starting with "div.toc...").

The code I have created for the numbering of my h1 and h2 headings looks like this:

body {  
counter-reset: levelA;   
}  
h2:before {  
content: counter(levelA) ". ";  
counter-increment: levelA;  
}  
h2 {  
counter-reset:levelB;   
}  
h3:before {  
content: counter(levelA) "." counter(levelB) ". ";  
counter-increment: levelB;   
}

I tried this, but I could not get it to work :(

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

251 views 11 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you