Skip to contentSkip to conversation

End-of-sentence punctuation after "Appendix X"

PATCH Applied Akira Yokosawa 2 participants 7 messages Aug 25, 2021

lore
Share & tools
lore
#0 lore raw

cover End-of-sentence punctuation after "Appendix X"

Hi Paul,

There remain a few places where end-of-sentence periods are followed by single spaces.

Patch 1/5 is a follow-up of QQA expansion in datastruct, unrelated to end-of-sentence punctuation marks.
Patch 2/5 fixes wrong spaces after "Appendix X.".
Patch 3/5 updates periodcheck.pl so that punctuation marks after end-of-sentence "Appendix X" can be caught.
Patch 4/5 modifies the label string of Appendix E so that the script updated in Patch 3/5 can recognize it.
Patch 5/5 fixes a typo I came across while preparing this patch set.

Thanks, Akira
--
Akira Yokosawa (5):
datastruct: Reference Figure 10.11 to clarify discussion flow
treewide: Annotate end-of-sentence periods after 'Appendix X' punctcheck.pl: Add regex to catch punctuation marks after 'Appendix X' Adjust label of Appendix E 'Answers to Quick Quizzes' appendix/questions: Fix typo of missing ')'

 ack.tex                          |  2 +-
 appendix/questions/questions.tex |  2 +-
 cpu/overheads.tex                |  2 +-
 cpu/overview.tex                 |  2 +-
 datastruct/datastruct.tex        |  5 +++--
 defer/rcuintro.tex               |  2 +-
 howto/howto.tex                  | 12 ++++++------
 qqz.sty                          |  2 +-
 utilities/punctcheck.pl          |  3 ++-
 9 files changed, 17 insertions(+), 15 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/5 datastruct: Reference Figure 10.11 to clarify discussion flow

The preceding paragraph discusses update performance regarding Figure 10.12.
This paragraph returns to Figure 10.11 and speculates that the rate of lookup might be affected by the differences of update rates. To help readers to follow the discussion flow, add a reference to Figure 10.11 near the beginning of the paragraph.

Also fix a typo in the reworked answer to QQ 10.9.

---
 datastruct/datastruct.tex | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
datastruct/datastruct.tex +3 -2
index 552bd955..d703a741 100644
@@ -940,7 +940,8 @@ starts to make its presence known, first for RCU and then for hazard
 pointers.
 Of course, all three of these implementations beat global locking.
 
-It is quite possible that the differences in lookup performance
+It is quite possible that the differences in lookup performance observed in
+\cref{fig:datastruct:Read-Side RCU-Protected Hash-Table Performance For Schroedinger's Zoo in the Presence of Updates}
 are affected by the differences in update rates.
 One way to check this is to artificially throttle the update rates of
 per-bucket locking and hazard pointers to match that of RCU\@.
@@ -969,7 +970,7 @@ not recommended for production use.
 
 	In addition, other testing has shown that RCU read-side primitives
 	offer consistent performance and scalability up to at least 1024~CPUs.
-	However, is useful to review
+	However, it is useful to review
 	\cref{fig:datastruct:Read-Only RCU-Protected Hash-Table Performance For Schr\"odinger's Zoo at 448 CPUs; Varying Table Size}
 	and its associated commentary.
 	You see, unlike the 448-CPU system that provided this data,
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/5 treewide: Annotate end-of-sentence periods after 'Appendix X'

In reply to Akira Yokosawa

TeX engine treats periods after "Appendix B", "Appendix C", etc. as mid-sentence ones even if they come after \cref{chp:app:xxxx}.

Annotate them as end-of-sentence ones.

---
 ack.tex            | 2 +-
 cpu/overheads.tex  | 2 +-
 cpu/overview.tex   | 2 +-
 defer/rcuintro.tex | 2 +-
 howto/howto.tex    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
ack.tex +1 -1
index 5ca46498..743b2bf4 100644
@@ -17,7 +17,7 @@
 
 Akira Yokosawa is this book's \LaTeX\ advisor, which perhaps most
 notably includes the care and feeding of the style guide laid out
-in \cref{chp:app:styleguide:Style Guide}.
+in \cref{chp:app:styleguide:Style Guide}\@.
 This work includes table layout, listings, fonts, rendering of math,
 acronyms, bibliography formatting, epigraphs, hyperlinks, paper size.
 Akira also perfected the cross-referencing of quick quizzes, allowing
cpu/overheads.tex +1 -1
index 2cfe931b..caedd9e9 100644
@@ -116,7 +116,7 @@ events might ensue:
 This simplified sequence is just the beginning of a discipline called
 \emph{cache-coherency protocols}~\cite{Hennessy95a,DavidECuller1999,MiloMKMartin2012scale,DanielJSorin2011MemModel},
 which is discussed in more detail in
-\cref{chp:app:whymb:Why Memory Barriers?}.
+\cref{chp:app:whymb:Why Memory Barriers?}\@.
 As can be seen in the sequence of events triggered by a \IXacr{cas} operation,
 a single instruction can cause considerable protocol traffic, which
 can significantly degrade your parallel program's performance.
cpu/overview.tex +1 -1
index 33918e49..c68b0756 100644
@@ -248,7 +248,7 @@ as described in the next section.
 
 Memory barriers will be considered in more detail in
 \cref{chp:Advanced Synchronization: Memory Ordering} and
-\cref{chp:app:whymb:Why Memory Barriers?}.
+\cref{chp:app:whymb:Why Memory Barriers?}\@.
 In the meantime, consider the following simple lock-based \IX{critical
 section}:
 
defer/rcuintro.tex +1 -1
index 9b327afa..519f1627 100644
@@ -445,7 +445,7 @@ Linux-kernel environments can be as simple as defining
 and \co{preempt_enable()}, respectively.\footnote{
 	Some toy RCU implementations that handle preempted
 	read-side critical sections are shown in
-	\cref{chp:app:``Toy'' RCU Implementations}.}
+	\cref{chp:app:``Toy'' RCU Implementations}\@.}
 However, this simple non-preemptible approach is conceptually complete,
 and demonstrates that it really is possible to provide read-side
 synchronization at zero cost, even in the face of concurrent updates.
howto/howto.tex +1 -1
index 1e3474ff..00522f84 100644
@@ -422,7 +422,7 @@ find CodeSamples -name rcu_rcpls.c -print
 \end{VerbatimU}
 
 This command will locate the file \path{rcu_rcpls.c}, which is called out in
-\cref{chp:app:``Toy'' RCU Implementations}.
+\cref{chp:app:``Toy'' RCU Implementations}\@.
 Non-UNIX systems have their own well-known ways of locating files by filename.
 
 \section{Whose Book Is This?}
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/5 punctcheck.pl: Add regex to catch punctuation marks after 'Appendix X'

In reply to Akira Yokosawa

This regex checks label strings inside \cref{}.
As $line carries an input line with such arguments removed, it is tested against $line_raw.

---
 utilities/punctcheck.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
utilities/punctcheck.pl +2 -1
index 88fd59c0..3488e5b6 100755
@@ -62,7 +62,8 @@ sub check_line {
 	$ng = 0;
 	if ($line =~ /^(?=[\s]*+[^%])[^%]*[A-Z][\)\']*[\.\?\!\:][\)\}\']*$/ ||
 	    $line =~ /^(?=[\s]*+[^%])[^%]*[A-Z][\)\']*[\.\?\!\:]\\footnote/ ||
-	    $line =~ /^(?=[\s]*+[^%])[^%]*[Aa]crm?(f|fst)?\{.+\}[\)\']*[\.\?\!\:][\)\}\']*$/ ) {
+	    $line =~ /^(?=[\s]*+[^%])[^%]*[Aa]crm?(f|fst)?\{.+\}[\)\']*[\.\?\!\:][\)\}\']*$/ ||
+	    $line_raw =~ /\\[Cc]ref\{(cha|chp)\:app:[^\}]*\}[\.\?\!\:][\)\}\']*$/ ) {
 	    $ng += 1;
 	    if ($next_line =~ /^\s*$/ || $next_line =~ /^\s*%/ ||
 		$next_line =~ /\\item/ ||
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/5 Adjust label of Appendix E 'Answers to Quick Quizzes'

In reply to Akira Yokosawa

Use the pattern of "chp:app:xxx" so that the regex added in punctcheck.pl can recognize it.

---
 howto/howto.tex | 10 +++++-----
 qqz.sty         |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
howto/howto.tex +5 -5
index 00522f84..96fa8d3a 100644
@@ -139,7 +139,7 @@ This chapter is followed by a number of appendices.
 The most popular of these appears to be
 \cref{chp:app:whymb:Why Memory Barriers?},
 which delves even further into memory ordering.
-\Cref{chp:Answers to Quick Quizzes}
+\Cref{chp:app:Answers to Quick Quizzes}
 contains the answers to the infamous Quick Quizzes, which are discussed in
 the next section.
 
@@ -151,8 +151,8 @@ the next section.
 
 ``Quick quizzes'' appear throughout this book, and the answers may
 be found in
-\cref{chp:Answers to Quick Quizzes} starting on
-\cpageref{chp:Answers to Quick Quizzes}.
+\cref{chp:app:Answers to Quick Quizzes} starting on
+\cpageref{chp:app:Answers to Quick Quizzes}.
 Some of them are based on material in which that quick quiz
 appears, but others require you to think beyond that section, and,
 in some cases, beyond the realm of current knowledge.
@@ -167,8 +167,8 @@ of parallel programming.
 \QuickQuizB{
 	Where are the answers to the Quick Quizzes found?
 }\QuickQuizAnswerB{
-	In \cref{chp:Answers to Quick Quizzes} starting on
-	\cpageref{chp:Answers to Quick Quizzes}.
+	In \cref{chp:app:Answers to Quick Quizzes} starting on
+	\cpageref{chp:app:Answers to Quick Quizzes}.
 	Hey, I thought I owed you an easy one!
 }\QuickQuizEndB
 %
qqz.sty +1 -1
index 86b50c79..a1687293 100644
@@ -187,7 +187,7 @@
 \newcommand{\QuickQuizAnswers}{%
 	\renewcommand*{\theHNum}{\arabic{section}.\arabic{quickquizctrC}}
 	\chapter{Answers to Quick Quizzes}
-	\label{chp:Answers to Quick Quizzes}
+	\label{chp:app:Answers to Quick Quizzes}
 	\Epigraph{The Answer to the Ultimate Question of Life, The Universe,
 		  and Everything.}
 		 {\emph{``The Hitchhikers Guide to the Galaxy'', Douglas~Adams}}
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/5 appendix/questions: Fix typo of missing ')'

In reply to Akira Yokosawa
---
 appendix/questions/questions.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
appendix/questions/questions.tex +1 -1
index 48908bcb..f3b4b3d1 100644
@@ -28,7 +28,7 @@ With that, here are the questions:
 \item	Why not remove locking?
 	(\cref{sec:app:questions:Why Not Remove Locking?})
 \item	What time is it?
-	(\cref{sec:app:questions:What Time Is It?}
+	(\cref{sec:app:questions:What Time Is It?})
 \item	What does ``after'' mean?
 	(\cref{sec:app:questions:What Does ``After'' Mean?})
 \item	How much ordering is needed?
Signature · 1 line
2.17.1
#6 lore raw
In reply to Akira Yokosawa
Quoted 5 lines · Akira Yokosawa

Hi Paul,

There remain a few places where end-of-sentence periods are followed by single spaces.

Quoted 9 lines

Patch 1/5 is a follow-up of QQA expansion in datastruct, unrelated to end-of-sentence punctuation marks.
Patch 2/5 fixes wrong spaces after "Appendix X.".
Patch 3/5 updates periodcheck.pl so that punctuation marks after end-of-sentence "Appendix X" can be caught.
Patch 4/5 modifies the label string of Appendix E so that the script updated in Patch 3/5 can recognize it.
Patch 5/5 fixes a typo I came across while preparing this patch set.

Queued and pushed, thank you!

Thanx, Paul

Quoted 23 lines

Thanks, Akira
--
Akira Yokosawa (5):
datastruct: Reference Figure 10.11 to clarify discussion flow
treewide: Annotate end-of-sentence periods after 'Appendix X' punctcheck.pl: Add regex to catch punctuation marks after 'Appendix X' Adjust label of Appendix E 'Answers to Quick Quizzes' appendix/questions: Fix typo of missing ')'

 ack.tex                          |  2 +-
 appendix/questions/questions.tex |  2 +-
 cpu/overheads.tex                |  2 +-
 cpu/overview.tex                 |  2 +-
 datastruct/datastruct.tex        |  5 +++--
 defer/rcuintro.tex               |  2 +-
 howto/howto.tex                  | 12 ++++++------
 qqz.sty                          |  2 +-
 utilities/punctcheck.pl          |  3 ++-
 9 files changed, 17 insertions(+), 15 deletions(-)
Signature · 1 line
2.17.1