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}\\ ...

Get LaTeX Beginners Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.