>From 5845c0f3d977aa65f167bba16ceace693e47764a Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Fri, 21 Jul 2017 22:31:43 +0900 Subject: [PATCH v2 7/8] styleguide: Add example of preferred table layout using 'booktabs' Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- appendix/styleguide/styleguide.tex | 35 ++++++++++++++++++++++++++++++++++- perfbook.tex | 1 + 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/appendix/styleguide/styleguide.tex b/appendix/styleguide/styleguide.tex index f84ade8..ac95364 100644 --- a/appendix/styleguide/styleguide.tex +++ b/appendix/styleguide/styleguide.tex @@ -758,7 +758,40 @@ 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. + +\begin{table}[htb]\RawFloats +\renewcommand*{\arraystretch}{1.2} +\begin{floatrow}[1]\ttabbox[]{ +\small +\begin{tabular}{@{}lrr@{}}\toprule + & & Ratio \\ + Operation & Cost (ns) & (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{floatrow} +\end{table} + +Note that ruled lines of booktabs can not be mixed with +vertical lines in a table. \subsubsection{Miscellaneous Candidates} \label{sec:app:styleguide:Miscellaneous Candidates} diff --git a/perfbook.tex b/perfbook.tex index 629ecea..16d30dd 100644 --- a/perfbook.tex +++ b/perfbook.tex @@ -82,6 +82,7 @@ \usepackage{floatrowpf} % Use customized floatrow \DeclareNewFloatType{listing}{placement=htbp,name=Listing,within=chapter,fileext=lst} +\usepackage{booktabs} % For better looking tables \usepackage{bm} % for bold math mode fonts --- should be after math mode font choice -- 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