Forum How do I...?

Styling of footnotes area

Brian Mottershead
How can I establish the height of the @footnotes area in the stylesheet? I've tried height and max-height, neither of which seemed to work. If I cannot specify the height of the @footnotes area what determines the maximum height?

What happens if the footnote text overflows the @footnotes area? Do the footnotes continue onto the next page?

To answer some of these questions, in the magic.xml sample, I put a third footnote on page 1. If it is short, it gets output below footnotes 1 and 2. If it is long enough (not very long), it gets put on page 2. This seems ok, since page 1 already has two footnotes; however, it doesn't take much text in footnote 3 before it gets put on page 2. If I make Footnote 3 quite long it overflows the footnote area of page 2 and spills into the bottom margin, going all the way to the page edge, where it gets clipped. The page number is still output in the bottom margin, but the overflowing footnote is printed over it. It is a mess. A page feed is done and there is a third page containing "www princexml com", with no trace of overflowed footnote. That there is a page 3 seems right since there wan't room for www princexml com on page 2 once footnote 3 landed there. But, obviously the long footnote didn't continue to page 3; it just overflowed into the margin until it was clipped by the page edge.

So, all in all, it does not seem that footnotes really work.
mikeday
At the moment it is not possible to specify a maximum height for the @footnotes area of the page. In the future we will add support for the max-height property on this area.

If footnotes are too long, they should continue on the next page. Can you send me (mikeday@yeslogic.com) your modified magic.xml in which the footnote overlaps the page margin? I'm having trouble reproducing the effect here.
Brian Mottershead
What is the height of the @footnotes box currently hard-wired to be? Whatever it is, it does not seem like the current setting will accomodate much in the way of footnotes. I will send you my magic.xml.
mikeday
It should dynamically increase as necessary to fit the footnotes. However, sometimes a footnote cannot be added to the current page, as it will increase the height of the @footnotes area and push the actual footnote call to the next page. Since footnote text should never appear on the page [em]before[/em] the actual footnote call, the footnote text will be delayed until the next page in this situation. This commonly affects footnotes that are near the end of the page.
Brian Mottershead
I didn't keep my modified magic.xml, and now I cannot reproduce the problem that I described above.
mikeday
No worries, but do let us know if it happens again. It might be possible to trigger odd behaviour by creating footnotes containing lots of unbreakable content, such as large images or tables with page-break-inside avoid specified. But they should work correctly for most common cases, in which they contain simple paragraphs of text.
Brian Mottershead
The example that was triggering it was just the words "This is a longer footnote", repeated many times, wrapped in a div of class="footnote". So the trick in reproducing it is to find exactly where I was putting it. It was somewhere around the SVG element that does the crown thingie, a place where the footnotes lands on the first page provided the footnote text is short.
somnath
Hi Mike,

Just repeating the same question again, can we specify maximum height for the footnotes area?

I'm processing legal documents that have huge number of small & long footnotes. The problem is when there is a long footnote, it occupies the whole of the next page and ends by itself with no other text. I would want at least couple of lines above the footnotes.

Can you help with any work around or so?


Thanks in Advance,
Somnath
somnath
Hi, I found a workaround to split such long footnotes onto separate pages. Using float bottom-next inside display footnote does the trick. For example:

<div style="display: footnote;">
  <p>....</p>
  <div style="float:bottom-next;">
    <p>....</p>
    <p>....</p>
  </div>
</div>

This even works for "spans" set to block display.

~Somnath
mikeday
Very creative! :)
mikeday
Prince 9 is out now, and supports the max-height property on the @footnotes area, allowing you to force long footnotes to break to the next page.
_savage
On a related note: how can I change the length of the line atop of a footnote? Currently I use the border-top property, but that stretches across the whole page. Can I shorten that, say to 1/3 of the page or so?
mikeday
You can use the border-clip property, eg.
@footnotes {
    border-top: ...;
    border-clip: 33%
}
_savage
Hum... I have this in my stylesheet
@page {
  ...
  @footnotes {
    border-top: thin solid gray;
    border-clip: 33%;
    padding-top: 8pt;
  }
}

and still a grey line spanning the page. Is there another setting I might miss?
mikeday
Woops, sorry; I forgot that Prince doesn't support percentage values on border-clip yet. You will actually need to specify an absolute length, eg. 3in.