howto: Update Answer to QQZ 1.3 to mention inline QQA is not easy
PATCH 1/3 howto: Update Answer to QQZ 1.3 to mention inline QQA is not easy
From f4a50f79fdd13552b482b5e0f8ef0ff9b199e24b Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 8 Mar 2020 00:59:39 +0900
Subject: [PATCH 1/3] howto: Update Answer to QQZ 1.3 to mention inline QQA is not easy
The macro \QuickQuizAnswer{} defined in qqz.sty currently discards its argument. If you modify it to enable inline QQA, pdflatex will end up in error due to verbatim contents and other fragile elements within macro arguments.
Appendix E's code (qqz.tex) works because the macros \QuickQ{} and \QuickA{} have no argument.
--- howto/howto.tex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
howto/howto.tex +8 -4
@@ -207,10 +207,14 @@ Here are a few possible strategies: to ignore, you can always clone the \LaTeX{} source for this book from the git archive. You can then modify \path{Makefile} and \path{qqz.sty} to eliminate - the Quick Quizzes from the PDF output. - Alternatively, you could modify these two files so as - to pull the answers inline, immediately following - the questions. + the Quick Quizzes from the PDF output.\footnote{ + On the other hand, modifying these two files does not + suffice at the moment if what you'd like to do is to pull + the answers inline, immediately following the questions. + This is due to the fragility of verbatim environments + within arguments of \LaTeX\ macros. + It should still be possible, for example, by editing every + \path{.tex} source by a script, though.} \item Look at the answer immediately rather than investing a large amount of time in coming up with your own answer.
Signature · 1 line
2.17.1
PATCH 2/3 intro: Use 'VerbatimU' env for command output
From 30b7576e4db9f6125a8c516b7efc2adc016e259d Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 9 Mar 2020 20:24:22 +0900
Subject: [PATCH 2/3] intro: Use 'VerbatimU' env for command output
--- intro/intro.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
intro/intro.tex +3 -1
@@ -216,7 +216,9 @@ programming. Finally, on Linux and UNIX systems, consider the following shell command: - {\small \tt get\_input | grep "interesting" | sort} + \begin{VerbatimU} + get_input | grep "interesting" | sort + \end{VerbatimU} This shell pipeline runs the \co{get_input}, \co{grep}, and \co{sort} processes in parallel.
Signature · 1 line
2.17.1
PATCH 3/3 defer/seqlock: Move figure env next to 1st paragraph
In reply to Akira YokosawaFrom 62edb155faac3b554f38b6d5f939cbad3e5030e1 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 10 Mar 2020 07:58:31 +0900
Subject: [PATCH 3/3] defer/seqlock: Move figure env next to 1st paragraph
--- defer/seqlock.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
defer/seqlock.tex +7 -7
@@ -7,13 +7,6 @@ % \epigraph{It'll be just like starting over.}{\emph{John Lennon}} -\begin{figure}[tb] -\centering -\resizebox{3in}{!}{\includegraphics{cartoons/r-2014-Start-over}} -\caption{Reader And Uncooperative Sequence Lock} -\label{fig:defer:Reader And Uncooperative Sequence Lock} -\end{figure} - Sequence locks are used in the Linux kernel for read-mostly data that must be seen in a consistent state by readers. However, unlike reader-writer locking, readers do not exclude writers.
@@ -24,6 +17,13 @@ Figure~\ref{fig:defer:Reader And Uncooperative Sequence Lock}, it is important to design code using sequence locks so that readers very rarely need to retry. +\begin{figure}[tb] +\centering +\resizebox{3in}{!}{\includegraphics{cartoons/r-2014-Start-over}} +\caption{Reader And Uncooperative Sequence Lock} +\label{fig:defer:Reader And Uncooperative Sequence Lock} +\end{figure} + \QuickQuiz{ Why isn't this sequence-lock discussion in Chapter~\ref{chp:Locking}, you know, the one on \emph{locking}?
Signature · 1 line
2.17.1
Quoted 10 lines · Akira Yokosawa
Quoted 1 line
From
f4a50f79fdd13552b482b5e0f8ef0ff9b199e24bMon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Sun, 8 Mar 2020 00:59:39 +0900
Subject: [PATCH 1/3] howto: Update Answer to QQZ 1.3 to mention inline QQA is not easyThe macro \QuickQuizAnswer{} defined in qqz.sty currently discards its argument. If you modify it to enable inline QQA, pdflatex will end up in error due to verbatim contents and other fragile elements within macro arguments.
Quoted 4 lines
Appendix E's code (qqz.tex) works because the macros \QuickQ{} and \QuickA{} have no argument.
Signed-off-by Akira Yokosawa <[email protected]>
Applied and pushed all three, thank you!
Thanx, Paul
Quoted 30 lines
--- howto/howto.tex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)howto/howto.tex +8
-4@@ -207,10 +207,14 @@ Here are a few possible strategies: to ignore, you can always clone the \LaTeX{} source for this book from the git archive. You can then modify \path{Makefile} and \path{qqz.sty} to eliminate - the Quick Quizzes from the PDF output. - Alternatively, you could modify these two files so as - to pull the answers inline, immediately following - the questions. + the Quick Quizzes from the PDF output.\footnote{ + On the other hand, modifying these two files does not + suffice at the moment if what you'd like to do is to pull + the answers inline, immediately following the questions. + This is due to the fragility of verbatim environments + within arguments of \LaTeX\ macros. + It should still be possible, for example, by editing every + \path{.tex} source by a script, though.} \item Look at the answer immediately rather than investing a large amount of time in coming up with your own answer.Signature · 1 line
2.17.1