Skip to contentSkip to conversation

Layout tweaks for 2c layout

PATCH In review Akira Yokosawa 2 participants 7 messages Jan 26, 2017

lore
Share & tools
lore
#0 lore raw

cover Layout tweaks for 2c layout

From 15aea071f9a8ff33b0f97310b2afd4730d33afa1 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Thu, 26 Jan 2017 23:25:08 +0900
Subject: [PATCH 0/5] Layout tweaks for 2c layout

Hi Paul,

This is *not* a bibliography update.

Because of wide textwidth for two-column layout, the cover page, legal section, and TOC, which are one column, looks too wide.

Patch 1 adds an explicit line break before "What" in the title. Another candidate might be before "And, If So,", but I think this looks better.

Patch 2 narrows effective textwidth of legal section and TOC as the same as that of one-column layout by using "changepage" package.

Patches 3 and 4 can be regarded as a workaround of build error in 2c layout when "inlinelinks" is enabled. By using one-column layout for bibliography, the issue can be avoided. Also, wider column width permits freedom in typesetting of "alpha" style bibliography. The effective textwidth for bibliography is a little wider than the one-column one considering indent of entries. You might want to skip patch 4 which enables inlinelinks, but as far as I could test by choosing varieties of monospace fonts, there was no build error caused by hyperlinks in bibliography.

Patch 5 tweaks parameters for placement for floating objects. In two-column layout, when a not so tall figure occupies a column, it looks imbalanced if the neighboring column is flushed from top to bottom. By increasing "floatpagefraction", such placements can be prevented.

Please give it a try and let me know what you think.

Thanks, Akira
--
Akira Yokosawa (5):
Specify line break in title of cover page Narrow textwidth of legal and TOB pages in 2c build Change bibliography to one-column layout in 2c build Enable inlinelinks for 2c build
Increase floatpagefraction for 2c layout

 appendix/appendix.tex |  6 +++++-
 legal.tex             |  4 ----
 perfbook.tex          | 13 ++++++++++++-
 3 files changed, 17 insertions(+), 6 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/5 Specify line break in title of cover page

From 57ee8a0a075853ce99cdeede7d86f937b13c7817 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 7 Jan 2017 10:38:45 +0900
Subject: [PATCH 1/5] Specify line break in title of cover page

Breaking before "What" would make the title be more appealing.

---
 perfbook.tex | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
perfbook.tex +3 -1
index 79f26ab..2c13e3f 100644
@@ -106,7 +106,9 @@
 \input{ushyphex} % Hyphenation exceptions for US English from hyphenex package
 \input{pfhyphex} % Hyphenation exceptions for perfbook
 
-\title{Is Parallel Programming Hard, And, If So, What Can You Do About It?}
+\title{
+  Is Parallel Programming Hard, And, If So, \\
+  What Can You Do About It?}
 \author{
 	Edited by: \\
 	\\
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/5 Narrow textwidth of legal and TOB pages in 2c build

In reply to Akira Yokosawa

From 57d4d9e8ee4f106068747e46b3d3e4bbbc2e4774 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 7 Jan 2017 20:31:47 +0900
Subject: [PATCH 2/5] Narrow textwidth of legal and TOB pages in 2c build

In 2c layout, these pages look too wide.
By using "changepage" package, this commit narrows their effective textwidths as the same as in 1c layout. It also moves commands to switch between onecolumn and twocolumn layouts in legal.tex to perfbook.tex.

---
 legal.tex    | 4 ----
 perfbook.tex | 8 ++++++++
 2 files changed, 8 insertions(+), 4 deletions(-)
legal.tex +0 -4
index 965c76e..fbd62ff 100644
@@ -1,8 +1,6 @@
 % legal.tex
 % SPDX-License-Identifier: CC-BY-SA-3.0
 
-\IfTwoColumn{\onecolumn}{}
-
 \section*{Legal Statement}
 
 This work represents the views of the editor and the authors and does not
@@ -43,5 +41,3 @@ If you are unsure of the license for a given code fragment,
 you should assume GPLv2-only.
 
 Combined work {\textcopyright}~2005-\commityear\ by Paul E. McKenney.
-
-\IfTwoColumn{\twocolumn}{}
perfbook.tex +8 -0
index 2c13e3f..a3b2d84 100644
@@ -27,6 +27,7 @@
 \usepackage{ifthen}
 \usepackage{xcolor}
 \usepackage[shortcuts]{extdash}
+\usepackage{changepage}
 \usepackage{listings}
 \lstset{basicstyle=\ttfamily}
 % \usepackage[strings]{underscore}
@@ -153,8 +154,15 @@
 \frontmatter
 
 \maketitle
+\IfTwoColumn{
+  \onecolumn\begin{adjustwidth*}{.95in}{.8in}
+  \addtolength{\parindent}{6pt}
+}{}
 \input{legal}
 \tableofcontents
+\IfTwoColumn{
+  \end{adjustwidth*}\twocolumn
+}{}
 
 \mainmatter
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/5 Change bibliography to one-column layout in 2c build

In reply to Akira Yokosawa

From de94fc449731fc99ae5d608eb5f01cde08037088 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 8 Jan 2017 07:57:48 +0900
Subject: [PATCH 3/5] Change bibliography to one-column layout in 2c build

This change makes it easy to typeset bibliography. Two column layout is too tight for bibliography entries that contain urls in alpha style.

---
 appendix/appendix.tex | 3 +++
 1 file changed, 3 insertions(+)
appendix/appendix.tex +3 -0
index c4bb6cd..e231b28 100644
@@ -6,9 +6,12 @@
 \QuickQuizAnswers
 \input{glossary.tex}
 \IfTwoColumn{
+\onecolumn\begin{adjustwidth*}{.8in}{.7in}
 \bibliographystyle{alpha}   % Use genuine alpha style
 }{
 \bibliographystyle{alphapf} % Use alpha style customized by urlbst with --inlinelinks option
 }
 \bibliography{bib/RCU,bib/WFS,bib/hw,bib/os,bib/parallelsys,bib/patterns,bib/perfmeas,bib/refs,bib/syncrefs,bib/search,bib/swtools,bib/realtime,bib/TM,bib/standards,bib/OSS,bib/maze,bib/energy}
+\IfTwoColumn{
+\end{adjustwidth*}\twocolumn}{}
 \include{appendix/ack/ack}
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/5 Enable inlinelinks for 2c build

In reply to Akira Yokosawa

From 51586d7d3289e407879416353e05c77d54de3542 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sun, 8 Jan 2017 08:04:14 +0900
Subject: [PATCH 4/5] Enable inlinelinks for 2c build

Changing layout of bibliography to one column permits us to enable inlinelinks in 2c build. Build failure caused by a link crossing a page/column boundary is observed only in two-column layout so far.

---
 appendix/appendix.tex | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
appendix/appendix.tex +2 -1
index e231b28..6385bc2 100644
@@ -7,7 +7,8 @@
 \input{glossary.tex}
 \IfTwoColumn{
 \onecolumn\begin{adjustwidth*}{.8in}{.7in}
-\bibliographystyle{alpha}   % Use genuine alpha style
+%\bibliographystyle{alpha}   % Use genuine alpha style (In case of build failure, use this instead)
+\bibliographystyle{alphapf} % Use alpha style customized by urlbst with --inlinelinks option
 }{
 \bibliographystyle{alphapf} % Use alpha style customized by urlbst with --inlinelinks option
 }
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/5 Increase floatpagefraction for 2c layout

In reply to Akira Yokosawa

From 15aea071f9a8ff33b0f97310b2afd4730d33afa1 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Thu, 29 Dec 2016 18:27:31 +0900
Subject: [PATCH 5/5] Increase floatpagefraction for 2c layout

In 2c layout, it sometimes looks imbalanced when a floating figure or table with the "[p]" option occupies a column while its next column is flushed from top to bottom. This is because "floatpagefraction" command is defined as .5 (a figure or a table whose height is 50% or more of textheight can occupy a column).

To prevent such occupations from happening in 2c layout, this commit sets floatpagefraction as the same as "topfraction" command for 2c.

This change will reduce typeset freedom of TeX engine, and might cause some floating objects to be placed further from where they are referenced in the text. If this causes an undesirable result, we might need to reduce the value of floatpagefraction.

---
 perfbook.tex | 1 +
 1 file changed, 1 insertion(+)
perfbook.tex +1 -0
index a3b2d84..324c708 100644
@@ -136,6 +136,7 @@
 \setlength{\textheight}{8.25in}
 \setlength{\textwidth}{6.5in}
 \setlength{\columnsep}{0.25in}
+\renewcommand\floatpagefraction{.75}
 }{
 \setlength{\textheight}{8.25in}
 \setlength{\textwidth}{4.75in}
Signature · 1 line
2.7.4
#6 lore raw
In reply to Akira Yokosawa
Quoted 27 lines · Akira Yokosawa
Quoted 1 line

From 15aea071f9a8ff33b0f97310b2afd4730d33afa1 Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Thu, 26 Jan 2017 23:25:08 +0900
Subject: [PATCH 0/5] Layout tweaks for 2c layout

Hi Paul,

This is *not* a bibliography update.

Because of wide textwidth for two-column layout, the cover page, legal section, and TOC, which are one column, looks too wide.

Patch 1 adds an explicit line break before "What" in the title. Another candidate might be before "And, If So,", but I think this looks better.

Patch 2 narrows effective textwidth of legal section and TOC as the same as that of one-column layout by using "changepage" package.

Patches 3 and 4 can be regarded as a workaround of build error in 2c layout when "inlinelinks" is enabled. By using one-column layout for bibliography, the issue can be avoided. Also, wider column width permits freedom in typesetting of "alpha" style bibliography. The effective textwidth for bibliography is a little wider than the one-column one considering indent of entries. You might want to skip patch 4 which enables inlinelinks, but as far as I could test by choosing varieties of monospace fonts, there was no build error caused by hyperlinks in bibliography.

Quoted 6 lines

Patch 5 tweaks parameters for placement for floating objects. In two-column layout, when a not so tall figure occupies a column, it looks imbalanced if the neighboring column is flushed from top to bottom. By increasing "floatpagefraction", such placements can be prevented.

Please give it a try and let me know what you think.

It does look quite good -- queued and pushed, thank you!

Thanx, Paul

Quoted 17 lines

Thanks, Akira
--
Akira Yokosawa (5):
Specify line break in title of cover page Narrow textwidth of legal and TOB pages in 2c build Change bibliography to one-column layout in 2c build Enable inlinelinks for 2c build
Increase floatpagefraction for 2c layout

 appendix/appendix.tex |  6 +++++-
 legal.tex             |  4 ----
 perfbook.tex          | 13 ++++++++++++-
 3 files changed, 17 insertions(+), 6 deletions(-)
Signature · 1 line
2.7.4