答案1
以下是一个简单的尝试元帖子,包裹在内luamplib
,因此您需要用 来编译它lualatex
。
\documentclass[border=5mm]{standalone}
\usepackage{fontspec}
\setmainfont{TeX Gyre Heros}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
path I, A, NU, P, R, S, G, E, B;
I = unitsquare scaled 64;
B = unitsquare shifted 1/2 down scaled 128 shifted point 3/2 of I shifted 8 left;
A = unitsquare xscaled 48 yscaled 48 shifted point 1 of I;
NU = origin {right} .. (60, 100) {50, 100};
NU := NU for t=1 step -1/32 until 0:
-- point t of NU shifted 16 unitvector(direction t of NU rotated 90)
endfor -- cycle;
NU := NU shifted point 3 of A;
R = origin {right} .. (50, -100) {48, -100};
R := R for t=1 step -1/32 until 0:
-- point t of R shifted 20 unitvector(direction t of R rotated 90)
endfor -- cycle;
R := R shifted point 1 of A;
P = unitsquare xscaled 80 yscaled 28 shifted point -1 of R;
E = origin {right} .. (30, -10) {30, -10};
E := E for t=1 step -1/32 until 0:
-- point t of E shifted 4 unitvector(direction t of E rotated 90)
endfor -- cycle;
E := E shifted point 1 of P;
G = unitsquare xscaled 32 yscaled 20 shifted point -1 of E;
S = point 2 of P {right} .. point 7/8 of NU .. point 3 of I {right};
S := S for t=2 step -1/32 until 0:
-- point t of S shifted 4 unitvector(direction t of S rotated -90)
endfor -- cycle;
fill B withcolor 7/8; draw B;
fill S withcolor (1, 1, 31/32);
draw subpath (0, 2) of S;
draw subpath (3, length S - 1) of S;
forsuffixes $=I, A, NU, R, P, E, G:
fill $ withcolor (1, 1, 31/32);
if length $ = 4: label(str $, center $); fi
draw subpath (0, 1) of $;
draw subpath (2, length $ - 1) of $;
endfor
label.urt("NU", point 3/2 of NU);
label("R", point 3/2 of R);
label.lrt("E", point 3/2 of E);
label("S", point 1/2 of S shifted 12 right );
path bb; bb = (superellipse(right, up, left, down, .82)) scaled 6 shifted 13/16[point 0 of B, point 2 of B];
unfill bb; label("B", center bb);
ahangle := 28;
picture Arrow; Arrow = image(drawarrow 12 left -- 2 right) scaled 3;
draw Arrow shifted point -1/2 of I;
drawarrow (4 left -- 8 right) shifted point 3/2 of G;
drawarrow interpath(1/2, subpath (1/2, 5/8) of R, subpath (18, 14) of R);
drawarrow interpath(1/2, subpath (1/2, 5/8) of NU, subpath (18, 14) of NU);
for a=5/8, 5/4:
drawarrow subpath(a, a+1/8) of S shifted 8 unitvector(direction a+1/16 of S rotated -90);
endfor
endfig;
\end{mplibcode}
\end{document}
如果您想了解有关 Metapost 的更多信息,请点击顶部的链接获取教程和参考资料。