summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/mparrows/mparrows.tex
blob: 4590a4fb88c83b54d63830b5ac38e2ff0c69ddbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
%% Copyright 2016, Palle Jorgensen, hamselv(at)pallej.dk
%
% This file is part of the mparrows MetaPost module.
% 
% mparrows is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
% 
% mparrows is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with mparrows. If not, see <http://www.gnu.org/licenses/>.
\pdfoutput1 %
\documentclass[paper=a4,11pt,UKenglish,DIV=calc,BCOR=0mm,parskip=half,fleqn]{scrartcl}
\usepackage[T1]{fontenc} %
\usepackage[utf8]{inputenc} %
\usepackage{babel} %
\usepackage{tgpagella} %
\usepackage{listings} %
\usepackage{calc} %
\usepackage[scaled]{luximono} %
\usepackage{textcomp} %
\renewcommand*\sfdefault{uop} %
\linespread{1.045} %
\usepackage{graphicx} %
\usepackage{mflogo} %
\usepackage{varioref} %
\usepackage[colorlinks]{hyperref} %
\usepackage[final]{microtype} %
\setcounter{secnumdepth}{2} %
\setcounter{tocdepth}{1} %
\setkomafont{captionlabel}{\usekomafont{sectioning}} %
\setkomafont{caption}{\small} %
\author{Palle J\o rgensen} %
\title{The \texttt{mparrows} \MP\ module\quad \raisebox{-1ex}{\includegraphics[scale=.5]{mparrowsexamples2.mps}}} %
\hypersetup{pdftitle={The Mparrows MetaPost module}, pdfauthor={Palle Jorgensen}}
\lstset{language=metapost,breaklines,morekeywords={setarrows,barbedarrowindent}}
\newenvironment{example}[1]{%
  \def\myfile{#1}
  \begin{tabular}{@{}p{.67\linewidth-\tabcolsep}p{.33\linewidth}@{}}
    \begin{minipage}[c]{\linewidth}}{%
    \end{minipage}
    &\parbox[c]{\linewidth}{\centering\includegraphics{\myfile}}
  \end{tabular}}
\protected\def\barbedarrowindent{\lstinline{barbedarrowindent}}

\begin{document}
\maketitle

\tableofcontents
\clearpage

\section{Introduction}
\label{sec:introduction}

This MetaPost module provides some different types of arrow heads for
use with the \lstinline{drawarrow} and \lstinline{drawdblarrow}
commands.

\section{Usage}
\label{sec:usage}

To load the mparrows module put the following line into the start of
your MetaPost file:
\begin{lstlisting}
input mparrows;
\end{lstlisting}

\section{The new arrow types}
\label{sec:new-arrow-types}

The new arrows are defined with the same parameters as the original
MetaPost arrows; \lstinline{ahlength} and \lstinline{ahangle}.

\subsection{The original arrows of \MP}
\label{sec:original-arrows-of-mp}

\begin{example}{mparrowsexamples0.mps}
  To the right the original arrows of MetaPost are shown.

  They are shown here mostly for comparison. The picture is as most of
  the other pictures scaled by five.

  To use the original arrows type
\begin{lstlisting}
setarrows(orig);
\end{lstlisting}
\end{example}

\subsection{The default arrows of the \texttt{mparrows} module}
\label{sec:stand-arrows-mparrows}

\begin{example}{mparrowsexamples1.mps}
  The default arrow of the \texttt{mparrows} module look similar to the
  original arrows of MetaPost.

  However there is a little difference. See
  section~\vref{sec:diff-betw-orig}.

  To use the default arrows type
\begin{lstlisting}
setarrows(default);
\end{lstlisting}
  or do nothing -- it's default.
\end{example}

\subsection{Unfilled arrow heads}
\label{sec:unfilled-arrow-heads}

\begin{example}{mparrowsexamples2.mps}
  Arrows just with the same outline as the default arrows but not
  filled.

  To use the unfilled default arrows type
\begin{lstlisting}
setarrows(defaultunfilled);
\end{lstlisting}
\end{example}

\subsection{Sharp arrow heads}
\label{sec:sharp-arrow-heads}

\begin{example}{mparrowsexamples3.mps}
  Arrows just with the same path for the arrow head as the default
  arrows but only filled -- the outline is not drawn.

  The tip of the arrow is exactly at the end of the path.

  To use the sharp default arrows type
\begin{lstlisting}
setarrows(defaultsharp);
\end{lstlisting}
\end{example}

\subsection{Barbed arrows}
\label{sec:barbed-arrows-1}


\begin{example}{mparrowsexamples4.mps}
  With the same `outer' lines as the default arrow but the back of the
  arrow head has barbs.

  To use the barbed arrows type
\begin{lstlisting}
setarrows(barbed);
\end{lstlisting}
\end{example}

\subsection{Unfilled barbed arrows}
\label{sec:unfill-barb-arrows}

\begin{example}{mparrowsexamples5.mps}
  The barbed arrow unfilled.

  To use the unfilled barbed arrows type
\begin{lstlisting}
setarrows(barbedunfilled);
\end{lstlisting}
\end{example}

\subsection{Sharp barbed arrows}
\label{sec:sharp-barbed-arrows}

\begin{example}{mparrowsexamples6.mps}
  The barbed arrow sharp.

  To use the sharp barbed arrows type
\begin{lstlisting}
setarrows(barbedsharp);
\end{lstlisting}
\end{example}

\subsection{Open arrowheads}
\label{sec:open-arrowheads}

\begin{example}{mparrowsexamples7.mps}
  With the same `outer' lines as the default arrow but the back of the
  arrow head is not drawn.

  To use the open arrows type
\begin{lstlisting}
setarrows(open);
\end{lstlisting}
\end{example}

\section{The \texttt{barbed} arrows}
\label{sec:barbed-arrows}

\begin{example}{mparrowsexamples33.mps}
  The \texttt{barbed} arrows are configured via the
  \barbedarrowindent\ value. \barbedarrowindent\ is the ratio of the
  inner diameter of the barbed arrows (\textcolor{green}{green}
  circle) to the outer diameter of the barbed arrows
  (\textcolor{red}{red} circle).
\end{example}
%\includegraphics{mparrowsexamples33.mps}

The \barbedarrowindent\ value is set with
\begin{lstlisting}
barbedarrowindent:=.6;
\end{lstlisting}

Below arrows with different values of \barbedarrowindent\ are displayed.
\begin{description}
\item[\includegraphics{mparrowsexamples10.mps}] %0
%\item[\includegraphics{mparrowsexamples11.mps}] %0.2
\item[\includegraphics{mparrowsexamples12.mps}] %0.4
%\item[\includegraphics{mparrowsexamples13.mps}] %0.6
\item[\includegraphics{mparrowsexamples14.mps}] %0.8
%\item[\includegraphics{mparrowsexamples15.mps}] %1
\item[\includegraphics{mparrowsexamples16.mps}] %1.2
%\item[\includegraphics{mparrowsexamples17.mps}] %1.4
\item[\includegraphics{mparrowsexamples18.mps}] %1.6
%\item[\includegraphics{mparrowsexamples19.mps}] %1.8
\item[\includegraphics{mparrowsexamples20.mps}] %2.0
\end{description}

\subsection{Negative values}
\label{sec:negative-values}

As the arrows are defined using circles negative values of
\barbedarrowindent\ gives the same as the positives.
\begin{description}
\item[\includegraphics{mparrowsexamples13.mps}]
\item[\includegraphics{mparrowsexamples30.mps}]
\end{description}

\section{The difference between the original and the default arrows}
\label{sec:diff-betw-orig}

The only (and invisible) difference between the original arrows of
MetaPost and the default arrows of the \texttt{mparrows} module is how
the path is drawn:

\begin{example}{mparrowsexamples31.mps}
  In the original definition the path is drawn as normal.
\end{example}

\begin{example}{mparrowsexamples32.mps}
  In the \texttt{mparrows} default the path is cut after the arrow
  head. This allows for making the arrow heads unfilled (see
  section~\ref{sec:unfilled-arrow-heads}) or sharp (see
  section~\ref{sec:sharp-arrow-heads}).
\end{example}

\clearpage
% \section{Source of \texttt{mparrows.mp}}
% \label{sec:source-texttt}

% \lstinputlisting{mparrows.mp}
% \clearpage

\section{Copyright and license}
\label{sec:license}

Copyright 2016, Palle Jørgensen, hamselv(at)pallej.dk

This file is part of the mparrows MetaPost module.

mparrows is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

mparrows is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with mparrows. If not, see <http://www.gnu.org/licenses/>.

\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: