Layout tweaks for 1c layout
PATCH 1/1 Layout tweaks for 1c layout
From 5de4d0c55d19b94e7e7ef6c69bb497324e443977 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Thu, 5 Jan 2017 16:42:41 +0900
Subject: [PATCH] Layout tweaks for 1c layout
Tweak horizontal spaces of wide figures and tables for 1c layout using a macro derived from \IfTwoColumn{}{}.
---
Hi Paul,
This is in response to commit b9ffcb217d7b ("Adjust "Notification Insufficient" cartoon for single-column"), which uses \textwidth to support both 2c and 1c layouts.
There are other wide figures and tables that run past the right-side margins in 1c layout. They are mostly text (code snippets and tables), and using \resizebox{} with \textwidth for them will cause inconsistent looks.
So I defined a macro derived from \IfTwoColumn{}{} which works only in one-column layout. By using the macro, they can be placed near the center of the pages in 1c layout. The tweaks might look ad hoc, but they are not so many and should be manageable (I hope).
Thanks, Akira
defer/rcuusage.tex | 6 +++--- defer/whichtochoose.tex | 2 +- future/HTMtable.tex | 2 +- future/HTMtableRCU.tex | 2 +- howto/howto.tex | 10 ++++++---- perfbook.tex | 2 ++ 6 files changed, 14 insertions(+), 10 deletions(-)
defer/rcuusage.tex +3 -3
@@ -617,7 +617,7 @@ Wikipedia~\cite{WikipediaRCU}. 9 LIST_HEAD(head); 9 LIST_HEAD(head); \end{verbbox} } -\hspace*{5em} +\hspace*{0.9in}\OneColumnHSpace{-0.5in} \theverbbox \caption{Converting Reader-Writer Locking to RCU: Data} \label{fig:defer:Converting Reader-Writer Locking to RCU: Data}
@@ -643,7 +643,7 @@ Wikipedia~\cite{WikipediaRCU}. 15 } 15 } \end{verbbox} } -\hspace*{5em} +\hspace*{0.9in}\OneColumnHSpace{-0.5in} \theverbbox \caption{Converting Reader-Writer Locking to RCU: Search} \label{fig:defer:Converting Reader-Writer Locking to RCU: Search}
@@ -671,7 +671,7 @@ Wikipedia~\cite{WikipediaRCU}. 16 } 17 } \end{verbbox} } -\hspace*{5em} +\hspace*{0.9in}\OneColumnHSpace{-0.5in} \theverbbox \caption{Converting Reader-Writer Locking to RCU: Deletion} \label{fig:defer:Converting Reader-Writer Locking to RCU: Deletion}
defer/whichtochoose.tex +1 -1
@@ -6,7 +6,7 @@ \begin{table*} \footnotesize -\centering\tymin=0.4in\tymax=2in +\centering\tymin=0.4in\tymax=2in\OneColumnHSpace{-.3in} \begin{tabulary}{5.3in}{L||L|L|L|L} & Reference Counting
future/HTMtable.tex +1 -1
@@ -4,7 +4,7 @@ \begin{table*}[p] \centering % \scriptsize -\small +\small\OneColumnHSpace{-.8in} \begin{tabular}{p{1.0in}||c|p{2.0in}||c|p{2.0in}} & \multicolumn{2}{c||}{Locking} & \multicolumn{2}{c}{Hardware Transactional Memory} \\ \hline
future/HTMtableRCU.tex +1 -1
@@ -3,7 +3,7 @@ \begin{table*}[p] \centering -\small +\small\OneColumnHSpace{-.8in} %\raggedright \begin{tabular}{p{1.0in}||c|p{2.0in}||c|p{2.0in}} & \multicolumn{2}{c||}{Locking with RCU or Hazard Pointers} & \multicolumn{2}{c}{Hardware Transactional Memory} \\
howto/howto.tex +6 -4
@@ -362,7 +362,7 @@ Other types of systems have well-known ways of locating files by filename. \begin{figure*}[tbp] { \scriptsize -\begin{verbatim} +\begin{verbbox} 1 git clone git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/perfbook.git 2 cd perfbook 3 # You may need to install a font here. See item 1 in FAQ.txt.
@@ -370,8 +370,9 @@ Other types of systems have well-known ways of locating files by filename. 5 evince perfbook.pdf & # Two-column version 6 make perfbook-1c.pdf 7 evince perfbook-1c.pdf & # One-column version for e-readers -\end{verbatim} +\end{verbbox} } +\hspace*{1in}\OneColumnHSpace{-0.5in}\theverbbox \caption{Creating an Up-To-Date PDF} \label{fig:howto:Creating a Up-To-Date PDF} \end{figure*}
@@ -379,15 +380,16 @@ Other types of systems have well-known ways of locating files by filename. \begin{figure*}[tbp] { \scriptsize -\begin{verbatim} +\begin{verbbox} 1 git remote update 2 git checkout origin/master 3 make 4 evince perfbook.pdf & # Two-column version 5 make perfbook-1c.pdf 6 evince perfbook-1c.pdf & # One-column version for e-readers -\end{verbatim} +\end{verbbox} } +\hspace*{1in}\OneColumnHSpace{-0.5in}\theverbbox \caption{Generating an Updated PDF} \label{fig:howto:Generating an Updated PDF} \end{figure*}
perfbook.tex +2 -0
@@ -63,6 +63,8 @@ \setboolean{sansserif}{false} \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}} +\newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}} + \IfSansSerif{ \renewcommand{\familydefault}{\sfdefault} \normalfont
Signature · 1 line
2.7.4
Quoted 9 lines · Akira Yokosawa
Quoted 1 line
From
5de4d0c55d19b94e7e7ef6c69bb497324e443977Mon Sep 17 00:00:00 2001From: Akira Yokosawa <[email protected]>
Date: Thu, 5 Jan 2017 16:42:41 +0900
Subject: [PATCH] Layout tweaks for 1c layoutTweak horizontal spaces of wide figures and tables for 1c layout using a macro derived from \IfTwoColumn{}{}.
Signed-off-by Akira Yokosawa <[email protected]>
Queued and pushed, and let's see what people think. ;-)
Thanx, Paul
Quoted 154 lines
---
Hi Paul,This is in response to commit
b9ffcb217d7b("Adjust "Notification Insufficient" cartoon for single-column"), which uses \textwidth to support both 2c and 1c layouts.
There are other wide figures and tables that run past the right-side margins in 1c layout. They are mostly text (code snippets and tables), and using \resizebox{} with \textwidth for them will cause inconsistent looks.
So I defined a macro derived from \IfTwoColumn{}{} which works only in one-column layout. By using the macro, they can be placed near the center of the pages in 1c layout. The tweaks might look ad hoc, but they are not so many and should be manageable (I hope).Thanks, Akira
defer/rcuusage.tex | 6 +++--- defer/whichtochoose.tex | 2 +- future/HTMtable.tex | 2 +- future/HTMtableRCU.tex | 2 +- howto/howto.tex | 10 ++++++---- perfbook.tex | 2 ++ 6 files changed, 14 insertions(+), 10 deletions(-)defer/rcuusage.tex +3
-3@@ -617,7 +617,7 @@ Wikipedia~\cite{WikipediaRCU}. 9 LIST_HEAD(head); 9 LIST_HEAD(head); \end{verbbox} } -\hspace*{5em} +\hspace*{0.9in}\OneColumnHSpace{-0.5in} \theverbbox \caption{Converting Reader-Writer Locking to RCU: Data} \label{fig:defer:Converting Reader-Writer Locking to RCU: Data}@@ -643,7 +643,7 @@ Wikipedia~\cite{WikipediaRCU}. 15 } 15 } \end{verbbox} } -\hspace*{5em} +\hspace*{0.9in}\OneColumnHSpace{-0.5in} \theverbbox \caption{Converting Reader-Writer Locking to RCU: Search} \label{fig:defer:Converting Reader-Writer Locking to RCU: Search}@@ -671,7 +671,7 @@ Wikipedia~\cite{WikipediaRCU}. 16 } 17 } \end{verbbox} } -\hspace*{5em} +\hspace*{0.9in}\OneColumnHSpace{-0.5in} \theverbbox \caption{Converting Reader-Writer Locking to RCU: Deletion} \label{fig:defer:Converting Reader-Writer Locking to RCU: Deletion}defer/whichtochoose.tex +1
-1@@ -6,7 +6,7 @@ \begin{table*} \footnotesize -\centering\tymin=0.4in\tymax=2in +\centering\tymin=0.4in\tymax=2in\OneColumnHSpace{-.3in} \begin{tabulary}{5.3in}{L||L|L|L|L} & Reference Countingfuture/HTMtable.tex +1
-1@@ -4,7 +4,7 @@ \begin{table*}[p] \centering % \scriptsize -\small +\small\OneColumnHSpace{-.8in} \begin{tabular}{p{1.0in}||c|p{2.0in}||c|p{2.0in}} & \multicolumn{2}{c||}{Locking} & \multicolumn{2}{c}{Hardware Transactional Memory} \\ \hlinefuture/HTMtableRCU.tex +1
-1@@ -3,7 +3,7 @@ \begin{table*}[p] \centering -\small +\small\OneColumnHSpace{-.8in} %\raggedright \begin{tabular}{p{1.0in}||c|p{2.0in}||c|p{2.0in}} & \multicolumn{2}{c||}{Locking with RCU or Hazard Pointers} & \multicolumn{2}{c}{Hardware Transactional Memory} \\howto/howto.tex +6
-4@@ -362,7 +362,7 @@ Other types of systems have well-known ways of locating files by filename. \begin{figure*}[tbp] { \scriptsize -\begin{verbatim} +\begin{verbbox} 1 git clone git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/perfbook.git 2 cd perfbook 3 # You may need to install a font here. See item 1 in FAQ.txt.@@ -370,8 +370,9 @@ Other types of systems have well-known ways of locating files by filename. 5 evince perfbook.pdf & # Two-column version 6 make perfbook-1c.pdf 7 evince perfbook-1c.pdf & # One-column version for e-readers -\end{verbatim} +\end{verbbox} } +\hspace*{1in}\OneColumnHSpace{-0.5in}\theverbbox \caption{Creating an Up-To-Date PDF} \label{fig:howto:Creating a Up-To-Date PDF} \end{figure*}@@ -379,15 +380,16 @@ Other types of systems have well-known ways of locating files by filename. \begin{figure*}[tbp] { \scriptsize -\begin{verbatim} +\begin{verbbox} 1 git remote update 2 git checkout origin/master 3 make 4 evince perfbook.pdf & # Two-column version 5 make perfbook-1c.pdf 6 evince perfbook-1c.pdf & # One-column version for e-readers -\end{verbatim} +\end{verbbox} } +\hspace*{1in}\OneColumnHSpace{-0.5in}\theverbbox \caption{Generating an Updated PDF} \label{fig:howto:Generating an Updated PDF} \end{figure*}perfbook.tex +2
-0@@ -63,6 +63,8 @@ \setboolean{sansserif}{false} \newcommand{\IfSansSerif}[2]{\ifthenelse{\boolean{sansserif}}{#1}{#2}} +\newcommand{\OneColumnHSpace}[1]{\IfTwoColumn{}{\hspace*{#1}}} + \IfSansSerif{ \renewcommand{\familydefault}{\sfdefault} \normalfontSignature · 1 line
2.7.4