Export to PDF and headers

Herve Frydlender
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2019

Hi,

I used a pretty clean PDF export style-sheet including some numbering and formatting of headers ;

...

/* Title */
h1 {
text-align: left;
font-size: 24pt;
font-variant: small-caps;
font-weight: bold;
padding: 200px 0px 0px 0px;
}

/* Add numbering to section headers h2 to h4 */
body {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
h4 {counter-reset: h5}

h2.ncount:before {content: normal}
h2:before {counter-increment: h2; content: counter(h2) ". "}
h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) ". "}
h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ". "}
h5:before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) ". " counter(h5) ". "}

/* Page break before main sections */
h2 {
font-size: 20pt;
page-break-before: always;
page-break-after: avoid;
}

h3 {
font-size: 14pt;
page-break-after: avoid;
}

...
 

 But since Confluence 6.13 headings are not demoted anymore.

I updated my CSS for my headers to start at h1, but how do I specify a different format for the title?

I tried to differentiate the title using #title-text and/or .title-heading, without success.

In the mean time, exported PDF with an empty style-sheet clearly shows a difference between page title and Heading 1. So their is a way to do it.

Anybody with an idea, a copy of the default CSS applied, or some instructions?

 

3 answers

1 accepted

0 votes
Answer accepted
Herve Frydlender
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2019

Here is a work around : 

...
/* Title */
h1:first-child {
    text-align: left;
    font-size: 34pt;
    font-variant: small-caps;
    font-weight: bold;
    padding: 200px 0px 100px 0px;
}
...
2 votes
Herve Frydlender
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2019

And here is another one, maybe "cleaner":

...
/* Title */
h1.title-header {
    text-align: left;
    font-size: 34pt;
    font-variant: small-caps;
    font-weight: bold;
    padding: 200px 0px 100px 0px;
}
...
0 votes
Simon Tost _TNG_ March 18, 2024

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events