On Tue, Mar 03, 2020 at 12:10:41AM +0900, Akira Yokosawa wrote: > On Sun, 1 Mar 2020 15:09:24 -0800, Paul E. McKenney wrote: > > On Mon, Mar 02, 2020 at 07:43:40AM +0900, Akira Yokosawa wrote: > >> On Sun, 1 Mar 2020 09:51:32 -0800, Paul E. McKenney wrote: > >>> On Mon, Mar 02, 2020 at 12:02:01AM +0900, Akira Yokosawa wrote: > >>>> >From 2c4fd06827d075a04c157d150cf036db1615f268 Mon Sep 17 00:00:00 2001 > >>>> From: Akira Yokosawa <akiyks@xxxxxxxxx> > >>>> Date: Sun, 1 Mar 2020 21:47:45 +0900 > >>>> Subject: [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading > >>>> > >>>> It turned out that the definition of \QuickQuiz needs an explicit > >>>> hint (\goodbreak) for LaTeX to be able to break column/page in front > >>>> of it. > >>>> > >>>> Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> > >>> > >>> Nice! > >>> > >>> Does it make sense to also add \goodbreak at the end of a Quick Quiz, > >>> perhaps as follows? Doing so gets QQ2.11 all on one page in the > >>> two-column version. > >>> > >>> Does it also make sense to encourage page breaks at the beginnings of > >>> Quick Quizzes in the answer chapter? > >>> > >>> In other words, should I fold the diff below into your diff, or would > >>> doing so break something? > >> > >> 2nd hunk causes the headings of Sections E.3, E.5, E.10, E.13, E.17, > >> and E.20 to be at the bottom. So please just apply the first hunk. > >> Also, the title and the change log need some adjustment. > > > > Good point, and done! Queued and pushed. > > > > I suspect that an appropriate "\if" statement would repair the second > > hunk, but on the other hand, having quick quizzes broken across lines > > in the answer section isn't as jarring as in the main body of the text. > > My guess is that the \par command in the beginning of \QuickQ implies > breakable point and the extra \goodbreak confused the TeX engine. Good point, that would do it! > What you want is to keep an Answer to a Quick Quiz to be in the same > column/page as much as possible? I was mostly just experimenting. Yes, readers would want the quick quiz and its answer in the same column, or, failing that, on the same page. But the quizzes+answers are too long to do that without leaving lots of ugly whitespace. So there will be breaks somewhere. I was thinking in terms of encouraging LaTeX to keep the question part in a single column, given that the questions are normally rather short. But it certainly isn't worth having section headings at the bottom of a column! Thanx, Paul > Thanks, Akira > > > > > Thanx, Paul > > > >>> ------------------------------------------------------------------------ > >>> > >>> diff --git a/qqz.sty b/qqz.sty > >>> index 4dd411f..8bd80d9 100644 > >>> --- a/qqz.sty > >>> +++ b/qqz.sty > >>> @@ -39,7 +39,7 @@ > >>> \refstepcounter{quickquizctrE}% > >>> \hyperref[QQA.\thechapter.\thequickquizctr]{\rule{7pt}{7pt}}% > >>> \label{QQE.\thechapter.\thequickquizctrE}} > >>> -\newcommand{\QuickQuizEnd}{} > >>> +\newcommand{\QuickQuizEnd}{\goodbreak} > >>> > >>> % To create a macro referencing the previously defined quick quiz: > >>> % \QuickQuizLabel{\QQname} > >>> @@ -80,7 +80,7 @@ > >>> \newcommand{\QuickQ}[1]{ > >>> \par > >>> \refstepcounter{quickquizctrC}% > >>> - \noindent > >>> + \goodbreak\noindent > >>> \QuickQHeading{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} #1 ~ \\ } > >>> > >>> \newcommand{\QuickA}[1]{% > >>>