Keeping sections together in a PDF file

Our wiki consists of various topics. Each topic has a header, a screen shot of the dialog, and a table that explains the options in the screen shot. When I export the space into a PDF file, the heading appears on one page, and then then the screen shot appears on the second page.

Example of page 1:

Heading 1

Screen shot

Heading 1

Page 2:

Screen shot

Heading 1

Page 3:

Screen shot

In RoboHelp, I was able to keep topic headings with the screen shot. This was similar to using "Keep with next" section breaks in MS Word. If the screen shot did not fit on the first page, the heading 1 would appear on the second page with the screen shot.

I found some information in the wiki user reference documentation that shows how to edit the PDF style sheet and create a page break after each topic. This does not solve the issue. I am left with topic headings that appear on a page by itself.

  1. .pagetitle
  2. {
  3. page-break-before: always;
  4. }

I could possibly change the page top/bottom margins, but I don't think that will work. Basically, I want to keep the heading so that it appears on the next page with the screen shot.

Are there any suggestions on how I would be able to use "Keep with next" like I would in MS Word?

2 answers

This widget could not be displayed.

The 'keep with next' is not really implemented. What I normally use to force a page-break in the pdf document is the {divbox} macro, like {divbox:class=pagebreak}{divbox}. The class pagebreak is then a (custom) css class in your PDF stylesheet with a page-break-before.

But we have also implemented the pagebreaks on PDF's. You should then set the page-break-before style on the h1 tag instead of the pagetitle class, like:

h1 {

page-break-before: always;

}

The solution helped, but I am still having some issues. In the PDF, I am actually using H1, H2, H3. I inserted page breaks on H1, but it caused some issues where there was H3 on a page, and a screen shot on the next page.

I then tried using a page break on H1 and on H3. That almost solved the problem. I skipped through the document and I have some blank pages. I think it's because there is some white space and then it breaks when it find the H3 heading.

I think I may need to manually insert the page breaks within the document using a macro. I am not sure if that would still fix the problems with the blank pages that end up in the PDF file.

Is there a feaure request for "keep with next"? If so, what is the status in having it implemented?

I tried using a page break. I still end up with a heading on one page and an image on the next page.

Is there a feaure request for "keep with next"? If so, what is the status in having it implemented?

This widget could not be displayed.

I have the same need.  Whenever I include a large screenshot, it flows to the next page while leaving the description paragraph in prior page.  

Is there any solution?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 2 hours ago in Europe

Speaker Required!

Hey, We're currently organising an AUG event on Tuesday the 23rd of October. It's being hosted by Tata Consultancy Services near High Street Kensington station. We currently require one more spea...

23 views 0 0
View post

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