Content and index pages break after the heading

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

Content and index pages break after the heading

Post by Dodo1 »

Another problem emerged in my projects - while outputting to pdf, the index and content chapters break weird. The problem is that the Heading for the sections is on one page, but the content (or index) start on the next page. I'm quite sure that word output didn't do that and I think that even the pdf just after I changed the output from the MS word to pdf was OK in this way. On the other hand, the stylesheet had to go through major changes and cleaning at the time, and I'm not able to find the source of the page break inserted. Can anyone help with that?
Here is the part of the code I think is responsible for the behavior:
I have a content.htm page for the content, which looks this way:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" class="" MadCap:lastBlockDepth="3" MadCap:lastHeight="507" MadCap:lastWidth="968">
    <head>
        <link href="../Resources/Stylesheets/Styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <p class="content">Contents</p>
        <MadCap:tocProxy class="" />
    </body>
</html>
As you can see, I mimic the h1 style by the p.content style, but even when I have the ontents inscription closed into the h1 tag, no change happens. I use TOC depth for determining the heading level. Analogically, the index looks this way:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:conditions="Default.PrintOnly">
    <head>
        <link href="../Resources/Stylesheets/Styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <p class="content">Index</p>
        <MadCap:indexProxy class="" style="mc-index-header-height: 0.5in; mc-index-headings: true; mc-column-count: 2; page-break-before: avoid;" />
    </body>
</html>
There is only one stylesheet defined in my project for non-table styles, the styles.css, which I add zipped as an attachment. The relevant parts of the file (as I think) are (as defined in the print media):

Code: Select all

p.content {font-size: 18pt; font-weight: bold; page-break-before: always; page-break-after: avoid; margin: 9pt 0pt 9pt 0pt;}
MadCap|indexProxy.index {font-style: italic; page-break-before: avoid;}
MadCap|tocProxy {border-top-style: none; page-break-before: avoid;}
Still, the page break after p.content paragraph and before index proxy and TOC proxy occurs. I tried everything, including setting the page-break-before(after) tags directly into the code and not onto the css, but with no success. Also, searching this forum is not easy as majority of words I would like to search for (e.g. index, TOC, Content...) is banned by the search engine. Can anyone suggest where to look further?
You do not have the required permissions to view the files attached to this post.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Content and index pages break after the heading

Post by LTinker68 »

How do you have your p.TOC1, p.TOC2,... and p.index1, p.index2,... styles defined? (If at all.)

Also -- and this is most likely the problem -- when the output is generated, the tocProxy (and presumably the indexProxy) are put inside a DIV. For the tocProxy, the class is called MCTocProxy. If your base DIV tag in your main topic stylesheet is set to page-break-before:always or page-break-inside:avoid, then the MCTocProxy div class's default style is being overridden, so the generated TOC is either breaking before or avoiding breaking inside. If your base DIV tag is set up with one of those attributes, then insert the opposite value in your topic stylesheet for the appropriate div class. For example...

Code: Select all

div.MCTocProxy
{
     page-break-before:avoid;
}

Unfortunately, there is no page-break-inside:always option (why, I have no idea), so if you have your base div set to page-break-inside:avoid, then you need to remove that attribute from your base div tag in your topic stylesheet.

The tocProxy output (and again, presumably the indexProxy output -- I didn't test it) is in a table, and there are a table class and td class that might have some style definitions that are causing a problem. However, it's most likely your base div that's the problem, as I've never had the break occur in my generated TOCs, so I don't think it's a default style in the classes created for the tocProxy.

BTW, to see what tags Flare puts around the code, generate the output as WebHelp then look at the source code for the topic in the browser. You'll also notice that Flare added a MadCap.css reference to the top of the topic, which is where the div.MCTocProxy and other classes are defined, but your topic stylesheet is referenced after the MadCap.css file, which is why adding the style definition to your topic stylesheet overrides the default style definition in the MadCap.css file.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Dodo1
Propeller Head
Posts: 23
Joined: Tue Nov 18, 2008 6:39 am

Re: Content and index pages break after the heading

Post by Dodo1 »

Thank you, Lisa,
the cause was, of course, the div tag property - I only have three div styles used and defined in the stylesheet, and all of them should behave in the same way (note, caution, tip), e.g. in the print output non-break inside. I have generally set the property o the div tag to "page-break-inside: avoid", so removing this to the specific subclasses resolved the issue (and also responded on my question for why I wasn't able to customize the padding/margins of the index - I wasn't aware of the div tag around the index and content at all.

Thank you very much once more,
Best Regards,
Daniel
Post Reply