[metapost] Umlaute in labels
Fieger, Andreas
andreas.fieger at servicebarometer.de
Fri Nov 17 14:52:43 CET 2006
Klaus,
you use vardef showpoint(expr t, P)(text T) and
assing the text T to a picture lab.
Can't you define vardef showpoint(expr t, P, T) and
then use dotlabel.top(T, (P*u)) directly?
For me
vardef foo(expr p) =
if picture p:
label(p, origin);
else:
label(btex not a picture etex, origin);
fi
enddef;
beginfig(1);
foo(btex mein L\"ab\"ol" etex);
endfig;
works (or am I missing the point?)
Best,
Andreas
--
Dr. Andreas Fieger
ServiceBarometer AG
Gottfried-Keller-Str. 12
81245 München
www.servicebarometer.de
www.kundenmonitor.de
> -----Ursprüngliche Nachricht-----
> Von: Taco Hoekwater [mailto:taco at elvenkind.com]
> Gesendet: Freitag, 17. November 2006 13:51
> An: Klaus Jantzen
> Cc: metapost at tug.org
> Betreff: Re: [metapost] Umlaute in labels
>
>
> Klaus Jantzen wrote:
> > Hello,
> >
> > how can I get umlate in to a label?
>
> For the current Metapost, the label has to be given exactly
> in the raw font encoding, which is not at all easy to do
> when using \TeX-typeset labels, I am afraid.
>
> I realise this is not an answer, but the upcoming MetaPost
> release (next week) supports font re-encoding, and in that
> version, your code below will work as given.
>
> Best,
>
> Taco
>
> > As shown in the example I write the label as I do it in all
> my LaTeX
> > documents, but I get only a space instead of the
> appropriate character.
> > Can I use only a specific font? Which one?
> >
> > Thank you for any help.
> >
> > =======================
> > % umltest.mp created on 2006-11-17 at 09:58:05
> > prologues:=2;
> > verbatimtex
> > %&latex
> > \documentclass{scrartcl}
> > \usepackage[T1]{fontenc}
> > \usepackage{ngerman}
> > %
> > \renewcommand{\sfdefault}{phv}
> > \renewcommand{\familydefault}{\sfdefault}
> > %
> > \begin{document}
> > etex
> > %
> > % ------------------------------------------------
> > % showpoint (t, point P, Label)
> > % show a point (with label)
> > % t (test): if t = 0 the point is not shown
> > % point P (e.g. z1);
> > % Label must be given as btex z1 etex (can be blank: btex etx)
> > % ------------------------------------------------
> > vardef showpoint(expr t, P)(text T) =
> > picture lab;
> > %
> > if t <> 0 :
> > lab = T;
> > dotlabel.top(lab, (P*u));
> > fi;
> > enddef;
> > %
> > numeric u, width, height;
> > u = 1cm;
> > z0 = (0,0);
> > width = 5;
> > height = 5;
> > %
> > beginfig(1);
> > %
> > % showgrid(width, height);
> > %
> > z1 = (1,1);
> > showpoint(1, z1, btex Punkt etex);
> > %
> > z2 = (2,2);
> > showpoint(1, z2, btex L\"osung etex);
> > %
> > z3 = (3,3);
> > showpoint(1, z3, btex L"osung etex);
> > %
> > z4 = (4,4);
> > showpoint(1, z4, btex Loesung etex);
> > %
> > endfig;
> > end
>
> _______________________________________________
> metapost mailing list
> http://tug.org/mailman/listinfo/metapost
>
More information about the metapost
mailing list