[texhax] could someone give me an explanation as to why fontsize fails with an overfull box

David Carlisle d.p.carlisle at gmail.com
Mon Jan 14 18:20:48 CET 2019


Sorry but I can understand very little of your message, but mostly you
seem to ask why TeX gives a syntax error if your input has a syntax
error. Almost all programming languages do that. TeX in fact more than
most does make some attempt to recover if you scroll past an error,
and tries to process the remaining parts of the document, but you can
not expect reasonable typeset output after an error.


Note that in your example you had not left  out the argument of \test

you defined \test as

\def\test#1#2{\hbox to 2cm{#1}}

(neither \def nor \hbox should be in a latex document of course, and
this will almost always make an under or over full box as you provide
no glue to allow tex to force the content to be the stated width.
However ignoring that you have

  \test{No} \\

so the second argument to \test is not missing, it is \\ and you
define \test to discard #2 so your table is

\begin{tabular}{cc}
\hbox to 2cm{working} &  \hbox to 2cm {No}  \hbox to 2cm {not working}{} &
 \test{Yes}{} \\
\end{tabular}


and the error is not detected until  the & which is trying to put the
Yes box into a third column of the table which only has two columns.

there is no sensible way TeX could recover from this and guess your
original intention.


David


More information about the texhax mailing list