Fancy Euclid’s “Elements” in TeX
The main feature of this book is that instead of ordinary letter designations such as “triangle ABC,” it employs inclusions of miniature pictures directly in the text, that is, for example, an image of a triangle. Their use looks somewhat like this:
\defineNewPicture{ % Inside this thing you put the construction
pair A, B, C, D; % MetaPost has a special type of variables for coordinates
numeric d;
d := 2u;
A := (0, 0); %
B := A shifted (d, 0); % Point coordinates are set here
C := A shifted (0, -d); %
D := A shifted (d, -d); %
byAngleDefine(B, A, C, byblack, 0); % These define angles:
byAngleDefine(D, B, A, byblue, 0); % first—angle points,
byAngleDefine(C, D, B, byred, 0); % then color,
byAngleDefine(A, C, D, byyellow, 0); % then style. These include correct recognition of line segment and angle synonyms, automatic letter placement around polygon groups, and other stuff like that.
Source: habr.com