在 metafont 的证明中标记点?

在 metafont 的证明中标记点?

我正在关注http://metafont.tutorial.free.fr/教程,labels用于显示证明中给出的点。我无法获得它们。有人能帮忙吗?

mg:=1.5;
mode_setup;
tracingtitles:=1;
height#:=mg*9.6pt#;
midheight#:=mg*4pt#;
depth#:=mg*5pt#;
fullwidth#:=mg*3pt#;
pensize#:=mg*.3pt;
define_pixels(height,midheight,depth,fullwidth)

% points used for curves, and I also will have them labeled 
pair pAA,pBB,pCC;
pAA:=(0,midheight);
pBB:=(0,0);
pCC:=(fullwidth,0);

beginchar("a",fullwidth#,midheight#,0); "a";
    pickup pencircle scaled pensize#;
    draw pAA .. pBB .. pCC;
    draw pCC -- pAA;
    %% label points here -- does not work :-(
    labels(pAA,pBB,pCC);
endchar

end;

运行之后mf foo.mfgftodvi foo.2602gffoo.dvi 看起来像这样(没有显示点):

dvi 渲染,无标记点

编辑: 除了下面 egreg 提供的答案之外,还可以用以下方式显示标记点makelabel("label",point)

    makelabel("AA",pAA);
    makelabel("BB",pBB);
    makelabel("CC",pCC);

生产

dvi带点

答案1

该指令label以后缀列表(而不是成对的后缀)作为参数;例如,labels(1)将显示一个点和一个1对应于点的点z1

mg:=1.5;
mode_setup;
tracingtitles:=1;
height#:=mg*9.6pt#;
midheight#:=mg*4pt#;
depth#:=mg*5pt#;
fullwidth#:=mg*3pt#;
pensize#:=mg*.3pt;
define_pixels(height,midheight,depth,fullwidth)

% points used for curves, and I also will have them labeled

beginchar("a",fullwidth#,midheight#,0); "a";
z1=(0,midheight);
z2=(0,0);
z3=(fullwidth,0);
pickup pencircle scaled pensize#;
draw z1 .. z2 .. z3;
draw z3 -- z1;
%% label points here
labels(1,2,3);
endchar;

end;

在此处输入图片描述

相关内容