Forum Bugs

Discrepancy in page float behaviour between Prince 14.2 and Prince for Books

David J Prokopetz
Apologies in advance for dumping a whole book on you, but I couldn't figure out how to reproduce the issue in a contrived example.

In brief, I'm seeing an inconsistency with respect to page float behaviour between Prince 14.2 and Prince for Books.

The following PDF was generated using Prince 14.2:

https://penguinking.com/jellyfish-felonies/jellyfish-felonies-0.3.pdf

The following PDF was generated using Prince for Books, using the same source files as the preceding PDF:

https://penguinking.com/jellyfish-felonies/jellyfish-felonies-0.3-books.pdf

If you look at page 10 (subheading "Rolling COMMIT FRAUD"), you'll see a discrepancy in the vertical alignment of the floated sidebar at the bottom of the page.

It's just that one page float that's affected; all other page floats in the document are consistent between the two versions.

You can find the source files in the attached zipfile. The following command was used to generate both PDFs (simply exchanging prince.exe for prince-books.exe in the latter case):

prince.exe jellyfish-felonies-0.3.html --javascript --script=https://code.jquery.com/jquery-3.5.1.min.js --script=scripts/pdf.js --pdf-profile="PDF/UA-1"
  1. jellyfish-felonies-0.3.zip4.0 MB
mikeday
We will take a look at this! :D
pjrm
Most books in the world have no spacing between paragraphs, and their left & right pages end at the same level, giving a relatively symmetrical look. Typesetters spend a lot of their time ensuring that left & right pages do match up despite avoiding widow lines and such, so Prince for Books accordingly defaults to slight nudging of the page heights to reduce the time of this task.

However, this isn't appropriate for books such as yours that are more fun & varied in layout and use paragraph spacing. You can tell Prince for Books to avoid these adjustments by adding
prince-page-fill: prefer-fill;

to an @page rule (say in scripts/pdf.css).

I like the book. Incidentally, consider making the footnote in the appendix use a smaller font and/or a footnote rule to make it clearer that it isn't body text. Also, note that the Poppins font (which does seem to work well) lacks small-caps, so Prince is simply reducing the font-size, which doesn't look so good. For a published book, you'd want to use a font with proper small caps if you're using small caps extensively as your book does.
David J Prokopetz
Huh. That does work, which surprises me for two reasons:

1. I wouldn't have intuitively expected the page fill behaviour to affect page float placement.

2. According to the online documentation, "prefer-fill" should be the default/initial value for prince-page-fill. The fact that adding that rule has an effect suggests that the documentation is in error.

In any event, that does seem to sort it out. Thanks!

(As for Poppins' lack of small-caps, I'm aware of the issue; however, owing to the manner in which this particular book is due to be distributed, only fonts that are available under an open license can be considered. Finding an alternative font that's visually and metrically similar to Poppins, has proper small-caps, and is available under an open license has proven to be something of a challenge!)

Edited by David J Prokopetz

csant
2. According to the online documentation, "prefer-fill" should be the default/initial value for prince-page-fill. The fact that adding that rule has an effect suggests that the documentation is in error.


That indeed is a mistake - thank you for spotting it! A fix will be in the next documentation update.