We are using Confluence as our documents with a space template to create numbered sections, but that formatting does not export to Word or PDF. How do I get the section numbers to export?
To further clarify:
I use a space stylesheet (CSS) to create numbered headings. However, while the effects of those styles show on the page in Confluence, when you export, the numbering does not display in the exports. I tried cutting and pasting that stylesheet into the PDF stylesheet but it does not work. Headings are like this:
1. Heading 1
1.1 Heading 2
1.1.1 Heading 3
1.1.1.1 Heading 4
etc.
I know the TOC macro shows the heading numbers, but I need the heading numbers shown in the body of the document, not just in the table of contents. We are using Confluence pages as documents. We need the exports to share with people outside of Confluence to comment on the documents.
For everyone looking, Chatgpt gave the correct answer.
body { counter-reset: heading1_counter; }
h1 { counter-reset: heading2_counter; }
h2 { counter-reset: heading3_counter; }
h1:before { content: counter(heading1_counter) ". ";
counter-increment: heading1_counter; }
h2:before { content: counter(heading1_counter) "." counter(heading2_counter) ". ";
counter-increment: heading2_counter; }
h3:before { content: counter(heading1_counter) "." counter(heading2_counter) "." counter(heading3_counter) ". ";
counter-increment: heading3_counter; }
Hi Debbi,
Based on your code, I put my code as below and it works for chapter. I did same way in h2/h3 but it doesn't work as expected.
----------------------------------------
body {
counter-reset: heading1_counter;
}
h1:before {
content: counter(heading1_counter) ". ";
counter-increment: heading1_counter;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Debbi,
How are those numbered sections created? Are you using the numbered heading macro for that?
Can you share the storage format of an example page?
Best,
Nils
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, cannot use that macro. we cannot buy anything right now, although I wish I knew how to create that. Even free plug-ins that are not from Atlassian have to go through rigorous review. I am using a space style sheet. Is there a way to embed a style sheet in a document that would export, rather than by space? I may want to post that as a separate question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Debbi,
Thanks for the update - using stylesheets you're changing the way the content is displayed, but this information is not stored in the storage format which is used for the export.
You'd need to find a way to get the numbers inserted in the storage format (e.g. using a macro), or change the PDF stylesheet.
An easier way (allowing you to have multiple templates per space or globally and giving you more enhanced customization options) would be to have a look at our Scroll PDF Exporter - but if you can't get any apps right now, you might need to check the PDF stylesheet options.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I copied the css stylesheet used for Confluence to the PDF stylesheet, but it is not working.
This is what I have:
body {
counter-reset: h1-counter;
font-style: normal;
font-variant: normal;
font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
}
#main-content h1:before {
content: counter(h1-counter) " ";
counter-increment: h1-counter;
}
#main-content h1 {
font-size: 24px;
font-weight: 500;
line-height: 26.4px;
counter-reset: h2-counter;
}
#main-content h2:before {
content: counter(h1-counter) "." counter(h2-counter) " ";
counter-increment: h2-counter;
}
#main-content h2 {
font-size: 22px;
font-weight: 500;
line-height: 24px;
counter-reset: h3-counter;
}
#main-content h3:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) " ";
counter-increment: h3-counter;
}
#main-content h3 {
font-size: 20px;
font-weight: 500;
line-height: 22px;
counter-reset: h4-counter;
}
#main-content h4:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) " ";
counter-increment: h4-counter;
}
#main-content h4 {
font-size: 18px;
font-weight: 500;
line-height: 20px;
counter-reset: h5-counter;
}
#main-content h5:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) "." counter(h5-counter) " ";
counter-increment: h5-counter;
}
#main-content h5 {
font-size: 16px;
font-weight: 400;
line-height: 18px;
counter-reset: h6-counter;
}
#main-content h6:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) "." counter(h5-counter) "." counter(h6-counter) " ";
counter-increment: h6-counter;
}
#main-content h6 {
font-size: 14px;
font-weight: 300;
line-height: 16px;
}
#main-content p {
font-size: 14px;
font-weight: 400;
line-height: 20px;
}
#main-content blockquote {
font-size: 21px;
font-weight: 400;
line-height: 30px;
}
#main-content pre {
font-size: 13px;
font-weight: 400;
line-height: 18.5714px;
}
.mceContentBody h1:before {
content: counter(h1-counter) " ";
counter-increment: h1-counter;
}
.mceContentBody h1 {
font-size: 24px;
font-weight: 500;
line-height: 26.4px;
counter-reset: h2-counter;
}
.mceContentBody h2:before {
content: counter(h1-counter) "." counter(h2-counter) " ";
counter-increment: h2-counter;
}
.mceContentBody h2 {
font-size: 20px;
font-weight: 500;
line-height: 20px;
counter-reset: h3-counter;
}
.mceContentBody h3:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) " ";
counter-increment: h3-counter;
}
.mceContentBody h3 {
font-size: 14px;
font-weight: 500;
line-height: 15.4px;
counter-reset: h4-counter;
}
.mceContentBody h4:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) " ";
counter-increment: h4-counter;
}
.mceContentBody h4 {
font-size: 12px;
font-weight: 500;
line-height: 12px;
counter-reset: h5-counter;
}
.mceContentBody h5:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) "." counter(h5-counter) " ";
counter-increment: h5-counter;
}
.mceContentBody h5 {
font-size: 12px;
font-weight: 400;
line-height: 12px;
counter-reset: h6-counter;
}
.mceContentBody h6:before {
content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) "." counter(h5-counter) "." counter(h6-counter) " ";
counter-increment: h6-counter;
}
.mceContentBody h6 {
font-size: 10px;
font-weight: 300;
line-height: 12px;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Will the Table of Contents macro work for you? It provides clickable links and anchors in exported PDFs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.