Time for action – adding nicer horizontal lines with the booktabs package
We shall use the new commands introduced by booktabs
:
In the previous example, load the package
booktabs
:\usepackage{booktabs}
Use
\toprule
,\midrule
, and\bottomrule
instead of\hline
. Specify a thickness as an optional argument:\begin{tabular}{ccc} \toprule[1.5pt] \head{Command} & \head{Declaration} & \head{Output}\\ \midrule \verb|\textrm| & \verb|\rmfamily| & \rmfamily Example text\\ \verb|\textsf| & \verb|\sffamily| & \sffamily Example text\\ \verb|\texttt| & \verb|\ttfamily| & \ttfamily Example text\\ \bottomrule[1.5pt] \end{tabular}
Typeset to see the difference:
What just happened?
British typesetters call a line a rule. The booktabs
developer chose this terminology for the new commands. We used three of them. These are their definitions:
\toprule[thickness]
may be used to draw a horizontal line at the top of the table. If desired, athickness
may be specified, like1pt...