O'Reilly logo

LaTeX Beginners Guide by Stefan Kottwitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – adding nicer horizontal lines with the booktabs package

We shall use the new commands introduced by booktabs:

  1. In the previous example, load the package booktabs:
    \usepackage{booktabs}
  2. 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}
  3. Typeset to see the difference:
    Time for action – adding nicer horizontal lines with the booktabs package

What just ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required