[tex-k] Exercise 22.1 of The TeXbook

Hanson Char hanson.char at gmail.com
Fri Feb 16 06:42:35 CET 2024


Hi,

I wanted to bring to your attention some feedback regarding Exercise 22.1 of The TeXbook and its corresponding solution.  While the exercise appears to be targeted at beginners due to the absence of a "dangerous bend," the solution provided utilizes a "\frac" macro from a more advanced exercise (11.6). As someone who considers themselves a beginner, I found this discrepancy a bit challenging to navigate.

In particular,

    \def\frac#1/#2{\leavevmode\kern.1em \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}

With the official solution (copied here):

\settabs\+\indent&10\frac1/2 lbs.\qquad&\it Servings\qquad&\cr
\+&\negthinspace\it Weight&\it Servings&{\it Approximate Cooking Time\/}*\cr
\smallskip
\+&8 lbs.&6&1 hour and 50 to 55 minutes\cr
\+&9 lbs.&7 to 8&About 2 hours\cr
\+&9\frac1/2 lbs.&8 to 9&2 hours and 10 to 15 minutes\cr
\+&10\frac1/2 lbs.&9 to 10&2 hours and 15 to 20 minutes\cr
\smallskip
\+&* For a stuffed goose, add 20 to 40 minutes to the times given.\cr

As a beginner, I couldn’t figure this out, but I think I’ve come up with something close enough without resorting to the use of the advanced macro:

\settabs\+\indent&$10\,^1\!/\!_2$ lbs.\qquad&\it Servings\qquad&\cr
\+&$\!$\it Weight&\it Servings&{\it Approximate Cooking Time\/}*\cr
\smallskip
\+&8 lbs.&6&1 hour and 50 to 55 minutes\cr
\+&9 lbs.&7 to 8&About 2 hours\cr
\+&$9\,^1\!/\!_2$ lbs.&8 to 9&2 hours and 10 to 15 minutes\cr
\+&$10\,^1\!/\!_2$ lbs.&9 to 10&2 hours and 15 to 20 minutes\cr
\smallskip
\+&* For a stuffed goose, add 20 to 40 minutes to the times given.\cr

Thought this is something the book could potentially be improved upon, or at least something interesting to some of you.

Regards,
Hanson








More information about the tex-k mailing list.