[tex-k] bug in answer 15.7 of The METAFONTbook & typos

胡亚捷 (Hu Yajie) 2500418497 at qq.com
Tue Jul 21 16:26:56 CEST 2020


Exercise 15.7 of The METAFONTbook challenges the reader to fix the program for
the ornament on page 144 so that it handles a general aspect_ratio. But the
answer in Appendix A only fixes it partially. If you run the following program

mode_def myproof =
 proof_;                        % same as proof mode, except:
 aspect_ratio:=5/4;             % we need to demonstrate nonsquare pixels
 mag:=.5;                       % make sure the ornament fits on screen
 enddef;

mode=myproof; mode_setup;

beginchar("4",11pt#,11pt#,0);
pickup pencircle scaled 3/4pt yscaled 1/3 rotated 30;
transform t;
t=identity rotatedaround((.5w,.5h),-90);                                % (1)
x2=.35w; x3=.6w;
y2=.1h; top y3=.4h;
path p; p=z2{right}...{up}z3;
top z1=point .5 of p transformed t;
draw z1...p;
pickup pencircle scaled 3/4pt yscaled 1/3 rotated -60;
draw (z1...p) transformed t;                                            % (2)
addto currentpicture also currentpicture transformed(t transformed t);  % (3)
labels(1,2,3); endchar;

you'll notice that the right half of the ornament is vertically misplaced.
Reason: (1) The transform t is computed in the ordinary coordinate system,
i.e. before yscaling by aspect_ratio. (2) This does not cause a problem since
plain METAFONT's "draw" command is supposed to take care of the aspect_ratio
adjustment. (3) However, "addto" is a primitive command, so you have to do
the yscaling yourself. Instead of rotating around (.5w,.5h), you can

addto currentpicture also currentpicture
    rotatedaround((.5w,.5h) yscaled aspect_ratio, -180);                % (3')

or use a plain METAFONT command to draw the right half of the ornament.

------------------------------Now for some typos------------------------------

Page C307, line -2
Change `ad-hoc dimension' to `ad hoc dimension', since the phrase is used
several times throughout the book without the hyphen (e.g. in Chapter 11).

Appendix I
`Giotto de Bondone'
    Change to `Giotto di Bondone' per Wikipedia.

`Journal of Algorithms'
    Use slant font, since the `TUGboat' entry uses slant font.

(I hope I can find all the bugs before the deadline...)



More information about the tex-k mailing list.