blob: ebf8f8cb0430de1935befb605c2d69c491fe1cf4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
\documentclass[border=2mm]{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
u = 8mm;
defaultfont := "texnansi-lmr10";
string minus_sign;
minus_sign := char 12; % if you are using the 8r encoding
minus_sign := char 143; % if you are using the texnansi encoding
for x=-3 upto 3: label(decimal x, (x*u,+9)) withcolor .67 red; endfor
for x=-3 upto 3: label(if x<0: minus_sign & fi decimal abs(x), (x*u,-5)) withcolor .58 blue; endfor
label.lft("with plain decimal:" infont "texnansi-lmss10" scaled 0.9, (-3.6u,9)) withcolor .67 red;
label.lft("with this hack:" infont "texnansi-lmss10" scaled 0.9, (-3.6u,-5)) withcolor .58 blue;
endfig;
\end{mplibcode}
\end{document}
|