Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am following the http://metafont.tutorial.free.fr/ tutorial, where labels is used to show given points in the proofs. I am not able to get them in my case. Can someone help?

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;

after running mf foo.mf, gftodvi foo.2602gf, the foo.dvi looks like this (no points shown):

rendering of the dvi, no points labeled

EDIT: Besides the answers by egreg below, labeled points can be shown with makelabel("label",point):

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

produces

dvi with points

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The instruction label takes as argument a list of suffixes, not of pairs; for example, labels(1) will show a dot and a 1 corresponding to point 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;

enter image description here

share|improve this answer
    
Thanks. I found something on that in mfbook meanwhile. –  eudoxos Nov 12 '11 at 16:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.