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 – building a table of font family commands

We shall create a table like in the previous example, but this time, we would like to make all entries in a column horizontally centered to each other. We will also add some horizontal lines to mark the border and the header of the table:

  1. Create a new document. Define a command for setting the font for the head row:
    \documentclass{article}
    \newcommand{\head}[1]{\textnormal{\textbf{#1}}}
    \begin{document}
  2. Begin a tabular environment. As a mandatory argument, provide ccc standing for three centered columns:
    \begin{tabular}{ccc}
  3. Write the table head row, write & to separate column entries, and \\ to end rows. Use \hline to insert horizontal lines:
     \hline \head{Command} & \head{Declaration} & \head{Output}\\ ...

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