Forum How do I...?

Bad page breaks.

rlpowell
So all the source of what I'm trying is at http://vrici.lojban.org/~rlpowell/media/public/prince/ , as are PDFs showing the output; search on "general index" to see the problem I'm describing.

Near the end there are 3 indexes, only one of which is of any significant length, the one with the h1 title "General Index".

The rest of the index is a series of dl elements with h3 elements and a div around both. Like so:

<div class="whole-index">
  <div class="titlepage">
    <div>
      <div>
        <h1 class="title">
          <a id="idm251920335072">
          </a>General Index
        </h1>
      </div>
    </div>
  </div>
  <div class="index">
    <div class="indexdiv">
      <h3>A
      </h3>
      <dl>
        <dt>accented letters
   SNIP


The problem I'm having is that the title, "General Index" shows up on a separate page from the actual index, for no reason I can understand.

If I set the "whole-index" div to inline-block, then that gets better, but the index runs right off the page without breaking.

In the directory I linked to are PDFs showing the two cases.

What I'd like, obviously, is for the page to have the title, then as much of the index as will fit on the rest of the page, then a page break, and so on.

Help?
mikeday
It looks like an unfortunate interaction with a rule in our default style sheet, that applies "page-break-after: avoid" to <dt> elements, to avoid separating them from the following <dd>. In this document there are is a sequence of <dt> elements one after the other, as a result they are stuck together like a block, and it is causing trouble with the page breaking.

You can fix the problem by applying this rule to undo the default:
dt { page-break-after: auto !important }

You could optionally add this rule to keep <dd> with <dt>:
dt + dd { page-break-before: avoid }

Sorry for the inconvenience!
rlpowell
So first off, *yay*, that totally worked!

Secondly, where can I see the default style sheets so I can debug future things like this?

And lastly, *love* the product! We're just going to do a test run on Lightning Source and if it prints OK I expect to be buying a single-user commercial license (I'm doing this for a small non-profit).
mikeday
The default style sheet is in /usr/lib/prince/style/xhtml.css, or Prince\Engine\style\xhtml.css on Windows.