Tables – Reproducing the Table of Exercise 22.7 in the TeXbook

tables

In Exercise 22.7 of TeXbook, a special table is created using \halign with templates:

\def\welshverb#1={{\bf#1} = }
\halign{\welshverb#\hfil\tabskip=1em plus 1em&
  \welshverb#\hfil&\welshverb#\hfil\tabskip=0pt\cr
  rydw i=I am& ydw i=am I& roeddwn i=I was\cr
  rwyt ti=thou art& wyt ti=art thou& roeddet ti=thou wast\cr
  mae e=he is& ydy e=is he& roedd e=he was\cr
  mae hi=she is& ydy hi=is she& roedd hi=she was\cr}

enter image description here
What's the easiest way to reproduce this table in modern LaTeX fashion?

Best Answer

You can do even better, with an input syntax less crowded than Knuth's.

\documentclass{article}
\usepackage{collcell}

\ExplSyntaxOn
\NewDocumentCommand{\welshverb}{m}
 {
  \stephen_welshverb:w #1
 }
\cs_new:Npn \stephen_welshverb:w #1 =
 {
  \textbf{#1}\unskip\ =\ \ignorespaces
 }
\ExplSyntaxOff

\begin{document}

\begin{tabular}{@{} *{3}{>{\collectcell\welshverb}l<{\endcollectcell}} @{}}
  rydw i  = I am     & ydw i  = am I     & roeddwn i  = I was \\
  rwyt ti = thou art & wyt ti = art thou & roeddet ti = thou wast \\
  mae e   = he is    & ydy e  = is he    & roedd e    = he was \\
  mae hi  = she is   & ydy hi = is she   & roedd hi   = she was
\end{tabular}

\end{document}

enter image description here

Related Question