ebook: Improve overall page layout
cover ebook: Improve overall page layout
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.
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
Signature · 1 line
2.17.1
PATCH 1/4 ebook: Allocate enough width for four-digit page counts in TOC
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.
--- perfbook-lt.tex | 7 +++++++ 1 file changed, 7 insertions(+)
perfbook-lt.tex +7 -0
@@ -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} }{
Signature · 1 line
2.17.1
PATCH 2/4 ebook: Print page counts on upper-right edge of page
In reply to Akira YokosawaPage 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.
--- perfbook-lt.tex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
perfbook-lt.tex +9 -1
@@ -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}
Signature · 1 line
2.17.1
PATCH 3/4 ebook: Use normal epigraph for chapter headings
In reply to Akira YokosawaThe \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.
--- perfbook-lt.tex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
perfbook-lt.tex +5 -1
@@ -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
Signature · 1 line
2.17.1
PATCH 4/4 ebook: Reduce chapter heading's font size and spaces
In reply to Akira YokosawaThe 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.
--- perfbook-lt.tex | 4 ++++ 1 file changed, 4 insertions(+)
perfbook-lt.tex +4 -0
@@ -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}
Signature · 1 line
2.17.1
Quoted 11 lines · Akira Yokosawa
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.
Quoted 7 lines
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
Quoted 16 lines
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 spacesperfbook-lt.tex | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-)base-commit:
204f9c99b8c56f68b0e6c7ffb8d63f7699643c1aSignature · 1 line
2.17.1