All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH -perfbook 1/4] ebook: Allocate enough width for four-digit page counts in TOC
Date: Tue, 28 Dec 2021 23:27:06 +0900	[thread overview]
Message-ID: <2ef395db-5c2f-a7a2-ddaa-d41fe1e7cb25@gmail.com> (raw)
In-Reply-To: <4fde622a-0aa3-e6df-1b20-1469ed676813@gmail.com>

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



  reply	other threads:[~2021-12-28 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-28 14:25 [PATCH -perfbook 0/4] ebook: Improve overall page layout Akira Yokosawa
2021-12-28 14:27 ` Akira Yokosawa [this message]
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 ` [PATCH -perfbook 3/4] ebook: Use normal epigraph for chapter headings 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ef395db-5c2f-a7a2-ddaa-d41fe1e7cb25@gmail.com \
    --to=akiyks@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.