Forum › How do I...?

Title: Uneven column balancing with column-span: all and mixed content (Prince 16.2)

Striped Elephant
Hi,

We're evaluating Prince XML 16.2 for generating professionally typeset, two-column A4 annual reports from HTML/CSS.

We have run into a column-balancing issue that we haven't been able to resolve, despite several controlled experiments.

Expected behavior

We want text to flow automatically from the left column to the right column and continue onto subsequent pages.

On the final page of a chapter, we would expect column-fill: balance to distribute the remaining content so that both columns end at approximately the same vertical position, subject to normal widow/orphan and keep-together constraints.

Actual behavior

With a long chapter containing only paragraphs, Prince balances the final page quite well: the two columns finish within approximately one text line (14pt).

However, when the document contains a full-width figure (column-span: all), a metrics block and a blockquote, the final page has a significantly uneven column ending.

In our attached example, the right column ends 73.5pt (more than five body-text lines) below the left column.

Our main CSS settings are:

.flow {
column-count: 2;
column-gap: 7mm;
column-fill: balance;
font-size: 10pt;
line-height: 14pt;
}

p {
font: 10pt/14pt Arial, sans-serif;
margin: 0 0 14pt;
orphans: 3;
widows: 3;
hyphens: auto;
}

.wide {
column-span: all;
break-inside: avoid;
}

What we've already tested

column-fill: auto versus balance.

A full-width figure using column-span: all.

Splitting the multicolumn container into separate containers before and after the figure. In our particular example, this produced an identical PDF.

Using -prince-float: page top. This improved the final column balance somewhat, but moved the figure above the chapter heading, which is not acceptable for our layout.

Changing the line-height on the multicolumn container while keeping paragraph line-height fixed. No observable change.

Testing whether an explicitly multicolumn footer could affect pagination. No observable change in our setup, which uses @page margin boxes rather than an HTML footer.

Our questions

Is this expected behavior when balancing columns containing mixed content and a column-span: all element?

Is there a recommended HTML/CSS structure for achieving more consistent column balancing across pages, while preserving automatic text flow?

Can Prince balance the final columns more accurately without manually assigning text to individual columns or introducing explicit column breaks?

Is this behavior different in Prince 17 or Prince for Books?

We are not looking for perfectly equal columns at the expense of good typography. A difference of one line can be reasonable. However, differences of five or more lines are difficult to accept for professional typesetting when the content appears to offer opportunities for better balancing.

I've attached the HTML test case and resulting PDF so the issue can be reproduced.

Any advice from the Prince team would be greatly appreciated.

Thanks!
  1. prince-diagnostic-control.html‎ 7.4 kB
  2. prince-diagnostic-control.pdf‎ 76.2 kB