How Do I Keep a Heading with the Following Text?

Catherine Anderson July 29, 2022

I am pdfing a Confluence page and want to keep the heading with the text that follows. Right now, the heading appears at the bottom of the page and the text at the top of the next page. How can I prevent that?

1 answer

1 accepted

1 vote
Answer accepted
Bill Bailey
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.
July 30, 2022

Welcome to the community, @Catherine Anderson ! I will assume you are using the builtin PDF export function. What you need to do is to edit/update the CSS stylesheet for the PDF export and add the following property to your headings,

page-break-after: avoid;

For example:

h1 {
margin-top: 20pt;
margin-bottom: 10pt;
font-size: 20pt;
page-break-after: avoid;
}

It may not always work, but it can help with keeping headings from separating across a page.

Details on editing the CSS are here:

https://support.atlassian.com/confluence-cloud/docs/customize-exports-to-pdf/ 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events