Texlive 2019 更新后,以下代码在更新前运行时显示错误消息。目的是重现下图。
\documentclass[border=5mm]{standalone}
\usepackage{luatex85}
\usepackage{luamplib}
\mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}
beginfig(0);
numeric u;
u = 10mm;
pickup pencircle scaled 1pt;
angle_radius := 8pt;
def mark_rt_angle (expr a, b, c, d) =
fill ((1,0)--(1,1)--(0,1)--origin--cycle)
zscaled (angle_radius*unitvector(a-b))
shifted b withcolor d;
draw ((1,0)--(1,1)--(0,1))
zscaled (angle_radius*unitvector(a-b)) shifted b;
enddef;
% macro drawing a circular arc (Franck Pastor)
vardef arc(expr theta_min, theta_max) =
save theta, mystep ;
mystep = 1; theta = theta_min ;
dir theta_min
for theta = theta_min+mystep step mystep until theta_max:
.. dir theta endfor
enddef
z0=(4u,0);
z1=z0 rotated 90;
z2=z1 rotated 120;
z3=z2 rotated 120;
z4=0.5[z2,z3];
z5=z3 rotatedaround (z2,180);
z6=z3 rotatedaround (z2,90);
z7=z3 rotatedaround (z2,-90);
path triangle; triangle = z1--z2--z3--cycle;
theta_min := 0;
theta_max := 60;
pair center; center = origin;
r := 0.5u;
myeps := 0.25u ; path p, a, b;
a = (center -- center + dir theta_min) scaled r shifted z2;
b = (center -- center + dir theta_max) scaled r shifted z2;
p := arc(theta_min, theta_max) scaled (r) shifted z2;
fill b -- a -- p -- cycle withcolor green;
fill triangle withcolor 0.8*white;
fill b -- a -- p -- cycle withcolor green;
mark_rt_angle (z3, z4, z1, green);
draw z1--z4 withcolor blue;
draw triangle;
draw fullcircle scaled 2abs(z3-z2) shifted z2;
draw z1 withpen pencircle scaled 4bp withcolor red;
draw z4 withpen pencircle scaled 4bp withcolor red;
draw z6 -- z7;
draw z3 -- z5;
label.bot(btex $A'$ etex,z4);
label.llft(btex $O$ etex,z2);
label.rt(btex $I$ etex,z3);
label.top(btex $A$ etex,z1);
label.lft(btex $I'$ etex,z5);
label.top(btex $J$ etex, z6);
label.bot(btex $J'$ etex, z7);
endfig;
\end{mplibcode}
\end{document}
答案1
您(不知何故)丢失了;
源代码......
vardef arc(expr theta_min, theta_max) =
save theta, mystep;
mystep = 1;
theta = theta_min ;
dir theta_min for theta = theta_min+mystep step mystep until theta_max:
.. dir theta
endfor
enddef; % <---------------- you had lost the ; from here