perfbook.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH -perfbook 1/2] qqz.sty: Work around orphaned section heading
Date: Sat, 19 Aug 2023 08:57:38 +0900	[thread overview]
Message-ID: <bcfc8abd-05e4-2700-982e-e0cbd401fc1a@gmail.com> (raw)

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.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
--
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(-)

diff --git a/qqz.sty b/qqz.sty
index 5c7eb5340194..74ee0566b1c2 100644
--- a/qqz.sty
+++ b/qqz.sty
@@ -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
-- 
2.25.1


             reply	other threads:[~2023-08-18 23:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18 23:57 Akira Yokosawa [this message]
2023-08-19  0:06 ` [PATCH -perfbook 2/2] Use \raggedbottom for ebook-size builds Akira Yokosawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bcfc8abd-05e4-2700-982e-e0cbd401fc1a@gmail.com \
    --to=akiyks@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).