Skip to contentSkip to conversation

qqz.sty: Work around orphaned section heading

PATCH New Akira Yokosawa 1 participant 2 messages Aug 18, 2023 – Aug 19, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 qqz.sty: Work around orphaned section heading

In ebook-size builds, tcolorbox occasionally complains:

Package tcolorbox Warning: Using nobreak failed. Try to enlarge `lines before break' or set page breaks manually on input line xxxx.

This warning is accompanied by an unfortunate page/column break just below a section heading in Appendix E.

Make such ugly breaks less likely by enclosing the \section command with a pair of pagebreak/nopagebreak hints.

--
You need to be very lucky to observe this issue. At the moment, you can observe it in perfbook-ebsf.pdf built on Ubuntu 22.04. Section E.18's heading goes to the bottom of page 1277.

This change makes it go to the top of page 1278.
--

 qqz.sty | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
qqz.sty +2 -1
index 5c7eb5340194..74ee0566b1c2 100644
@@ -223,8 +223,9 @@
 %% Internal interfaces generated by scripts.
 
 \newcommand{\QuickQAC}[3]{
+	\pagebreak[3]
 	\edef\QuickQuizAnswerChapter{\getrefnumber{#1}}
-	\section{#2}}
+	\section{#2}\nopagebreak}
 
 \IfNoQqz{
 \newcommand{\QuickQQC}[3]{

base-commit: 54b77242aac76979b8bbb832809b55736167bf5e

Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 Use \raggedbottom for ebook-size builds

\flushbottom, which is the default of book class, is suited for typesetting double-sided printed documents.

For ebook-size builds, which is one-sided, \flushbottom doesn't make much sense. \raggedbottom should be a better option as it prevents excessively tall vertical stretches between paragraphs and elsewhere.

---
 perfbook-lt.tex | 1 +
 1 file changed, 1 insertion(+)
perfbook-lt.tex +1 -0
index fdfde1953225..9c89dd4254b8 100644
@@ -603,6 +603,7 @@
 \renewcommand{\epigraph}[2]{\epigraphorig{\biolinum\emph{#1}}{\biolinum\scshape\footnotesize #2}}
 \IfEbookSize{
   \newcommand{\Epigraph}[2]{\epigraph{#1}{#2}}
+  \raggedbottom
 }{
   \newcommand{\Epigraph}[2]{\epigraphhead[65]{\epigraph{#1}{#2}}}
 }
Signature · 1 line
2.25.1