Page break before chapters with unlinked topics in PDF

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Dodo1
Propeller Head
Posts: 23
Joined: Tue Nov 18, 2008 6:39 am

Page break before chapters with unlinked topics in PDF

Post by Dodo1 »

Hello,
I have a problem for which I can't find a solution. Maybe someone here will know the answer...
  • So, I have a pdf output of a large manual, containing 7 major chapters. These are totally OK to start on new pages, so I set them so.
  • In one of these chapters there is some 6 sections, defined as folders in the TOC (unlinked to any topics, as they bring only the topic name). I have set the Use TOC depth for heading levels and Inject Headings for unlinked books in TOC to on, and the chapter autonumbering works totally OK.
  • BUT, the unlinked book entries are formatted as h2 (correct), but they continue on the same page normal text from the previous section ended. This is a problem, as I would like to start these sections on a new page.
- The solution where even the h2 tag has page-break-before option defined is not viable, as on some pages, the h2 title follows right behind the h1 title. Making the page break into the h2 heading tag would make the page contain only the h1 heading, while the h2 heading would be present on the next page, and this is not the behavior I desire.
- I have tried putting a chapter break before the unlinked folder - that worked to the point that the section started on a new page. Great. Then, I found out that the section also incremented in the numbering - bad news. I was able to set the chapter number to the same value as the the section before, but the autonumber on the second place got reset to 1 no matter what I did. Now, the pages are correct, but after the chapter 4.2.12 (for example), a new section begins, and I'm not able to set its number to 4.3 with chapters 4.3.1 and so on, always it is 4.1 with chapters 4.1.1 and so on.
- As for now, I'm not able to insert the page-break-before to any text as there is no topic present for the sections.

The only possible way I can think of is to create 6 dummy topics with only the headings in them to link them to the sections, and inserting the page-break-before to their heading tags. This is rather clumsy and I would like to avoid it.

Does anyone have any idea on how to solve the problem (or if you are certain this is not possible, let me know so I will stop delving into the matter further, please)?
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Page break before chapters with unlinked topics in PDF

Post by lacastle »

did you try just making a new class under h2, like h2.new_page, and make it have a page-break-before? Then assign that style to the sections you want to start on a new page.
Dodo1
Propeller Head
Posts: 23
Joined: Tue Nov 18, 2008 6:39 am

Re: Page break before chapters with unlinked topics in PDF

Post by Dodo1 »

No, I did not try, but the solution could only work the other way around. Mind you, I have no place where to define the h2.new_page style as the desired entries in the pdf do not have any real topic, they are just insertions from the unlinked books in TOC.

Theoretically, it could work the way that the whole h2 would have the page-break-before property on, and I would have created the h2.no_new_page style that would have the page-break-before off. Then, I would have to change all of the h2 appearances in my projects to h2.no_new_page so that only the auto-inserted h2's would have the page-break-before enabled. This is not viable as the project is massive and the styling should be kept as simple as possible.

I would then might run into the same problem when I would want to use the same for h3, and the situation would repeat.
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Page break before chapters with unlinked topics in PDF

Post by Andrew »

Here is my horrible hackaround, but may work suggestion:

Make h2 page-break-before:always. Then, create a new class (you will have to do this in a text editor, as the Flare Stylesheet Editor does not support this):

Code: Select all

h1 + h2
{
page-break-before: avoid;
}
I've frequently had problems with page-break-before:avoid not working in Flare, but you can try this out to see if it works. The CSS selector X + Y matches a Y element that is directly preceded by an X element (so in your case, it matches an h2 that is directly preceded by an h1).

Hope that helps,
Andrew
Flare v6.1 | Capture 4.0.0
Post Reply