[PATCH 1/5] styleguide: Add examples of alternative table layout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From f6016bad16a5f46896aba335168d9e95e375e861 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@xxxxxxxxx>
Date: Wed, 9 Aug 2017 19:48:03 +0900
Subject: [PATCH 1/5] styleguide: Add examples of alternative table layout

Add examples using:
  1) ruled lines of "booktabs" package,
  2) color alternate rows using "table" option of xcolor.

Also add footnote on "arydshln" package's conflict with
tabulary package.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 appendix/styleguide/styleguide.tex | 86 +++++++++++++++++++++++++++++++++++++-
 perfbook.tex                       |  3 +-
 2 files changed, 87 insertions(+), 2 deletions(-)

diff --git a/appendix/styleguide/styleguide.tex b/appendix/styleguide/styleguide.tex
index 829a9c2..6b41897 100644
--- a/appendix/styleguide/styleguide.tex
+++ b/appendix/styleguide/styleguide.tex
@@ -808,7 +808,91 @@ look ugly.\footnote{
 Vertical lines should be avoided and horizontal lines should be
 used sparingly, especially in tables of simple structure.
 
-% TODO: Add example
+For example,
+Table~\ref{tab:cpu:Performance of Synchronization Mechanisms on 4-CPU 1.8GHz AMD Opteron 844 System}
+can be tweaked by the help of ``booktabs'' package as is shown in
+Table~\ref{tab:app:styleguide:Performance of Synchronization Mechanisms of 4-CPU 1.8GHz AMD Opteron 844 System},
+with the caption at the top.
+
+\floatstyle{plaintop}
+\restylefloat{table}
+\captionsetup[table]{position=top,hangindent=30pt}
+\renewcommand*{\abovetopsep}{-7pt}
+
+\begin{table}[htb]
+\renewcommand*{\arraystretch}{1.2}\centering\small
+\begin{tabular}{@{}lrr@{}}\toprule
+
+	Operation		& Cost (ns) 	& \parbox[b]{.7in}{\raggedleft Ratio\par (cost/clock)} \\
+	\midrule
+	Clock period		&           0.6	&           1.0 \\
+	Best-case CAS		&          37.9	&          63.2 \\
+	Best-case lock		&          65.6	&         109.3 \\
+	Single cache miss	&         139.5	&         232.5 \\
+	CAS cache miss		&         306.0	&         510.0 \\
+	Comms Fabric		&       5,000\textcolor{white}{.0}
+						&       8,330\textcolor{white}{.0}
+								\\
+	Global Comms		& 195,000,000\textcolor{white}{.0}
+						& 325,000,000\textcolor{white}{.0} \\
+\bottomrule
+\end{tabular}
+\caption{Performance of Synchronization Mechanisms of 4-CPU 1.8\,GHz AMD Opteron 844 System}
+\label{tab:app:styleguide:Performance of Synchronization Mechanisms of 4-CPU 1.8GHz AMD Opteron 844 System}
+\end{table}
+
+Note that ruled lines of booktabs can not be mixed with
+vertical lines in a table.\footnote{
+  There is another package named ``arydshln'' which provides dashed lines
+  to be used in tables.
+  Unfortunately, it conflicts with the tabulary package and prevents us
+  from experimenting it for the moment.
+}
+
+Another option is to color rows alternately by using the feature of xcolor
+package. For example,
+Table~\ref{tab:future:Refrigeration Power Consumption}
+can be tweaked as shown in
+Table~\ref{tab:app:styleguide:Refrigeration Power Consumption}.
+\definecolor{lightgray}{gray}{0.9}
+
+\begin{table}[htbp]
+\rowcolors{1}{}{lightgray}
+\renewcommand*{\arraystretch}{1.2}\centering\small
+\begin{tabular}{lrrr}\toprule
+Situation
+	& $T$ (K)
+		& $C_P$	& \parbox[b]{.75in}{\raggedleft Power per watt\par waste heat (W)} \\
+\midrule
+Dry Ice
+	& $195$
+		& $1.990$
+			& 0.5 \\
+Liquid N$_2$
+	& $77$
+		& $0.356$
+			& 2.8 \\
+Liquid H$_2$
+	& $20$
+		& $0.073$
+			& 13.7 \\
+Liquid He
+	& $4$
+		& $0.0138$
+			& 72.3 \\
+IBM~Q	& $0.015$
+		& $0.000051$
+			& 19,500.0 \\
+\bottomrule
+\end{tabular}
+\caption{Refrigeration Power Consumption}
+\label{tab:app:styleguide:Refrigeration Power Consumption}
+\end{table}
+
+\floatstyle{plain}
+\restylefloat{table}
+\captionsetup[table]{position=bottom,hangindent=0pt}
+\renewcommand*{\abovetopsep}{0pt}
 
 \subsubsection{Miscellaneous Candidates}
 \label{sec:app:styleguide:Miscellaneous Candidates}
diff --git a/perfbook.tex b/perfbook.tex
index 8f166ec..23146ad 100644
--- a/perfbook.tex
+++ b/perfbook.tex
@@ -33,7 +33,7 @@
 \setlist[description]{style=unboxed}
 %\usepackage{enumerate}
 \usepackage{ifthen}
-\usepackage{xcolor}
+\usepackage[table]{xcolor}
 \usepackage[shortcuts]{extdash}
 \usepackage{changepage}
 \usepackage{listings}
@@ -89,6 +89,7 @@
 \newcommand{\LstLineNo}{\makebox[5ex][r]{\arabic{VerbboxLineNo}\hspace{2ex}}}
 
 \usepackage{bm} % for bold math mode fonts --- should be after math mode font choice
+\usepackage{booktabs}
 
 \IfLmttForCode{
 \AtBeginEnvironment{verbatim}{\renewcommand{\ttdefault}{lmtt}}
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux