Closed tgraham-antenna closed 1 year ago
Bah humbug. Any suggestions for alternative properties that prevent breaks in short listings?
Antenna House Formatter has -ah-keep-together-within-dimension
(https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#axf.keep-together-within-dimension) as well as numeric keep values with -ah-keep-together
(https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#css-xsl).
The alternative would be to specify page-break-before: avoid;
on the first several lines (since you're formatting program listings as tables) and hope.
Would it work to adapt the <?dbfo-need height="2in" ?>
hackery described in http://www.sagehill.net/docbookxsl/PageBreaking.html#SoftPageBreaks?
Maybe. What's would you output for the "need" and how would you style it?
For programlisting
as a table, there's also -ah-table-row-orphans
: https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#axf.table-row-orphans
https://github.com/docbook/xslTNG/blob/ebbbaa2e361f5aa3c5f9b4d18bb4109c55258f2e/src/main/scss/media-all.scss#L944-L950
See, e.g., page 45 of https://xsltng.docbook.org/pdf/DocBook-xslTNG-2.1.0.pdf