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:
Extend the preamble of our example by defining a command
\normal
. It shall use\multicolumn
to produce anl
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}
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 work:\begin{tabular}{@{}l*2{>{\textbackslash\ttfamily}l}l% <{Example text}@{}} \toprule[1.5pt] & \multicolumn{2}{c}{\head{Input}} & \multicolumn{1}{c}{\head{Output}}\\
We'll use the
\normal
command to avoid the typewriter...