All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading
@ 2020-03-01 15:02 Akira Yokosawa
  2020-03-01 17:51 ` Paul E. McKenney
  0 siblings, 1 reply; 6+ messages in thread
From: Akira Yokosawa @ 2020-03-01 15:02 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

From 2c4fd06827d075a04c157d150cf036db1615f268 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
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@gmail.com>
---
 qqz.sty | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qqz.sty b/qqz.sty
index eda6dc31..4dd411f6 100644
--- a/qqz.sty
+++ b/qqz.sty
@@ -34,7 +34,7 @@
 	}
 \newcommand{\QuickQuiz}[1]{
 	\refstepcounter{quickquizctr}
-	\QuickQHeading{QQ}{QQA}{\thechapter.\thequickquizctr}}
+	\goodbreak\QuickQHeading{QQ}{QQA}{\thechapter.\thequickquizctr}}
 \newcommand{\QuickQuizAnswer}[1]{%
 	\refstepcounter{quickquizctrE}%
 	\hyperref[QQA.\thechapter.\thequickquizctr]{\rule{7pt}{7pt}}%
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading
  2020-03-01 15:02 [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading Akira Yokosawa
@ 2020-03-01 17:51 ` Paul E. McKenney
  2020-03-01 22:43   ` Akira Yokosawa
  0 siblings, 1 reply; 6+ messages in thread
From: Paul E. McKenney @ 2020-03-01 17:51 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

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@gmail.com>
> 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@gmail.com>

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?

							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]{%

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading
  2020-03-01 17:51 ` Paul E. McKenney
@ 2020-03-01 22:43   ` Akira Yokosawa
  2020-03-01 23:09     ` Paul E. McKenney
  0 siblings, 1 reply; 6+ messages in thread
From: Akira Yokosawa @ 2020-03-01 22:43 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

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@gmail.com>
>> 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@gmail.com>
> 
> 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.

        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]{%
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading
  2020-03-01 22:43   ` Akira Yokosawa
@ 2020-03-01 23:09     ` Paul E. McKenney
  2020-03-02 15:10       ` Akira Yokosawa
  0 siblings, 1 reply; 6+ messages in thread
From: Paul E. McKenney @ 2020-03-01 23:09 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

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@gmail.com>
> >> 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@gmail.com>
> > 
> > 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.

							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]{%
> > 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading
  2020-03-01 23:09     ` Paul E. McKenney
@ 2020-03-02 15:10       ` Akira Yokosawa
  2020-03-02 15:20         ` Paul E. McKenney
  0 siblings, 1 reply; 6+ messages in thread
From: Akira Yokosawa @ 2020-03-02 15:10 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

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@gmail.com>
>>>> 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@gmail.com>
>>>
>>> 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.

What you want is to keep an Answer to a Quick Quiz to be in the same
column/page as much as possible?

        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]{%
>>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading
  2020-03-02 15:10       ` Akira Yokosawa
@ 2020-03-02 15:20         ` Paul E. McKenney
  0 siblings, 0 replies; 6+ messages in thread
From: Paul E. McKenney @ 2020-03-02 15:20 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

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@gmail.com>
> >>>> 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@gmail.com>
> >>>
> >>> 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]{%
> >>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-02 15:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-01 15:02 [PATCH] qqz.sty: Permit column/page break in front of Quick Quiz heading Akira Yokosawa
2020-03-01 17:51 ` Paul E. McKenney
2020-03-01 22:43   ` Akira Yokosawa
2020-03-01 23:09     ` Paul E. McKenney
2020-03-02 15:10       ` Akira Yokosawa
2020-03-02 15:20         ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.