Debian Codegraph @

texmf-dist/doc/metapost/mparrows/mparrowsexamples.mp

raw
1 % Copyright 2016, Palle Jorgensen, hamselv(at)pallej.dk
2 %
3 % This file is part of the mparrows MetaPost module.
4 %
5 % mparrows is free software: you can redistribute it and/or modify it
6 % under the terms of the GNU General Public License as published by
7 % the Free Software Foundation, either version 3 of the License, or
8 % (at your option) any later version.
9 %
10 % Foobar is distributed in the hope that it will be useful,
11 % but WITHOUT ANY WARRANTY; without even the implied warranty of
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 % GNU General Public License for more details.
14 %
15 % You should have received a copy of the GNU General Public License
16 % along with Foobar. If not, see <http://www.gnu.org/licenses/>.
17 verbatimtex
18 %&latex
19 \documentclass[11pt]{scrbook}
20 \usepackage{tgpagella}
21 \usepackage[T1]{fontenc}
22
23 \begin{document}
24 etex;
25
26 input mparrows;
27
28 filenametemplate "%j%c.mps";
29
30 for s within btex text etex:
31 defaultfont:=fontpart.s;
32 defaultscale:=xxpart.s;
33 exitif true;
34 endfor
35
36 for i = 0 upto 7:
37 beginfig(i);
38 setarrows(i);
39 drawarrow (origin{right}..{up}(0,2mm));
40 drawdblarrow ((0,-2mm){up}..origin{right}..{up}(0,2mm)) shifted (5mm,0);
41 currentpicture:=currentpicture scaled 5;
42 endfig;
43 endfor
44
45 setarrows(barbed);
46 for i = 0 upto 10:
47 beginfig(i+10);
48 barbedarrowindent:=2*i/10;
49 drawarrow origin{dir 20}..{dir 20}(1cm,0);
50 currentpicture:=currentpicture scaled 5;
51 label.rt("barbedarrowindent=" & decimal.barbedarrowindent, (55mm,0mm));
52 endfig;
53 endfor;
54
55 beginfig(30);
56 barbedarrowindent:=-.6;
57 drawarrow origin{dir 20}..{dir 20}(1cm,0);
58 currentpicture:=currentpicture scaled 5;
59 label.rt("barbedarrowindent=" & decimal.barbedarrowindent, (55mm,0mm));
60 endfig;
61
62 setarrows(orig);
63
64 beginfig(31);
65 drawarrow (origin{right}..{up}(0,2mm));
66 draw _apth withcolor red;
67 currentpicture:=currentpicture scaled 5;
68 endfig;
69
70 setarrows(default);
71
72 beginfig(32);
73 drawarrow (origin{right}..{up}(0,2mm));
74 draw _apth withcolor red;
75 currentpicture:=currentpicture scaled 5;
76 endfig;
77
78 setarrows(barbedunfilled);
79
80 beginfig(33);
81 barbedarrowindent:=.6;
82 drawarrow (origin{right}..{up}(0,2mm));
83 draw (makepath pencircle scaled 2ahlength) shifted (0,2mm) withcolor red withpen currentpen scaled .2;
84 draw (makepath pencircle scaled (2*barbedarrowindent*ahlength)) shifted (0,2mm) withcolor green withpen currentpen scaled .2;
85 currentpicture:=currentpicture scaled 5;
86
87 endfig;
88
89
90 end.