\measuredangle
对应 glyph 的具体定义在文件 mathsymb.mf
的 852 行,
%%% !!!
beginchar(measured_angle,12u#+2appr#,asc_height#,asc_depth#);
"Measured angle sign";
pickup tiny.nib;
rt x1l=w-appr; lft x2l=appr; rt x3r=w-appr-hround 1.5u;
bot y1l=bot y2l=0; top y3l=h+eps; pos1(rth,90);
(x3r-x3l,y3l-y3r)=d_problem(z2l,y3l,x3r,rth-tiny);
y2r=y1r; z2r-z3r=whatever*(z2l-z3l);
filldraw stroke z1e--z2e--z3e;
%
numeric a;
y2l=y5r; rt x5r=hround max(0.6[Appr,w-Appr]+0.5rth,x2l+0.5(h+d))+eps;
pos5(rth,0);
a=x5r-x2l; 0.5 y4=-d+eps; 0.5(x4-x2l)=a+-+min((0.5(y4-y2l)),a);
0.5(z6-z2l)=a*dir min((angle(z3l-z2l)-angle(z4-z2l)),90);
numeric t[];
tmp_path:=halfcircle rotated -90 scaled 2(x5r-x2r) shifted z2r;
tmpp_path:=reverse(halfcircle rotated -90 scaled 2(x5l-x2r) shifted z2r);
t1=xpart(tmp_path intersectiontimes (z2l..z4));
t2=xpart(tmp_path intersectiontimes (z2l..z6));
z4r=point t1 of tmp_path; z6r=point t2 of tmp_path;
t3=xpart(tmpp_path intersectiontimes (z2l..z6));
t4=xpart(tmpp_path intersectiontimes (z2l..z4));
z4l=point t4 of tmpp_path; z6l=point t3 of tmpp_path;
filldraw subpath (t1,t2) of tmp_path
--subpath (t3,t4) of tmpp_path--cycle;
penlabels(1,2,3,4,5,6);
endchar;
似乎是需要用到 metatype1
? 待续 ...
再次更新, 首先把 mathprmt.mf
复制到一个单独的文件夹出来(方便后期更改), 然后再把上述 measured_angle
的定义摘抄出来, 形成如下的文件:
%%%%%%%%%%%%%% Preamble %%%%%%%%%%%%%%
% 1. variables like: 'appr#' are inside it:
input mathprmt; % load library 'mathbase.mf'
% 2. mode/math setup and function 'd_problem()' in 'mathsymb.mf'
mode_setup;
math_setup;
measured_angle := hex"3E"; % this variable must be known !!!
vardef d_problem(expr origin,top_lim,side_lim,breadth)=
save a,b,c;
a=abs((side_lim-xpart origin)/(top_lim-ypart origin));
b=abs(breadth/(top_lim-ypart origin));
begingroup
vardef f(expr c)=
(1+a**2-2a*b*c+(b*c)**2)*(c**2)<1
enddef;
c=solve f(0,breadth);
endgroup;
breadth*(c,1+-+c)
enddef;
%%%%%%%%%%% Main doc %%%%%%%%%%%%%%
beginchar(measured_angle,12u#+2appr#,asc_height#,asc_depth#);
"Measured angle sign";
pickup tiny.nib;
rt x1l=w-appr; lft x2l=appr; rt x3r=w-appr-hround 1.5u;
bot y1l=bot y2l=0; top y3l=h+eps; pos1(rth,90);
(x3r-x3l,y3l-y3r)=d_problem(z2l,y3l,x3r,rth-tiny);
y2r=y1r; z2r-z3r=whatever*(z2l-z3l);
filldraw stroke z1e--z2e--z3e;
%
numeric a;
y2l=y5r; rt x5r=hround max(0.6[Appr,w-Appr]+0.5rth,x2l+0.5(h+d))+eps;
pos5(rth,0);
a=x5r-x2l; 0.5 y4=-d+eps; 0.5(x4-x2l)=a+-+min((0.5(y4-y2l)),a);
0.5(z6-z2l)=a*dir min((angle(z3l-z2l)-angle(z4-z2l)),90);
numeric t[];
tmp_path:=halfcircle rotated -90 scaled 2(x5r-x2r) shifted z2r;
tmpp_path:=reverse(halfcircle rotated -90 scaled 2(x5l-x2r) shifted z2r);
t1=xpart(tmp_path intersectiontimes (z2l..z4));
t2=xpart(tmp_path intersectiontimes (z2l..z6));
z4r=point t1 of tmp_path; z6r=point t2 of tmp_path;
t3=xpart(tmpp_path intersectiontimes (z2l..z6));
t4=xpart(tmpp_path intersectiontimes (z2l..z4));
z4l=point t4 of tmpp_path; z6l=point t3 of tmpp_path;
filldraw subpath (t1,t2) of tmp_path
--subpath (t3,t4) of tmpp_path--cycle;
penlabels(1,2,3,4,5,6);
endchar;
end
%%%% Compile it by %%%%%%
% mf measure_angle.mf
% gftodvi measure_angle.2602gf
% dvips measure_angle.dvi
% ps2pdf measure_angle.ps
依次使用如下的命令进行编译:
mf measure_angle.mf
gftodvi measure_angle.2602gf
dvips measure_angle.dvi
ps2pdf measure_angle.ps
然后你就可以看到 measure_angle.pdf
生成了, 截图如下:
目前想要在 TeX 中使用该符号还有两个问题:
- 还需要生成对应的
tfm
文件, 或许还需要.pk
文件; - 点阵字体不行, 可能需要用一点
metatype1
里面的东西; - 待续 ...
问 如何高效优雅地从mathabx宏包中偷出来\measuredangle的符号?