All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <bsingharora@gmail.com>
To: perfbook@vger.kernel.org
Subject: [RFC PATCH] perfbook/papersize: ebook reader size support
Date: Tue, 23 Mar 2021 12:01:53 +1100	[thread overview]
Message-ID: <20210323010153.GH77072@balbir-desktop> (raw)


Add support for ebooksize, which is roughly the size of
a kindle (4.5in, 6.3in) with margin size of 0.2in. The
recommended changes were taken from stackexchange with
links in the code. Not all tables take nicely to the
new nice and warnings are produced, which causes warnings
about overfull hbox's to be generated. This mode enforces
single column output and increases the size of the pdf
by almost 40% in terms of number of pages. The final output
though is very readable on the kindle I own.

I've been running the command via

env PERFBOOK_PAPER=ER make perfbook-1c.pdf

and love the output so far.

Signed-off-by: Balbir singh <bsingharora@gmail.com>
---
 Makefile        |  7 +++++++
 perfbook-lt.tex | 13 ++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index db20da96..3732ba18 100644
--- a/Makefile
+++ b/Makefile
@@ -178,10 +178,14 @@ ifeq ($(PERFBOOK_PAPER),A4)
 else
 ifeq ($(PERFBOOK_PAPER),HB)
 	PERFBOOK_BASE = perfbook-hb.tex
+else
+ifeq ($(PERFBOOK_PAPER),ER)
+	PERFBOOK_BASE = perfbook-er.tex
 else
 	PERFBOOK_BASE = perfbook-lt.tex
 endif
 endif
+endif
 
 .PHONY: all touchsvg clean distclean neatfreak 2c ls-unused $(ABBREVTARGETS) mslm perfbook-mslm.pdf mslmmsg help help-official help-full
 all: $(targ)
@@ -283,6 +287,9 @@ perfbook-1c.tex: $(PERFBOOK_BASE)
 perfbook-hb.tex: perfbook-lt.tex
 	sed -e 's/setboolean{hardcover}{false}/setboolean{hardcover}{true}/' < $< > $@
 
+perfbook-er.tex: perfbook-lt.tex
+	sed -e 's/setboolean{ebooksize}{false}/setboolean{ebooksize}{true}/' < $< > $@
+
 perfbook-msns.tex: $(PERFBOOK_BASE)
 	sed -e 's/%msfontstub/\\usepackage{courier}/' < $< > $@
 
diff --git a/perfbook-lt.tex b/perfbook-lt.tex
index e76d4d7b..a884011a 100644
--- a/perfbook-lt.tex
+++ b/perfbook-lt.tex
@@ -116,6 +116,9 @@
 \newboolean{hardcover}
 \setboolean{hardcover}{false}
 \newcommand{\IfHardCover}[2]{\ifthenelse{\boolean{hardcover}}{#1}{#2}}
+\newboolean{ebooksize}
+\setboolean{ebooksize}{false}
+\newcommand{\IfEbookSize}[2]{\ifthenelse{\boolean{ebooksize}}{#1}{#2}}
 \newboolean{afourpaper}
 \setboolean{afourpaper}{false}
 \newcommand{\IfAfourPaper}[2]{\ifthenelse{\boolean{afourpaper}}{#1}{#2}}
@@ -320,6 +323,14 @@
       \usepackage[letterpaper,body={6.5in,8.25in},twocolumn,columnsep=0.25in]{geometry}      
 }}}{ % One Column
   \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]{geometry}
+    \sloppy
+    %\pagestyle{empty}
+    %\usepackage[scaled]{helvet}
+    %\renewcommand{\familydefault}{\sfdefault}
+  }{
   \IfHardCover{
     \usepackage[papersize={8.25in,10.75in},body={4.75in,8.25in},onecolumn]{geometry}
   }{
@@ -327,7 +338,7 @@
     \usepackage[a4paper,body={4.75in,8.25in},onecolumn]{geometry}
     }{
     \usepackage[letterpaper,body={4.75in,8.25in},onecolumn]{geometry}
-  }}
+  }}}
   \geometry{hcentering=true} % horizontal centering for 1c layouts
 }
 \IfAfourPaper{
-- 
2.25.1


             reply	other threads:[~2021-03-23  1:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23  1:01 Balbir Singh [this message]
2021-03-23  5:23 ` [RFC PATCH] perfbook/papersize: ebook reader size support Paul E. McKenney
2021-03-23  6:26   ` Balbir Singh
2021-03-23  9:38   ` Balbir Singh
2021-03-23 13:39     ` Akira Yokosawa
2021-03-23 16:10       ` Paul E. McKenney
2021-03-24  1:15       ` Balbir Singh
2021-03-24  2:35         ` Akira Yokosawa
2021-03-24  2:37           ` [RFC PATCH 1/2] perfbook-lt: Add macro to shrink floats for ebook Akira Yokosawa
2021-03-24  2:38           ` [RFC PATCH 2/2] cpu, toolsoftrade, count, rcuapi: Shrink floats for ebook reader Akira Yokosawa
2021-03-24  7:27           ` [RFC PATCH] perfbook/papersize: ebook reader size support Balbir Singh
2021-03-24 14:34             ` Akira Yokosawa
2021-03-25 10:49 ` [PATCH -perfbook 0/5] " Akira Yokosawa
2021-03-25 10:52   ` [PATCH -perfbook 1/5] perfbook/papersize: " Akira Yokosawa
2021-03-25 10:55   ` [PATCH -perfbook 2/5] perfbook-lt: Add macros to shrink floats for ebook Akira Yokosawa
2021-03-25 10:57   ` [PATCH -perfbook 3/5] cpu, toolsoftrade, count, rcuapi: Shrink floats for ebook reader Akira Yokosawa
2021-03-25 10:58   ` [PATCH -perfbook 4/5] styleguide: Adjust float size and add a floatbarrier for ebook-size build Akira Yokosawa
2021-03-25 11:00   ` [PATCH -perfbook 5/5] Makefile: Add info on ebooksize build in help and help-full Akira Yokosawa
2021-03-26  6:35     ` Balbir Singh
2021-03-26 11:42       ` Akira Yokosawa
2021-03-27 16:33         ` Paul E. McKenney
2021-03-25 11:41   ` [PATCH -perfbook 0/5] ebook reader size support Akira Yokosawa
2021-03-25 16:16   ` Paul E. McKenney
2021-03-25 19:24     ` Akira Yokosawa
2021-03-26  0:12       ` Paul E. McKenney
2021-03-26  0:26         ` Akira Yokosawa
2021-03-26  0:51           ` Paul E. McKenney
2021-03-26  1:08             ` Akira Yokosawa

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=20210323010153.GH77072@balbir-desktop \
    --to=bsingharora@gmail.com \
    --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.