Time for action – using the array package

We shall modify the table definition to set our input columns in the typewriter font. At the same time, we will insert a column on the left, standing for our command type:

  1. Extend the preamble of our example by defining a command \normal. It shall use \multicolumn to produce an l cell, no matter what the column formatting is:
    \documentclass{article}
    \usepackage{array}
    \usepackage{booktabs}
    \newcommand{\head}[1]{\textnormal{\textbf{#1}}}
    \newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
    \begin{document}
  2. As \verb cannot be used in table headers, we shall use \ttfamily. Preceding it with \textbackslash is enough for our purposes. Use >{…} to insert it twice. Then add <{Example text} to the last column to save typing ...

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.