Indent tweaks after chapter title and epigraph
cover Indent tweaks after chapter title and epigraph
From 85e0ec292cb75cad1ef71812fee11ed44ecc4ce8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 19 Sep 2016 11:07:31 +0900
Subject: [RFC PATH 0/6] Indent tweaks after chapter title and epigraph
Hi Paul,
After commit a9fe7df2efbc ("treewide: Enclose 'verbbox' within 'figure'"), inconsistency of indent of first paragraph of a chapter became more disturbing (maybe just for me).
I noticed "book.cls" is already localized in the repository, and found a possible fix of the behavior of chapter heading in twocolumn layout there.
As for epigraph, there are two ways to make the following paragraph not to indent.
One is to patch the "\epigraph" command to put "afterheading-ness" at the end of the command.
The other is to use "\epigraphhead" and place the epigraph at the header area of a page.
My preference is to place epigraphs at he right hand side of the page even in twocolumn layout. The effect of using "epigraphhead" command is not identical to what I wanted, but the result seems better than what I had first anticipated.
So, I chose the latter approach and composed this series to do the change.
I'd like you to try it and give me feedback if any.
Thanks, Akira
----
Akira Yokosawa (6):
Update book.cls
book.cls: Fix indent after \chapter in twocolumn
Makefile: Add localized 'book.cls' to dependency
epigraph: Use \epigraphhead{}
epigraph: Increase width a little
Tweak page layout of onecolumn
Makefile | 3 ++- SMPdesign/SMPdesign.tex | 4 ++-- advsync/advsync.tex | 4 ++-- appendix/ack/ack.tex | 4 ++-- appendix/questions/questions.tex | 4 ++-- book.cls | 21 +++++++++++++++------ count/count.tex | 4 ++-- cpu/cpu.tex | 4 ++-- datastruct/datastruct.tex | 4 ++-- debugging/debugging.tex | 4 ++-- defer/defer.tex | 4 ++-- easy/easy.tex | 4 ++-- formal/formal.tex | 4 ++-- future/future.tex | 4 ++-- glossary.tex | 4 ++-- intro/intro.tex | 4 ++-- locking/locking.tex | 4 ++-- owned/owned.tex | 4 ++-- perfbook.tex | 17 ++++++++++++----- qqz.sty | 2 +- rt/rt.tex | 4 ++-- together/together.tex | 4 ++-- toolsoftrade/toolsoftrade.tex | 4 ++-- 23 files changed, 68 insertions(+), 51 deletions(-)
Signature · 1 line
1.9.1
RFC 1/6 Update book.cls
From 57dc9c9631bd36c6c1689d28f9c37595f0abc2bc Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 10 Sep 2016 23:39:23 +0900
Subject: [RFC PATH 1/6] Update book.cls
Replace book.cls with that of TeX Live 2015
There is no change in the code.
Conflict in comment is resolved by modifying version string.
--- book.cls | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
book.cls +7 -2
@@ -8,7 +8,12 @@ %% %% This is a generated file. %% -%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 +%% The source is maintained by the LaTeX Project team and bug +%% reports for it can be opened at http://latex-project.org/bugs.html +%% (but please observe conditions on bug reports sent to that address!) +%% +%% +%% Copyright 1993-2016 %% The LaTeX3 Project and any individual authors listed elsewhere %% in this file. %%
@@ -55,7 +60,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{book} - [2007/10/19 v1.4h-pem + [2014/09/29 v1.4h-pem Standard LaTeX document class] \newcommand\@ptsize{} \newif\if@restonecol
Signature · 1 line
1.9.1
RFC 2/6 book.cls: Fix indent after \chapter in twocolumn
In reply to Akira YokosawaFrom a0a92cb0f614ba369973dc0eb1184d01fa73cee7 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 11 Sep 2016 00:01:02 +0900
Subject: [RFC PATH 2/6] book.cls: Fix indent after \chapter in twocolumn
--- book.cls | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
book.cls +9 -5
@@ -32,6 +32,10 @@ %% by the LaTeX Project. These modifications allow specifying "hardcover" %% in order to generate 10.75x8.25in pages for hardcover books. %% +%% It has also been modified by Akira Yokosawa. The modification fixes +%% indentation behavior of first paragraph in a chapter when twocolumn +%% option is specified. +%% %% This file may only be distributed together with a copy of the LaTeX %% base system. You may however distribute the LaTeX base system without %% such generated files.
@@ -60,7 +64,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{book} - [2014/09/29 v1.4h-pem + [2014/09/29 v1.4h-pem-ay Standard LaTeX document class] \newcommand\@ptsize{} \newif\if@restonecol
@@ -391,8 +395,8 @@ \@topnewpage[\@makechapterhead{#2}]% \else \@makechapterhead{#2}% - \@afterheading - \fi} + \fi + \@afterheading} \def\@makechapterhead#1{% \vspace*{50\p@}% {\parindent \z@ \raggedright \normalfont
@@ -411,8 +415,8 @@ \@topnewpage[\@makeschapterhead{#1}]% \else \@makeschapterhead{#1}% - \@afterheading - \fi} + \fi + \@afterheading} \def\@makeschapterhead#1{% \vspace*{50\p@}% {\parindent \z@ \raggedright
Signature · 1 line
1.9.1
RFC 3/6 Makefile: Add localized 'book.cls' to dependency
In reply to Akira YokosawaFrom 5592199d5aa5e2c64c8763079d93fabcc45afc77 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 19 Sep 2016 07:31:59 +0900
Subject: [RFC PATH 3/6] Makefile: Add localized 'book.cls' to dependency
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -3,6 +3,7 @@ LATEXSOURCES = \ legal.tex \ glossary.tex \ qqz.sty origpub.sty \ + book.cls \ */*.tex \ */*/*.tex
Signature · 1 line
1.9.1
RFC 4/6 epigraph: Use \epigraphhead{}
In reply to Akira YokosawaFrom 632b23d9bc6f823ab5168b50f33ab8f11d17b05a Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 10 Sep 2016 20:10:26 +0900
Subject: [RFC PATH 4/6] epigraph: Use \epigraphhead{}
This commit makes use of \epigraphhead{} so that epigraphs are placed in header areas of chapter heading pages.
To make the change less invasive, it defines a macro \Epigraph{} in the preamble and use it after each chapter heading. By modifying the definition of the macro, it would be easy to tweak layout of epigraphs.
Note that no text (nor line break) is permitted between \chapter{} and \epigraphhead{} commands. So each blank line above \epigraph{} is replaced with a comment.
--- SMPdesign/SMPdesign.tex | 4 ++-- advsync/advsync.tex | 4 ++-- appendix/ack/ack.tex | 4 ++-- appendix/questions/questions.tex | 4 ++-- count/count.tex | 4 ++-- cpu/cpu.tex | 4 ++-- datastruct/datastruct.tex | 4 ++-- debugging/debugging.tex | 4 ++-- defer/defer.tex | 4 ++-- easy/easy.tex | 4 ++-- formal/formal.tex | 4 ++-- future/future.tex | 4 ++-- glossary.tex | 4 ++-- intro/intro.tex | 4 ++-- locking/locking.tex | 4 ++-- owned/owned.tex | 4 ++-- perfbook.tex | 1 + qqz.sty | 2 +- rt/rt.tex | 4 ++-- together/together.tex | 4 ++-- toolsoftrade/toolsoftrade.tex | 4 ++-- 21 files changed, 40 insertions(+), 39 deletions(-)
SMPdesign/SMPdesign.tex +2 -2
@@ -1,8 +1,8 @@ % SMPdesign/SMPdesign.tex \QuickQuizChapter{cha:Partitioning and Synchronization Design}{Partitioning and Synchronization Design} - -\epigraph{Divide and rule.}{\emph{Philip II of Macedon}} +% +\Epigraph{Divide and rule.}{\emph{Philip II of Macedon}} This chapter describes how to design software to take advantage of the multiple CPUs that are increasingly appearing in commodity systems.
advsync/advsync.tex +2 -2
@@ -1,8 +1,8 @@ % advsync/advsync.tex \QuickQuizChapter{sec:advsync:Advanced Synchronization}{Advanced Synchronization} - -\epigraph{If a little knowledge is a dangerous thing, just imagine all +% +\Epigraph{If a little knowledge is a dangerous thing, just imagine all the havoc you could wreak with a lot of knowledge!}{\emph{Unknown}} This section discusses a number of ways of using weaker, and hopefully
appendix/ack/ack.tex +2 -2
@@ -3,8 +3,8 @@ \chapter{Credits} \label{app:ack:Credits} - -\epigraph{If I have seen further it is by standing on the shoulders of +% +\Epigraph{If I have seen further it is by standing on the shoulders of giants.}{\emph{Isaac Newton, modernized}} \section{Authors}
appendix/questions/questions.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{cha:app:Important Questions}{Important Questions} - -\epigraph{Ask me no questions, and I'll tell you no fibs.} +% +\Epigraph{Ask me no questions, and I'll tell you no fibs.} {\emph{``She Stoops to Conquer'', Oliver Goldsmith}} The following sections discuss some important questions relating to
count/count.tex +2 -2
@@ -1,8 +1,8 @@ % count/count.tex \QuickQuizChapter{chp:Counting}{Counting} - -\epigraph{As easy as 1, 2, 3!}{\emph{Unknown}} +% +\Epigraph{As easy as 1, 2, 3!}{\emph{Unknown}} Counting is perhaps the simplest and most natural thing a computer can do. However, counting efficiently and scalably on a large
cpu/cpu.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{chp:Hardware and its Habits}{Hardware and its Habits} - -\epigraph{Premature abstraction is the root of all evil.} +% +\Epigraph{Premature abstraction is the root of all evil.} {\emph{A cast of thousands}} Most people have an intuitive understanding that passing messages between
datastruct/datastruct.tex +2 -2
@@ -1,8 +1,8 @@ % datastruct/datastruct.tex \QuickQuizChapter{chp:Data Structures}{Data Structures} - -\epigraph{Bad programmers worry about the code. Good programmers worry +% +\Epigraph{Bad programmers worry about the code. Good programmers worry about data structures and their relationships.} {\emph{Linus Torvalds}}
debugging/debugging.tex +2 -2
@@ -1,8 +1,8 @@ % debugging/debugging.tex \QuickQuizChapter{chp:Validation}{Validation} - -\epigraph{If it is not tested, it doesn't work.}{\emph{Unknown}} +% +\Epigraph{If it is not tested, it doesn't work.}{\emph{Unknown}} I have had a few parallel programs work the first time, but that is only because I have written a large number parallel programs over the past two
defer/defer.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{chp:Deferred Processing}{Deferred Processing} - -\epigraph{All things come to those who wait.}{\emph{Violet Fane}} +% +\Epigraph{All things come to those who wait.}{\emph{Violet Fane}} The strategy of deferring work goes back before the dawn of recorded history. It has occasionally been derided as procrastination or
easy/easy.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{chp:Ease of Use}{Ease of Use} - -\epigraph{Creating a perfect API is like committing the perfect crime. +% +\Epigraph{Creating a perfect API is like committing the perfect crime. There are at least fifty things that can go wrong, and if you are a genius, you might be able to anticipate twenty-five of them.} {\emph{With apologies to any Kathleen Turner fans who might
formal/formal.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{chp:formal:Formal Verification}{Formal Verification} - -\epigraph{Beware of bugs in the above code; I have only proved it correct, +% +\Epigraph{Beware of bugs in the above code; I have only proved it correct, not tried it.}{\emph{Donald Knuth}} \OriginallyPublished{Appendix}{chp:formal:Formal Verification}{Formal Verification}{Linux Weekly News}{PaulEMcKenney2007QRCUspin,PaulEMcKenney2008dynticksRCU,PaulEMcKenney2011ppcmem}
future/future.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{chp:Conflicting Visions of the Future}{Conflicting Visions of the Future} - -\epigraph{Prediction is very difficult, especially about the future.} +% +\Epigraph{Prediction is very difficult, especially about the future.} {\emph{Niels Bohr}} This chapter presents some conflicting visions of the future of parallel
glossary.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \chapter{Glossary and Bibliography} - -\epigraph{Dictionaries are inherently circular in nature.} +% +\Epigraph{Dictionaries are inherently circular in nature.} {\emph{``Self Reference in word definitions'', David~Levary~et~al.}}
intro/intro.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{chp:Introduction}{Introduction} - -\epigraph{If parallel programming is so hard, why are there any +% +\Epigraph{If parallel programming is so hard, why are there any parallel programs?}{\emph{Unknown}} Parallel programming has earned a reputation as one of the most
locking/locking.tex +2 -2
@@ -1,8 +1,8 @@ % locking/locking.tex \QuickQuizChapter{chp:Locking}{Locking} - -\epigraph{Locking is the worst general-purpose synchronization mechanism +% +\Epigraph{Locking is the worst general-purpose synchronization mechanism except for all those other mechanisms that have been tried from time to time.}{\emph{With apologies to the memory of Winston Churchill and to whoever he was
owned/owned.tex +2 -2
@@ -1,8 +1,8 @@ % owned/owned.tex \QuickQuizChapter{chp:Data Ownership}{Data Ownership} - -\epigraph{It is mine, I tell you. My own. My precious. Yes, my precious.} +% +\Epigraph{It is mine, I tell you. My own. My precious. Yes, my precious.} {\emph{Gollum in ``The Fellowship of the Ring'', J.R.R.~Tolkien}} One of the simplest ways to avoid the synchronization overhead that
perfbook.tex +1 -0
@@ -64,6 +64,7 @@ % --- End of workaround for Fedora 23 Texlive bug \newcommand{\co}[1]{\lstinline[breaklines=true,breakatwhitespace=true]{#1}} \newcommand{\nbco}[1]{\lstinline[breaklines=false,breakatwhitespace=false]{#1}} +\newcommand{\Epigraph}[2]{\epigraphhead[65]{\epigraph{#1}{#2}}} \title{Is Parallel Programming Hard, And, If So, What Can You Do About It?} \author{
qqz.sty +1 -1
@@ -62,7 +62,7 @@ \renewcommand*{\theHNum}{\arabic{section}.\arabic{quickquizctrC}} \chapter{Answers to Quick Quizzes} \label{chp:Answers to Quick Quizzes} - \epigraph{The Answer to the Ultimate Question of Life, The Universe, + \Epigraph{The Answer to the Ultimate Question of Life, The Universe, and Everything.} {\emph{``The Hitchhikers Guide to the Galaxy'', Douglas~Adams}} \setlength{\parskip}{0.0pt plus 2ex}
rt/rt.tex +2 -2
@@ -1,8 +1,8 @@ % rt/rt.tex \QuickQuizChapter{chp:Parallel Real-Time Computing}{Parallel Real-Time Computing} - -\epigraph{The difference between you and me is that I was right in time.} +% +\Epigraph{The difference between you and me is that I was right in time.} {\emph{Konrad Adenauer}} An important emerging area in computing is that of parallel real-time
together/together.tex +2 -2
@@ -2,8 +2,8 @@ % SPDX-License-Identifier: CC-BY-SA-3.0 \QuickQuizChapter{chp:Putting It All Together}{Putting It All Together} - -\epigraph{You don't learn how to shoot and then learn how to launch +% +\Epigraph{You don't learn how to shoot and then learn how to launch and then learn to do a controlled spin---you learn to launch-shoot-spin.}{\emph{``Ender's Shadow'', Orson Scott Card}}
toolsoftrade/toolsoftrade.tex +2 -2
@@ -1,8 +1,8 @@ % toolsoftrade/toolsoftrade.tex \QuickQuizChapter{chp:Tools of the Trade}{Tools of the Trade} - -\epigraph{You are only as good as your tools, and your tools are only +% +\Epigraph{You are only as good as your tools, and your tools are only as good as you are.}{\emph{Unknown}} This chapter provides a brief introduction to some basic tools of the
Signature · 1 line
1.9.1
RFC 5/6 epigraph: Increase width a little
In reply to Akira YokosawaFrom 57f60ab066cd0f1a54f4888baed19a7a289e59bc Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 11 Sep 2016 20:34:47 +0900
Subject: [RFC PATH 5/6] epigraph: Increase width a little
--- perfbook.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
perfbook.tex +1 -1
@@ -32,7 +32,7 @@ \usepackage{footnotebackref} % to enable cross-ref of footnote \usepackage[all]{hypcap} % for going to the top of figure and table \usepackage{epigraph} -\setlength{\epigraphwidth}{2.3in} +\setlength{\epigraphwidth}{2.6in} \usepackage[xspace]{ellipsis} % custom packages
Signature · 1 line
1.9.1
RFC 6/6 Tweak page layout of onecolumn
In reply to Akira YokosawaFrom 85e0ec292cb75cad1ef71812fee11ed44ecc4ce8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Mon, 12 Sep 2016 06:55:49 +0900
Subject: [RFC PATH 6/6] Tweak page layout of onecolumn
The use of \epigraphhead{} requires proper layout of header. This commit enables default page layout for onecolumn by modifying the sed pattern in Makefile and adjusting layout width params in the preamble.
--- Makefile | 2 +- perfbook.tex | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-)
Makefile +1 -1
@@ -93,7 +93,7 @@ perfbook-1c.pdf: perfbook-1c.tex perfbook-1c.bbl sh utilities/runlatex.sh perfbook-1c perfbook-1c.tex: perfbook.tex - sed -e 's/,twocolumn//' -e '/^\\frontmatter/a \\\\pagestyle{plain}' -e 's/setboolean{twocolumn}{true}/setboolean{twocolumn}{false}/' < perfbook.tex > perfbook-1c.tex + sed -e 's/,twocolumn//' -e 's/setboolean{twocolumn}{true}/setboolean{twocolumn}{false}/' < perfbook.tex > perfbook-1c.tex perfbook-1c.bbl: $(BIBSOURCES) perfbook-1c.aux bibtex perfbook-1c
perfbook.tex +10 -4
@@ -88,10 +88,6 @@ \renewcommand\dbltopfraction{.75} \renewcommand\dblfloatpagefraction{.5} -\setlength{\textheight}{8.25in} -\setlength{\textwidth}{6.5in} -\setlength{\columnsep}{0.25in} - \newboolean{inbook} \setboolean{inbook}{true} \newcommand{\IfInBook}[2]{\ifthenelse{\boolean{inbook}}{#1}{#2}}
@@ -102,6 +98,16 @@ \setboolean{hardcover}{false} \newcommand{\IfHardCover}[2]{\ifthenelse{\boolean{hardcover}}{#1}{#2}} +\IfTwoColumn{ +\setlength{\textheight}{8.25in} +\setlength{\textwidth}{6.5in} +\setlength{\columnsep}{0.25in} +}{ +\setlength{\textheight}{8.25in} +\setlength{\textwidth}{4.75in} +\setlength{\columnsep}{0in} +} + \IfHardCover{ \setlength{\topmargin}{13pt} \setlength{\evensidemargin}{-4pt}
Signature · 1 line
1.9.1
Quoted 27 lines · Akira Yokosawa
Quoted 1 line
From
85e0ec292cb75cad1ef71812fee11ed44ecc4ce8Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Mon, 19 Sep 2016 11:07:31 +0900
Subject: [RFC PATH 0/6] Indent tweaks after chapter title and epigraphHi Paul,
After commit
a9fe7df2efbc("treewide: Enclose 'verbbox' within 'figure'"), inconsistency of indent of first paragraph of a chapter became more disturbing (maybe just for me).I noticed "book.cls" is already localized in the repository, and found a possible fix of the behavior of chapter heading in twocolumn layout there.
As for epigraph, there are two ways to make the following paragraph not to indent.
One is to patch the "\epigraph" command to put "afterheading-ness" at the end of the command.
The other is to use "\epigraphhead" and place the epigraph at the header area of a page.My preference is to place epigraphs at he right hand side of the page even in twocolumn layout. The effect of using "epigraphhead" command is not identical to what I wanted, but the result seems better than what I had first anticipated.
Quoted 4 lines
So, I chose the latter approach and composed this series to do the change.
I'd like you to try it and give me feedback if any.
This looks much nicer! Queued and pushed.
Thanx, Paul
Quoted 39 lines
Thanks, Akira
----Akira Yokosawa (6):
Update book.cls
book.cls: Fix indent after \chapter in twocolumn
Makefile: Add localized 'book.cls' to dependency
epigraph: Use \epigraphhead{}
epigraph: Increase width a little
Tweak page layout of onecolumnMakefile | 3 ++- SMPdesign/SMPdesign.tex | 4 ++-- advsync/advsync.tex | 4 ++-- appendix/ack/ack.tex | 4 ++-- appendix/questions/questions.tex | 4 ++-- book.cls | 21 +++++++++++++++------ count/count.tex | 4 ++-- cpu/cpu.tex | 4 ++-- datastruct/datastruct.tex | 4 ++-- debugging/debugging.tex | 4 ++-- defer/defer.tex | 4 ++-- easy/easy.tex | 4 ++-- formal/formal.tex | 4 ++-- future/future.tex | 4 ++-- glossary.tex | 4 ++-- intro/intro.tex | 4 ++-- locking/locking.tex | 4 ++-- owned/owned.tex | 4 ++-- perfbook.tex | 17 ++++++++++++----- qqz.sty | 2 +- rt/rt.tex | 4 ++-- together/together.tex | 4 ++-- toolsoftrade/toolsoftrade.tex | 4 ++-- 23 files changed, 68 insertions(+), 51 deletions(-)Signature · 1 line
1.9.1