* [PATCH -perfbook 1/4] ebook: Allocate enough width for four-digit page counts in TOC
2021-12-28 14:25 [PATCH -perfbook 0/4] ebook: Improve overall page layout Akira Yokosawa
@ 2021-12-28 14:27 ` Akira Yokosawa
2021-12-28 14:29 ` [PATCH -perfbook 2/4] ebook: Print page counts on upper-right edge of page Akira Yokosawa
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2021-12-28 14:27 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
Width of page counts in TOC is maintained as a LaTeX command named
\@pnumwidth (defined and referenced in book.cls) with the default
width of 1.55em.
1.55em can cover up to three-digit (< 1000) pages.
In ebook-sized builds, the page count exceeds 1000.
Four-digit pages can be covered by 2.2em (for the slightly wider
sans-serif font).
Conditionally redefine \@pnumwidth in "eb" builds.
Note:
Final page count of 1c build is 914 now.
When it exceeds 1000, \IfTwoColumn should be used instead for
the conditional.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
perfbook-lt.tex | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/perfbook-lt.tex b/perfbook-lt.tex
index e8acf779..eb5c31d6 100644
--- a/perfbook-lt.tex
+++ b/perfbook-lt.tex
@@ -151,6 +151,13 @@
\setboolean{indexhier}{true}
\newcommand{\IfIndexHier}[2]{\ifthenelse{\boolean{indexhier}}{#1}{#2}}
+% Widen pnumwidth in TOC for ebook size build (more than 1000 pages)
+\makeatletter
+\IfEbookSize{
+\renewcommand*\@pnumwidth{2.2em}
+}{}
+\makeatother
+
\IfEbookSize{
\usepackage[section]{placeins}
}{
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH -perfbook 2/4] ebook: Print page counts on upper-right edge of page
2021-12-28 14:25 [PATCH -perfbook 0/4] ebook: Improve overall page layout Akira Yokosawa
2021-12-28 14:27 ` [PATCH -perfbook 1/4] ebook: Allocate enough width for four-digit page counts in TOC Akira Yokosawa
@ 2021-12-28 14:29 ` Akira Yokosawa
2021-12-28 14:31 ` [PATCH -perfbook 3/4] ebook: Use normal epigraph for chapter headings Akira Yokosawa
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2021-12-28 14:29 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
Page counts at the header area are invisible due to the narrow
margin of 0.2in.
Use fancyhdr package and print page counts close to the top edge of
paper. Print them in "Grey" color and scriptsize font so that they
won't distract readers too much.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
perfbook-lt.tex | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/perfbook-lt.tex b/perfbook-lt.tex
index eb5c31d6..ec3e38e1 100644
--- a/perfbook-lt.tex
+++ b/perfbook-lt.tex
@@ -401,9 +401,17 @@
\setlength{\twocolumnwidth}{3.125in}
\IfEbookSize {
% From https://tex.stackexchange.com/questions/16735/latex-options-for-kindle
- \usepackage[papersize={4.5in,6.3in},margin=0.2in,onecolumn,twoside=false]{geometry}
+ \usepackage[papersize={4.5in,6.3in},margin=0.2in,footskip=0.2in,
+ headsep=0.05in,headheight=0.15in,onecolumn,twoside=false]{geometry}
\sloppy
\setlength{\onecolumntextwidth}{4.1in}
+ \usepackage{fancyhdr}
+ \fancypagestyle{plain}{%
+ \fancyhf{} % clear all header and footer fields
+ \renewcommand{\headrulewidth}{0pt}
+ \rhead{\textcolor{Grey}{\scriptsize\thepage}}
+ }
+ \pagestyle{plain}
%\pagestyle{empty}
%\usepackage[scaled]{helvet}
%\renewcommand{\familydefault}{\sfdefault}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH -perfbook 3/4] ebook: Use normal epigraph for chapter headings
2021-12-28 14:25 [PATCH -perfbook 0/4] ebook: Improve overall page layout Akira Yokosawa
2021-12-28 14:27 ` [PATCH -perfbook 1/4] ebook: Allocate enough width for four-digit page counts in TOC Akira Yokosawa
2021-12-28 14:29 ` [PATCH -perfbook 2/4] ebook: Print page counts on upper-right edge of page Akira Yokosawa
@ 2021-12-28 14:31 ` Akira Yokosawa
2021-12-28 14:33 ` [PATCH -perfbook 4/4] ebook: Reduce chapter heading's font size and spaces Akira Yokosawa
2021-12-28 17:06 ` [PATCH -perfbook 0/4] ebook: Improve overall page layout Paul E. McKenney
4 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2021-12-28 14:31 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
The \epigraphhead command (of epigraph package) redefines chapter
page style. This overwrites fancyhdr's settings.
Also, the epigraphs above chapter titles sometime look busy in
ebook-sized builds.
Therefore, switch to normal style epigraphs printed below chapter
headings for ebook-sized builds.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
perfbook-lt.tex | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/perfbook-lt.tex b/perfbook-lt.tex
index ec3e38e1..c45d033c 100644
--- a/perfbook-lt.tex
+++ b/perfbook-lt.tex
@@ -509,7 +509,11 @@
%\newcommand{\IRQ}{irq} % For those who prefer "irq"
\newcommand{\rt}{\mbox{-rt}} % to prevent line break behind "-"
-\newcommand{\Epigraph}[2]{\epigraphhead[65]{\epigraph{#1}{#2}}}
+\IfEbookSize{
+ \newcommand{\Epigraph}[2]{\epigraph{#1}{#2}}
+}{
+ \newcommand{\Epigraph}[2]{\epigraphhead[65]{\epigraph{#1}{#2}}}
+}
\input{ushyphex} % Hyphenation exceptions for US English from hyphenex package
\input{pfhyphex} % Hyphenation exceptions for perfbook
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH -perfbook 4/4] ebook: Reduce chapter heading's font size and spaces
2021-12-28 14:25 [PATCH -perfbook 0/4] ebook: Improve overall page layout Akira Yokosawa
` (2 preceding siblings ...)
2021-12-28 14:31 ` [PATCH -perfbook 3/4] ebook: Use normal epigraph for chapter headings Akira Yokosawa
@ 2021-12-28 14:33 ` Akira Yokosawa
2021-12-28 17:06 ` [PATCH -perfbook 0/4] ebook: Improve overall page layout Paul E. McKenney
4 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2021-12-28 14:33 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
The default font size of \Huge for chapter headings is too large
in ebook-sized builds.
Reduce the size and spaces around them by adding titlesec settings.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
perfbook-lt.tex | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/perfbook-lt.tex b/perfbook-lt.tex
index c45d033c..cdc0acc7 100644
--- a/perfbook-lt.tex
+++ b/perfbook-lt.tex
@@ -415,6 +415,10 @@
%\pagestyle{empty}
%\usepackage[scaled]{helvet}
%\renewcommand{\familydefault}{\sfdefault}
+ % Smaller font and tighter space for chapter title
+ \titleformat{\chapter}[display]{\normalfont\bfseries}
+ {\Large\chaptertitlename~\thechapter}{0pt}{\LARGE}
+ \titlespacing*{\chapter}{0pt}{*1}{*2}
}{
\IfHardCover{
\usepackage[papersize={8.25in,10.75in},body={4.75in,8.25in},onecolumn]{geometry}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH -perfbook 0/4] ebook: Improve overall page layout
2021-12-28 14:25 [PATCH -perfbook 0/4] ebook: Improve overall page layout Akira Yokosawa
` (3 preceding siblings ...)
2021-12-28 14:33 ` [PATCH -perfbook 4/4] ebook: Reduce chapter heading's font size and spaces Akira Yokosawa
@ 2021-12-28 17:06 ` Paul E. McKenney
4 siblings, 0 replies; 6+ messages in thread
From: Paul E. McKenney @ 2021-12-28 17:06 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: perfbook
On Tue, Dec 28, 2021 at 11:25:01PM +0900, Akira Yokosawa wrote:
> Hi Paul,
>
> Now that the ebook-sized build is provided at the landing page,
> I am trying to improve its overall looks.
>
> Here are a couple of minor issues as of current master:
>
> 1) In TOC, page counts larger than 999 don't align properly.
> 2) Page counts are invisible (printed out of paper area).
> 3) Chapter headings are too large for ebook size.
>
> Patch 1/4 resolves issue #1.
> Patch 2/4 restores page counts in a way not that distracting.
> This is done by the help of the fancyhdr package.
> Patch 3/4 changes chapter-wise epigraph position to below chapter
> heading. This looks better in ebook-sized builds and avoids
> conflict between fancyhdr and epigraph packages.
> Patch 4/4 resolves issue #3.
Nice improvements!!! Queued and pushed, thank you!
Thanx, Paul
> Thanks, Akira
> --
> Akira Yokosawa (4):
> ebook: Allocate enough width for four-digit page counts in TOC
> ebook: Print page counts on upper-right edge of page
> ebook: Use normal epigraph for chapter headings
> ebook: Reduce chapter heading's font size and spaces
>
> perfbook-lt.tex | 27 +++++++++++++++++++++++++--
> 1 file changed, 25 insertions(+), 2 deletions(-)
>
>
> base-commit: 204f9c99b8c56f68b0e6c7ffb8d63f7699643c1a
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread