[metapost] Umlaute in labels

Taco Hoekwater taco at elvenkind.com
Fri Nov 17 13:50:52 CET 2006


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



More information about the metapost mailing list