| 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 |
| 6 |
% it 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 |
% mparrows 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 mparrows. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
\pdfoutput1 % |
| 18 |
\documentclass[paper=a4,11pt,UKenglish,DIV=calc,BCOR=0mm,parskip=half,fleqn]{scrartcl} |
| 19 |
\usepackage[T1]{fontenc} % |
| 20 |
\usepackage[utf8]{inputenc} % |
| 21 |
\usepackage{babel} % |
| 22 |
\usepackage{tgpagella} % |
| 23 |
\usepackage{listings} % |
| 24 |
\usepackage{calc} % |
| 25 |
\usepackage[scaled]{luximono} % |
| 26 |
\usepackage{textcomp} % |
| 27 |
\renewcommand*\sfdefault{uop} % |
| 28 |
\linespread{1.045} % |
| 29 |
\usepackage{graphicx} % |
| 30 |
\usepackage{mflogo} % |
| 31 |
\usepackage{varioref} % |
| 32 |
\usepackage[colorlinks]{hyperref} % |
| 33 |
\usepackage[final]{microtype} % |
| 34 |
\setcounter{secnumdepth}{2} % |
| 35 |
\setcounter{tocdepth}{1} % |
| 36 |
\setkomafont{captionlabel}{\usekomafont{sectioning}} % |
| 37 |
\setkomafont{caption}{\small} % |
| 38 |
\author{Palle J\o rgensen} % |
| 39 |
\title{The \texttt{mparrows} \MP\ module\quad \raisebox{-1ex}{\includegraphics[scale=.5]{mparrowsexamples2.mps}}} % |
| 40 |
\hypersetup{pdftitle={The Mparrows MetaPost module}, pdfauthor={Palle Jorgensen}} |
| 41 |
\lstset{language=metapost,breaklines,morekeywords={setarrows,barbedarrowindent}} |
| 42 |
\newenvironment{example}[1]{% |
| 43 |
\def\myfile{#1} |
| 44 |
\begin{tabular}{@{}p{.67\linewidth-\tabcolsep}p{.33\linewidth}@{}} |
| 45 |
\begin{minipage}[c]{\linewidth}}{% |
| 46 |
\end{minipage} |
| 47 |
&\parbox[c]{\linewidth}{\centering\includegraphics{\myfile}} |
| 48 |
\end{tabular}} |
| 49 |
\protected\def\barbedarrowindent{\lstinline{barbedarrowindent}} |
| 50 |
|
| 51 |
\begin{document} |
| 52 |
\maketitle |
| 53 |
|
| 54 |
\tableofcontents |
| 55 |
\clearpage |
| 56 |
|
| 57 |
\section{Introduction} |
| 58 |
\label{sec:introduction} |
| 59 |
|
| 60 |
This MetaPost module provides some different types of arrow heads for |
| 61 |
use with the \lstinline{drawarrow} and \lstinline{drawdblarrow} |
| 62 |
commands. |
| 63 |
|
| 64 |
\section{Usage} |
| 65 |
\label{sec:usage} |
| 66 |
|
| 67 |
To load the mparrows module put the following line into the start of |
| 68 |
your MetaPost file: |
| 69 |
\begin{lstlisting} |
| 70 |
input mparrows; |
| 71 |
\end{lstlisting} |
| 72 |
|
| 73 |
\section{The new arrow types} |
| 74 |
\label{sec:new-arrow-types} |
| 75 |
|
| 76 |
The new arrows are defined with the same parameters as the original |
| 77 |
MetaPost arrows; \lstinline{ahlength} and \lstinline{ahangle}. |
| 78 |
|
| 79 |
\subsection{The original arrows of \MP} |
| 80 |
\label{sec:original-arrows-of-mp} |
| 81 |
|
| 82 |
\begin{example}{mparrowsexamples0.mps} |
| 83 |
To the right the original arrows of MetaPost are shown. |
| 84 |
|
| 85 |
They are shown here mostly for comparison. The picture is as most of |
| 86 |
the other pictures scaled by five. |
| 87 |
|
| 88 |
To use the original arrows type |
| 89 |
\begin{lstlisting} |
| 90 |
setarrows(orig); |
| 91 |
\end{lstlisting} |
| 92 |
\end{example} |
| 93 |
|
| 94 |
\subsection{The default arrows of the \texttt{mparrows} module} |
| 95 |
\label{sec:stand-arrows-mparrows} |
| 96 |
|
| 97 |
\begin{example}{mparrowsexamples1.mps} |
| 98 |
The default arrow of the \texttt{mparrows} module look similar to the |
| 99 |
original arrows of MetaPost. |
| 100 |
|
| 101 |
However there is a little difference. See |
| 102 |
section~\vref{sec:diff-betw-orig}. |
| 103 |
|
| 104 |
To use the default arrows type |
| 105 |
\begin{lstlisting} |
| 106 |
setarrows(default); |
| 107 |
\end{lstlisting} |
| 108 |
or do nothing -- it's default. |
| 109 |
\end{example} |
| 110 |
|
| 111 |
\subsection{Unfilled arrow heads} |
| 112 |
\label{sec:unfilled-arrow-heads} |
| 113 |
|
| 114 |
\begin{example}{mparrowsexamples2.mps} |
| 115 |
Arrows just with the same outline as the default arrows but not |
| 116 |
filled. |
| 117 |
|
| 118 |
To use the unfilled default arrows type |
| 119 |
\begin{lstlisting} |
| 120 |
setarrows(defaultunfilled); |
| 121 |
\end{lstlisting} |
| 122 |
\end{example} |
| 123 |
|
| 124 |
\subsection{Sharp arrow heads} |
| 125 |
\label{sec:sharp-arrow-heads} |
| 126 |
|
| 127 |
\begin{example}{mparrowsexamples3.mps} |
| 128 |
Arrows just with the same path for the arrow head as the default |
| 129 |
arrows but only filled -- the outline is not drawn. |
| 130 |
|
| 131 |
The tip of the arrow is exactly at the end of the path. |
| 132 |
|
| 133 |
To use the sharp default arrows type |
| 134 |
\begin{lstlisting} |
| 135 |
setarrows(defaultsharp); |
| 136 |
\end{lstlisting} |
| 137 |
\end{example} |
| 138 |
|
| 139 |
\subsection{Barbed arrows} |
| 140 |
\label{sec:barbed-arrows-1} |
| 141 |
|
| 142 |
|
| 143 |
\begin{example}{mparrowsexamples4.mps} |
| 144 |
With the same `outer' lines as the default arrow but the back of the |
| 145 |
arrow head has barbs. |
| 146 |
|
| 147 |
To use the barbed arrows type |
| 148 |
\begin{lstlisting} |
| 149 |
setarrows(barbed); |
| 150 |
\end{lstlisting} |
| 151 |
\end{example} |
| 152 |
|
| 153 |
\subsection{Unfilled barbed arrows} |
| 154 |
\label{sec:unfill-barb-arrows} |
| 155 |
|
| 156 |
\begin{example}{mparrowsexamples5.mps} |
| 157 |
The barbed arrow unfilled. |
| 158 |
|
| 159 |
To use the unfilled barbed arrows type |
| 160 |
\begin{lstlisting} |
| 161 |
setarrows(barbedunfilled); |
| 162 |
\end{lstlisting} |
| 163 |
\end{example} |
| 164 |
|
| 165 |
\subsection{Sharp barbed arrows} |
| 166 |
\label{sec:sharp-barbed-arrows} |
| 167 |
|
| 168 |
\begin{example}{mparrowsexamples6.mps} |
| 169 |
The barbed arrow sharp. |
| 170 |
|
| 171 |
To use the sharp barbed arrows type |
| 172 |
\begin{lstlisting} |
| 173 |
setarrows(barbedsharp); |
| 174 |
\end{lstlisting} |
| 175 |
\end{example} |
| 176 |
|
| 177 |
\subsection{Open arrowheads} |
| 178 |
\label{sec:open-arrowheads} |
| 179 |
|
| 180 |
\begin{example}{mparrowsexamples7.mps} |
| 181 |
With the same `outer' lines as the default arrow but the back of the |
| 182 |
arrow head is not drawn. |
| 183 |
|
| 184 |
To use the open arrows type |
| 185 |
\begin{lstlisting} |
| 186 |
setarrows(open); |
| 187 |
\end{lstlisting} |
| 188 |
\end{example} |
| 189 |
|
| 190 |
\section{The \texttt{barbed} arrows} |
| 191 |
\label{sec:barbed-arrows} |
| 192 |
|
| 193 |
\begin{example}{mparrowsexamples33.mps} |
| 194 |
The \texttt{barbed} arrows are configured via the |
| 195 |
\barbedarrowindent\ value. \barbedarrowindent\ is the ratio of the |
| 196 |
inner diameter of the barbed arrows (\textcolor{green}{green} |
| 197 |
circle) to the outer diameter of the barbed arrows |
| 198 |
(\textcolor{red}{red} circle). |
| 199 |
\end{example} |
| 200 |
%\includegraphics{mparrowsexamples33.mps} |
| 201 |
|
| 202 |
The \barbedarrowindent\ value is set with |
| 203 |
\begin{lstlisting} |
| 204 |
barbedarrowindent:=.6; |
| 205 |
\end{lstlisting} |
| 206 |
|
| 207 |
Below arrows with different values of \barbedarrowindent\ are displayed. |
| 208 |
\begin{description} |
| 209 |
\item[\includegraphics{mparrowsexamples10.mps}] %0 |
| 210 |
%\item[\includegraphics{mparrowsexamples11.mps}] %0.2 |
| 211 |
\item[\includegraphics{mparrowsexamples12.mps}] %0.4 |
| 212 |
%\item[\includegraphics{mparrowsexamples13.mps}] %0.6 |
| 213 |
\item[\includegraphics{mparrowsexamples14.mps}] %0.8 |
| 214 |
%\item[\includegraphics{mparrowsexamples15.mps}] %1 |
| 215 |
\item[\includegraphics{mparrowsexamples16.mps}] %1.2 |
| 216 |
%\item[\includegraphics{mparrowsexamples17.mps}] %1.4 |
| 217 |
\item[\includegraphics{mparrowsexamples18.mps}] %1.6 |
| 218 |
%\item[\includegraphics{mparrowsexamples19.mps}] %1.8 |
| 219 |
\item[\includegraphics{mparrowsexamples20.mps}] %2.0 |
| 220 |
\end{description} |
| 221 |
|
| 222 |
\subsection{Negative values} |
| 223 |
\label{sec:negative-values} |
| 224 |
|
| 225 |
As the arrows are defined using circles negative values of |
| 226 |
\barbedarrowindent\ gives the same as the positives. |
| 227 |
\begin{description} |
| 228 |
\item[\includegraphics{mparrowsexamples13.mps}] |
| 229 |
\item[\includegraphics{mparrowsexamples30.mps}] |
| 230 |
\end{description} |
| 231 |
|
| 232 |
\section{The difference between the original and the default arrows} |
| 233 |
\label{sec:diff-betw-orig} |
| 234 |
|
| 235 |
The only (and invisible) difference between the original arrows of |
| 236 |
MetaPost and the default arrows of the \texttt{mparrows} module is how |
| 237 |
the path is drawn: |
| 238 |
|
| 239 |
\begin{example}{mparrowsexamples31.mps} |
| 240 |
In the original definition the path is drawn as normal. |
| 241 |
\end{example} |
| 242 |
|
| 243 |
\begin{example}{mparrowsexamples32.mps} |
| 244 |
In the \texttt{mparrows} default the path is cut after the arrow |
| 245 |
head. This allows for making the arrow heads unfilled (see |
| 246 |
section~\ref{sec:unfilled-arrow-heads}) or sharp (see |
| 247 |
section~\ref{sec:sharp-arrow-heads}). |
| 248 |
\end{example} |
| 249 |
|
| 250 |
\clearpage |
| 251 |
% \section{Source of \texttt{mparrows.mp}} |
| 252 |
% \label{sec:source-texttt} |
| 253 |
|
| 254 |
% \lstinputlisting{mparrows.mp} |
| 255 |
% \clearpage |
| 256 |
|
| 257 |
\section{Copyright and license} |
| 258 |
\label{sec:license} |
| 259 |
|
| 260 |
Copyright 2016, Palle Jørgensen, hamselv(at)pallej.dk |
| 261 |
|
| 262 |
This file is part of the mparrows MetaPost module. |
| 263 |
|
| 264 |
mparrows is free software: you can redistribute it and/or modify it |
| 265 |
under the terms of the GNU General Public License as published by the |
| 266 |
Free Software Foundation, either version 3 of the License, or (at your |
| 267 |
option) any later version. |
| 268 |
|
| 269 |
mparrows is distributed in the hope that it will be useful, but |
| 270 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 271 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 272 |
General Public License for more details. |
| 273 |
|
| 274 |
You should have received a copy of the GNU General Public License |
| 275 |
along with mparrows. If not, see <http://www.gnu.org/licenses/>. |
| 276 |
|
| 277 |
\end{document} |
| 278 |
|
| 279 |
%%% Local Variables: |
| 280 |
%%% mode: latex |
| 281 |
%%% TeX-master: t |
| 282 |
%%% End: |