Skip to contentSkip to conversation

Makefile: Disable qqzbg in -nq builds

PATCH Applied Akira Yokosawa 2 participants 3 messages Apr 8, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Makefile: Disable qqzbg in -nq builds

"noqqz" assumes "qqzbg" is disabled.
This change recovers page count in the top-right corner of quiz part.

Fixes 283bf48cfa39 ("Makefile: Update rules to reflect help text")
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 5f17b126..cd8ee7ff 100644
@@ -373,7 +373,8 @@ perfbook-1csfnq.tex: perfbook-1csf.tex
 perfbook-ebnq.tex: perfbook-eb.tex
 perfbook-ebsfnq.tex: perfbook-ebsf.tex
 perfbook-nq.tex perfbook-sfnq.tex perfbook-1cnq.tex perfbook-1csfnq.tex perfbook-ebnq.tex perfbook-ebsfnq.tex:
-	sed -e 's/setboolean{noqqz}{false}/setboolean{noqqz}{true}/' \
+	sed -e 's/setboolean{qqzbg}{true}/setboolean{qqzbg}{false}/' \
+	    -e 's/setboolean{noqqz}{false}/setboolean{noqqz}{true}/' \
 	    -e 's/{qqzchpend}{false}/{qqzchpend}{true}/' < $< > $@
 
 perfbook-ix.tex: $(PERFBOOK_BASE)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 qqz: Suppress possible orphan heading

As of Edition.2 and current master, heading of Appendix E.7 is orphaned in perfbook.pdf.

This is because framing of quiz part at the beginning of a section implies paragraph break and invalids the afterheading-ness of the first question.

To suppress such an unfortunate result, tweak the \bottomtitlespace variable of the "titlesec" package for Appendix E.

Positive length of \bottomtitlespace prohibits a section title to appear in the bottom part of that length and forces the title to be on the next page.
This should be acceptable in Appendix E.

There exist the same patterns of quick quiz at the beginning of a section in the main text as well as in -nq builds, which might cause an orphan heading.

Such cases would be dealt with case by case bases.

---
 appendix/appendix.tex | 1 +
 1 file changed, 1 insertion(+)
appendix/appendix.tex +1 -0
index 9218b1f1..f2640157 100644
@@ -6,4 +6,5 @@
 \include{appendix/toyrcu/toyrcu}
 \include{appendix/whymb/whymemorybarriers}
 \include{appendix/styleguide/styleguide}
+\renewcommand{\bottomtitlespace}{.08\textheight}
 \QuickQuizAnswers
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH -perfbook 2/2] qqz: Suppress possible orphan heading

Quoted 15 lines · Akira Yokosawa

As of Edition.2 and current master, heading of Appendix E.7 is orphaned in perfbook.pdf.

This is because framing of quiz part at the beginning of a section implies paragraph break and invalids the afterheading-ness of the first question.

To suppress such an unfortunate result, tweak the \bottomtitlespace variable of the "titlesec" package for Appendix E.

Positive length of \bottomtitlespace prohibits a section title to appear in the bottom part of that length and forces the title to be on the next page.
This should be acceptable in Appendix E.

Quoted 7 lines

There exist the same patterns of quick quiz at the beginning of a section in the main text as well as in -nq builds, which might cause an orphan heading.

Such cases would be dealt with case by case bases.

I queued and pushed both, thank you!

I tried the following to give LaTeX more choice, which did work, but I am not sure that it is an improvement. But maybe it will inspire something should the current approach fail at some point in the future?

Thanx, Paul

------------------------------------------------------------------------

qqz.sty +3 -1
index 897d1ab6..abecb7e8 100644
@@ -203,7 +203,9 @@
 }{
 \newcommand{\QuickQAC}[3]{
 	\edef\QuickQuizAnswerChapter{\getrefnumber{#1}}
-	\section{#2}}
+	\section{#2}
+	This section contains the answer key to the quick quizzes
+	from \cref{#1} on page~\pageref{#1}.}
 }
 
 \IfQqzBg{