% \iffalse meta-coment:
%
% The tikzpfeile package.
%
% \fi
%
% ^^A Driver stuff:
% \iffalse not to be used in package ....
%<*driver>
\documentclass[a4paper]{ltxdoc}
\usepackage{ifxetex}
\usepackage{doc}
\ifxetex
  \usepackage[no-math]{fontspec}
  \usepackage{polyglossia}
  \setmainfont[Mapping=tex-text,Numbers=OldStyle,Ligatures=Rare]{Linux Libertine O}
  \setsansfont[Mapping=tex-text,Numbers=OldStyle,Ligatures=Rare]{Linux Biolinum O}
  \setdefaultlanguage{english}
\else
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage[english]{babel}
\fi
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\usepackage{hyperref}
\usepackage{tikzpfeile}
\begin{document}
  \DocInput{tikzpfeile.dtx}
\end{document}
%</driver>
% \fi
%
% \iffalse package preamble
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tikzpfeile}[2012/03/28 v1.0 A LaTeX package for drawing arrows using PGF/TikZ]
% \fi
%
% \MakeShortVerb{\"}
%
% \newcommand{\tpf}{\texttt{tikzpfeile}}
% \newcommand{\pgftikz}{\texttt{PGF/TikZ}}
% \newenvironment{syntax}{\medskip\hspace*{1em}}{\par\medskip}
%
% \GetFileInfo{tikzpfeile.sty}
%
% \title{The \tpf{} Package}
% \author{Jonathan Zachhuber\thanks{\url{jonathan.zachhuber@gmail.com}} \and Michael Fütterer\thanks{\url{michaelfuetterer@gmail.com}}}
% \date{Version \fileversion, \filedate}
%
% \maketitle
%
% \begin{abstract}
% This package defines commands for drawing arrows using \pgftikz{} which should be used instead of the regular \LaTeX{} arrows.
% \end{abstract}
%
% \section{Introduction}
%
% In mathematical texts that contain commutative diagrams created with \pgftikz{}, it might be disturbing that regular arrows (such as "\rightarrow": $\rightarrow$) and the \pgftikz{} arrows in the diagrams have different heads. This package defines commands that draw arrows using \pgftikz{}. Using these instead of the regular arrows makes your document look more consistent. Moreover, using \pgftikz{}, a lot more different arrow types can be drawn.
%
% \section{Arrow commands}
%
% This package provides the following commands for drawing arrows:
%
% \medskip
%
% \begin{tabular}{l l}
%    "\ra"&\ra\\
%    "\la"&\la\\
%    "\mapsto"&\mapsto\\
%    "\lmapsto"&\lmapsto\\
%    "\inj"&\inj\\
%    "\linj"&\linj\\
%    "\surj"&\surj\\
%    "\lsurj"&\lsurj\\
%    "\isom"&\isom\\
%    "\lisom"&\lisom\\
%    "\lra"&\lra\\
%    "\ppf"&\ppf\\
%    "\lppf"&\lppf\\
%    "\smapsto"&\smapsto\\
%    "\lsmapsto"&\lsmapsto\\
%    "\oldmapsto"&$\oldmapsto$
% \end{tabular}
%
% \medskip
%
% \noindent By giving an optional argument, the arrows can be labeled. This does not work for the "\isom" and "\lisom" arrows.
%
% \medskip
%
% \begin{tabular}{l l}
%    "\ra[$\psi$]"&\ra[$\psi$]\\
%    "\inj[$\iota$]"&\inj[$\iota$]\\
%    "\surj[$\pi$]"&\surj[$\pi$]\\
%    "\lra[$\tau$]"&\lra[$\tau$]\\
%    "\ppf[$f$]"&\ppf[$f$]\\
% \end{tabular}
%
% \section{Package options}
%
% The package recognizes one option, "length". Usually, the arrows are $1\mathrm{cm}$ long. This length is scaled by the value given by the "length" option. Its default value is, of course, $1$.
%
% \section{Implementation}
%
% Of course, we need the "tikz" package with the "arrows" library. For the length option we need "kvoptions".
%    \begin{macrocode}
\RequirePackage{tikz}
\usetikzlibrary{arrows}
\RequirePackage{kvoptions}
%    \end{macrocode}
% Define the length option:
%    \begin{macrocode}
\DeclareStringOption[1]{length}
\DeclareLocalOptions{length}
\ProcessKeyvalOptions*
%    \end{macrocode}
% Now define the arrow commands using \pgftikz{}.
% \begin{macro}{\smapsto}
%    \begin{macrocode}
\newcommand*{\smapsto}{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, |->] (0,0)%
                 node{\hspace*{0pt}}%
                 -- node{} (0.7,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\lsmapsto}
%    \begin{macrocode}
\newcommand*{\lsmapsto}{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, <-|] (0,0)%
                 node{\hspace*{0pt}}%
                 -- node{} (0.7,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\ra}
%    \begin{macrocode}
\newcommand*{\ra}[1][]{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, ->,font=\scriptsize] (0,0)% 
                 node{\hspace*{-2pt}} -- (0.5,0) node[above] {#1}%
                  -- node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\la}
%    \begin{macrocode}
\newcommand*{\la}[1][]{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, <-,font=\scriptsize] (0,0)% 
                 node{\hspace*{-2pt}} -- (0.5,0) node[above] {#1}%
                  -- node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\mapsto}
% \end{macro}\begin{macro}{\oldmapsto}
% We save the old "\mapsto" arrow in "\oldmapsto".
%    \begin{macrocode}
\let\oldmapsto\mapsto
\renewcommand*{\mapsto}{\raisebox{-1pt}{\tikz{%
       \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, |->] (0,0)%
                node{\hspace*{0pt}}%
                -- node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\lmapsto}
%    \begin{macrocode}
\newcommand*{\lmapsto}{\raisebox{-1pt}{\tikz{%
       \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, <-|] (0,0)%
                node{\hspace*{0pt}}%
                -- node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\inj}
%    \begin{macrocode}
\newcommand*{\inj}[1][]{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, right hook->,%
                 font=\scriptsize] (0,0)%
                 node{\hspace*{0pt}} -- (0.5,0) node[above] {#1} --%
                 node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\linj}
%    \begin{macrocode}
\newcommand*{\linj}[1][]{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, <-left hook,%
                 font=\scriptsize] (0,0)%
                 node{\hspace*{0pt}} -- (0.5,0) node[above] {#1} --%
                 node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\surj}
%    \begin{macrocode}
\newcommand*{\surj}[1][]{\raisebox{-1pt}{\tikz{%
       \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, ->>,font=\scriptsize] (0,0)%
                node{\hspace*{0pt}} -- (0.5,0) node[above] {#1}%
                -- node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\lsurj}
%    \begin{macrocode}
\newcommand*{\lsurj}[1][]{\raisebox{-1pt}{\tikz{%
       \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, <<-,font=\scriptsize] (0,0)%
                node{\hspace*{0pt}} -- (0.5,0) node[above] {#1}%
                -- node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\isom}
%    \begin{macrocode}
\newcommand*{\isom}{\raisebox{-1pt}{\tikz{%
       \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, ->] %
                (0,0) node{\hspace*{0pt}} -- node{} (1,0);%
                \draw[xscale=\tikzpfeile@length] (0.4,0.1) node {$\sim$};}}%
        \penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\lisom}
%    \begin{macrocode}
\newcommand*{\lisom}{\raisebox{-1pt}{\tikz{%
       \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, <-] %
                (0,0) node{\hspace*{0pt}} -- node{} (1,0);%
                \draw[xscale=\tikzpfeile@length] (0.4,0.1) node {$\sim$};}}%
        \penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\lra}
%    \begin{macrocode}
\newcommand*{\lra}[1][]{\raisebox{-1pt}{\tikz{%
       \draw[xscale=\tikzpfeile@length,thin,shorten >=3pt, <->,font=\scriptsize] (0,0) %
                node{\hspace*{-2pt}} -- (0.5,0) node[above] {#1} --%
                node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\ppf}
%    \begin{macrocode}
\newcommand*{\ppf}[1][]{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,densely dashed,thin,shorten >=3pt,%
                ->,font=\scriptsize] (0,0) %
                node{\hspace*{0pt}} -- (0.5,0) node[above] {#1}%
                -- node{} (1,0);}}\penalty1000\relax}
%    \end{macrocode}
% \end{macro}\begin{macro}{\lppf}
%    \begin{macrocode}
\newcommand*{\lppf}[1][]{\raisebox{-1pt}{\tikz{%
        \draw[xscale=\tikzpfeile@length,densely dashed,thin,shorten >=3pt,%
                <-,font=\scriptsize] (0,0) %
                node{\hspace*{0pt}} -- (0.5,0) node[above] {#1}%
                -- node{} (1,0);}}\penalty1000\relax}

\endinput
%    \end{macrocode}
% \end{macro}
% \changes{v0.1}{2011/08/03}{Started project}
% \changes{v1.0}{2012/03/28}{First public version}
% \PrintChanges
% \PrintIndex
