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 – 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 ...

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