While reading Computers & Typesetting Volume E: Computer Modern Typefaces, I found a piece of code that actually did something, and should definitely be counted as an Easter egg.
The METAFONT source for the lowercase Greek letter \gamma (see greekl.mf) reads
cmchar "Lowercase Greek gamma";
beginchar(oct"015",10u#,x_height#,desc_depth#);
italcorr x_height#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
pos1(hair,180); pos2(vstem+dw,90);
pos4(hair,0); pos5(vair,-90); pos6(hair,-180); pos7(hair,-180);
bot y1=.5772156649h; top y2r=h+oo; y4=y6=-.5d;
bot y5r=-d-o; top y7=h;
lft x1r=hround(.5u-.5hair); x2=3u; rt x4r=hround(w-2u); x5=.5[x4,x6];
rt x4r-lft x6r=hround 1/3[hair,stem]+eps; rt x7l=hround(w-u);
if x4l<x6l: x4l:=x6l:=x5; fi
pos3(hair,angle(z4-z2)+90); x3=superness[x2,x4]; y3=superness[y4,y2];
filldraw stroke z1e{up}...z2e{right}...z3e{z4-z2}
...z4e{down}...{left}z5e; % arc
filldraw stroke z5e{left}...z6e{up}..{2(x7-x6),y7-y6}z7e; % stem
math_fit(-.5772156649x_height#*slant,ic#-u#);
penlabels(1,2,3,4,5,6,7); endchar;
And we see where Knuth hides this Easter egg: The entering stroke (i.e., the left hook of \gamma) starts at about 57.72156649% of x-height above the baseline.
For those who are unfamiliar with the relevant mathematics: That’s the Euler–Mascheroni constant, which is denoted by $\gamma$ in standard literature. This makes the drawing of \gamma incredibly “meta” indeed.
The Euler–Mascheroni constant (also called Euler's constant) is a mathematical constant recurring in analysis and number theory, usually denoted by the lowercase Greek letter gamma (γ).
[...]
The numerical value of the Euler–Mascheroni constant, to 50 decimal places, is:
0.57721 56649 01532 86060 [...]
Addendum
The lowercase Greek letter \pi has, in spirit, similar “surprises”:
cmchar "Lowercase Greek pi";
beginchar(oct"031",10u#,x_height#,0);
[...] pi_stroke; % hook and bar
[...]
pair v[]; v1=(z4-z5) xscaled 3.14159; v2=(z6-z7) xscaled 3.14159;
[...] endchar;
where the subroutine pi_stroke is defined in cmbase.mf as
def pi_stroke = pickup fine.nib;
[...]
y1=x_height-x_height/3.141592653589793; y2=y3; top y3l=x_height;
filldraw circ_stroke z3e---z2e...{x1-x2,3.14159(y1-y2)}z1e enddef;
To me, however, these appearances of 3.14159 are too “on the nose”. They have far less mystery as Easter eggs than the 0.57721 in \gamma.
- Technically speaking,
3.14159 is involved whenever METAFONT draws a circle (or an arc of a circle), or whenever a “round pen” is picked. You’d probably call these 3.14159 “too trivial”.
- Knuth has a well-known fascination about
\pi. See, for instance, these public lectures (YouTube links): Why Pi? (2010) and Pi and The Art of Computer Programming (2019). So I’m not really surprised to find 3.14159 sprinkled here and there.
The TeXbook)? "If you get this error message, you know why, and you deserve no sympathy." (quoting from memory) – mbork Dec 28 '11 at 14:49If you have been so devious as to get this message, you will understand it, and you deserve no sympathy.Is there someone who has never had this error message? What can be the procedure to obtain it? – Jean Baldraque Oct 02 '12 at 16:06