%% curvedarrows.sty
%% Copyright 2006 Glad Deschrijver <Glad.Deschrijver(at)UGent.be>
%%
%% curvedarrows - A LaTeX package for producing curved arrows
%% Requires the package pgf (http://sourceforge.net/projects/pgf/)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work consists of the files curvedarrows.sty and curvedarrowsdoc.tex.
%
% -----------------------------------------------------------------------
%
% The package provides the commands necessary to make tables which
% show the behavior of the graph of a R -> R function:
% \nehatching
%    provides a rectangular area filled with a hatching pattern formed
%    by north east oriented lines
% \sehatching
%    provides a rectangular area filled with a hatching pattern formed
%    by south east oriented lines
% \hatching
%    alias for \nehatching
% \clnearrow
%    provides a curved lower bended, north east oriented arrow
% \clsearrow
%    provides a curved lower bended, south east oriented arrow
% \cunearrow
%    provides a curved upper bended, north east oriented arrow
% \cusearrow
%    provides a curved upper bended, south east oriented arrow
% \convincr
%    alias for \clnearrow; this arrow specifies that the graph
%    of the function is convex increasing
% \convdecr
%    alias for \clsearrow; this arrow specifies that the graph
%    of the function is convex decreasing
% \concincr
%    alias for \cunearrow; this arrow specifies that the graph
%    of the function is concave increasing
% \concdecr
%    alias for \cusearrow; this arrow specifies that the graph
%    of the function is concave decreasing
% \curvedarrowslinewidth
%    specify the line width of the arrows (default: .035em)
% \curvedarrowstip
%    specify the type of the arrow tip (default: to)

% History:
% 0.1: original version
% 0.2: pgf only, i.e. this package does not rely on tikz anymore

\ProvidesPackage{curvedarrows}[2006/12/11 v0.2 Curved arrows]

\RequirePackage{pgf}

\def\curvedarrowslinewidth{.035em}
\def\curvedarrowstip{to}

\def\nehatching{% north east hatching
  \begin{pgfpicture}{0em}{-.12em}{1.76em}{.18em}
    \pgfsetxvec{\pgfpoint{2.85em}{0em}}
    \pgfsetyvec{\pgfpoint{0em}{2.85em}}
    \pgfsetlinewidth{\curvedarrowslinewidth}
    \pgfmoveto{\pgfxy(0,-.10)}
    \pgflineto{\pgfxy(.62,-.10)}
    \pgflineto{\pgfxy(.62,.2)}
    \pgflineto{\pgfxy(0,.2)}
    \pgfclip
    \pgfmoveto{\pgfxy(-.23,-.12)}  \pgflineto{\pgfxy(.11,.22)}
    \pgfmoveto{\pgfxy(-.08,-.12)}  \pgflineto{\pgfxy(.26,.22)}
    \pgfmoveto{\pgfxy(.07,-.12)}   \pgflineto{\pgfxy(.41,.22)}
    \pgfmoveto{\pgfxy(.22,-.12)}   \pgflineto{\pgfxy(.56,.22)}
    \pgfmoveto{\pgfxy(.37,-.12)}   \pgflineto{\pgfxy(.71,.22)}
    \pgfmoveto{\pgfxy(.52,-.12)}   \pgflineto{\pgfxy(.86,.22)}
    \pgfstroke
  \end{pgfpicture}%
}

\def\sehatching{% south east hatching
  \begin{pgfpicture}{0em}{-.12em}{1.76em}{.18em}
    \pgfsetxvec{\pgfpoint{2.85em}{0em}}
    \pgfsetyvec{\pgfpoint{0em}{2.85em}}
    \pgfsetlinewidth{\curvedarrowslinewidth}
    \pgfmoveto{\pgfxy(0,-.10)}
    \pgflineto{\pgfxy(.62,-.10)}
    \pgflineto{\pgfxy(.62,.2)}
    \pgflineto{\pgfxy(0,.2)}
    \pgfclip
    \pgfmoveto{\pgfxy(-.23,.22)}  \pgflineto{\pgfxy(.11,-.12)}
    \pgfmoveto{\pgfxy(-.08,.22)}  \pgflineto{\pgfxy(.26,-.12)}
    \pgfmoveto{\pgfxy(.07,.22)}   \pgflineto{\pgfxy(.41,-.12)}
    \pgfmoveto{\pgfxy(.22,.22)}   \pgflineto{\pgfxy(.56,-.12)}
    \pgfmoveto{\pgfxy(.37,.22)}   \pgflineto{\pgfxy(.71,-.12)}
    \pgfmoveto{\pgfxy(.52,.22)}   \pgflineto{\pgfxy(.86,-.12)}
    \pgfstroke
  \end{pgfpicture}%
}
\def\hatching{\nehatching} % hatching, hachure (arcering)

\def\clnearrow{% curved lower north east arrow
  \begin{pgfpicture}{0em}{-.12em}{1.05em}{.18em}
    \pgfsetxvec{\pgfpoint{2.85em}{0em}}
    \pgfsetyvec{\pgfpoint{0em}{2.85em}}
    \pgfsetlinewidth{\curvedarrowslinewidth}
    \pgfsetendarrow{\csname pgfarrow\curvedarrowstip\endcsname}
    \pgfmoveto{\pgfxy(0,-.12)}
    \pgfcurveto{\pgfxy(.12,-.12)}{\pgfxy(.32,-.06)}{\pgfxy(.32,.18)}
    \pgfstroke
  \end{pgfpicture}%
}
\def\convincr{\clnearrow} % convex increasing

\def\clsearrow{% curved lower south east arrow
  \begin{pgfpicture}{0em}{-.12em}{1.05em}{.18em}
    \pgfsetxvec{\pgfpoint{2.85em}{0em}}
    \pgfsetyvec{\pgfpoint{0em}{2.85em}}
    \pgfsetlinewidth{\curvedarrowslinewidth}
    \pgfsetendarrow{\csname pgfarrow\curvedarrowstip\endcsname}
    \pgfmoveto{\pgfxy(0,.18)}
    \pgfcurveto{\pgfxy(0,.06)}{\pgfxy(.12,-.12)}{\pgfxy(.36,-.12)}
    \pgfstroke
  \end{pgfpicture}%
}
\def\convdecr{\clsearrow} % convex decreasing

\def\cunearrow{% curved upper north east arrow
  \begin{pgfpicture}{0em}{-.12em}{1.05em}{.18em}
    \pgfsetxvec{\pgfpoint{2.85em}{0em}}
    \pgfsetyvec{\pgfpoint{0em}{2.85em}}
    \pgfsetlinewidth{\curvedarrowslinewidth}
    \pgfsetendarrow{\csname pgfarrow\curvedarrowstip\endcsname}
    \pgfmoveto{\pgfxy(0,-.12)}
    \pgfcurveto{\pgfxy(0,.03)}{\pgfxy(.12,.18)}{\pgfxy(.36,.18)}
    \pgfstroke
  \end{pgfpicture}%
}
\def\concincr{\cunearrow} % concave increasing

\def\cusearrow{% curved upper south east arrow
  \begin{pgfpicture}{0em}{-.12em}{1.05em}{.18em}
    \pgfsetxvec{\pgfpoint{2.85em}{0em}}
    \pgfsetyvec{\pgfpoint{0em}{2.85em}}
    \pgfsetlinewidth{\curvedarrowslinewidth}
    \pgfsetendarrow{\csname pgfarrow\curvedarrowstip\endcsname}
    \pgfmoveto{\pgfxy(0,.18)}
    \pgfcurveto{\pgfxy(.12,.18)}{\pgfxy(.32,.12)}{\pgfxy(.32,-.12)}
    \pgfstroke
  \end{pgfpicture}%
}
\def\concdecr{\cusearrow} % concave decreasing

