%%% ====================================================================
%%%  @LaTeX-file{
%%%     author          = "Alan Jeffrey",
%%%     version         = "0.01",
%%%     date            = "28 July 1993",
%%%     time            = "20:56:10 BST",
%%%     filename        = "arrocont.tex",
%%%     address         = "School of Cognitive and Computing Sciences
%%%                        University of Sussex
%%%                        Brighton BN1 9QH
%%%                        UK",
%%%     telephone       = "+44 273 606755 x 3238",
%%%     FAX             = "+44 273 678188",
%%%     checksum        = "11651 283 1282 11130",
%%%     email           = "alanje@cogs.sussex.ac.uk",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "companion font TeX",
%%%     supported       = "yes",
%%%     abstract        = "This a technical study for arrows."
%%%     docstring       = "The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by the
%%%                        equivalent of the standard UNIX wc (word
%%%                        count) utility output of lines, words, and
%%%                        characters.  This is produced by Robert
%%%                        Solovay's checksum utility.",
%%%     package         = "stands alone",
%%%     dependencies    = "msam10 ltugboat.sty",
%%%  }
%%% ====================================================================
%
% 28 Jul 1993, v0.01: Finished v0.01.
%
% Copyright 1993 Alan Jeffrey.

\documentstyle{ltugboat}

\title{Control glyphs for arrows}
\author{Alan Jeffrey}
\address{University of Sussex}
\netaddress{alanje@cogs.susx.ac.uk}

\def\rtitlex{MFG discussion document}
\def\midrtitle{{\sl Task 3:
   Technical studies\/}}
\setcounter{page}{1}

\def\T#1{$\fam0 T_{#1}$}
\def\X#1{$\fam0 X_{#1}$}
\def\psname#1{\penalty0\mbox{\normalshape $\langle$#1$\rangle$}}
\def\psnon#1{\penalty0\mbox{\it $\langle$#1\/$\rangle$}}
\def\errorglyph{{\vrule width 0.5em height 0.5em depth0em}}

\font\msamten=msam10
\def\msam#1{\leavevmode\hbox{\msamten\char"#1}}

\font\lasyten=lasy10
\def\lasy#1{\leavevmode\hbox{\lasyten\char"#1}}

\def\syntax#1{\leavevmode\hbox{\it #1}}

\begin{document}

\maketitle

\section{Introduction}

This document looks at suitable control glyphs for implementing math
arrows.  In particular, we look at ways that extensible and negated
arrows can be produced.

\section{Vertical arrows}

Vertical arrows can be accessed using the growing delimiter mechanism.
The non-negated arrows can be built with a `top', `bot' and `rep'
section, and the negated arrows can be built with a `top', `bot', `med'
and `rep' section, where the `med' section includes the negation.

\section{Horizontal arrows}

Horizontal arrows can be produced using the advanced ligature mechanism
introduced in \TeX~3.  An \syntax{arrow} is defined by:
\[
   \syntax{arrow} ::=
      \syntax{leftarrow} \: \syntax{rightarrow} \: \syntax{extarrow}^*
\]
A \syntax{leftarrow} is the leftmost part of an arrow, that is the tail
of a rightwards-pointing arrow or the head of a leftwards-pointing
arrow.  For example, the \syntax{leftarrow} of `$\mapsto$' is
\psnon{leftarrowmapsto} and the \syntax{leftarrow} of `$\leftrightarrow$' is
\psnon{leftarowhead}.  A \syntax{leftarrow} is one of:
\begin{itemize}

\item \psnon{leftarrownone} There is nothing on the left of the arrow,
   for example `$\rightarrow$' or `\msam{13}'.

\item \psnon{leftarrowhead} There is a single arrowhead on the left of
   this arrow, for example `$\leftrightarrow$' or `$\hookleftarrow$'.

\item \psnon{leftarrowdblhead} There is a double arrowhead on the left of
   this arrow, for example `$\Leftarrow$' or `$\Leftrightarrow$'.

\item \psnon{leftarrowtrplhead} There is a triple arrowhead on the left
   of this arrow, for example `\msam{57}' or `\msam{57}\kern-2pt\msam{56}'.

\item \psnon{leftarrowmapsto} There is a flat bar on the left of this
   arrow, for example `$\mapsto$'.

\item \psnon{leftarrowhook} There is a hook on the left of this arrow,
   for example `$\hookrightarrow$'.

\item \psnon{leftarrowharpoonup} There is an upwards harpoon on the left
   of this arrow, for example `$\leftharpoonup$'.

\item \psnon{leftarrowharpoondown} There is a downwards harpoon on the
   left of this arrow, for example `$\leftharpoondown$'.

\item \psnon{leftarrowharpoondblup} There is an upwards harpoon on the
   left of this double arrow, for example `\msam{0B}'.

\item \psnon{leftarrowharpoondbldown} There is a downwards harpoon on the
   left of this double arrow, for example `\msam{0A}'.

\item \psnon{leftarrowheaddbl} There are two arrowheads on the left of
   this single arrow, for example `\msam{11}'.

\item \psnon{leftarrowdblheaddbl} There are two arrowheads on the left of
   this double arrow, for example `\msam{12}'.

\item \psnon{leftarrowdblheadup} There is an arrowhead on the top left of
   this double arrow, for example `\msam{1C}'.

\item \psnon{leftarrowdblheaddown} There is an arrowhead on the bottom
   left of this double arrow, for example `\msam{1D}'.

\item \psnon{leftarrowrighthead} There is a rightwards arrowhead on the
   left of this arrow, for example `\msam{1A}'.

\item \psnon{leftarrowcurlyhead} There is an arrowhead with a curly line
   leading out of it on the left of this arrow, for example `\msam{21}'

\item \psnon{leftarrowturn} There is a turn on the left of this arrow, for
   example `\msam{23}'.

\item \psnon{leftarrowcirc} There is an open circle on the left of this
   arrow, for example `$\vcenter{\hbox{$\scriptstyle\circ$}}\!-$'.

\item \psnon{leftarrowbullet} There is a closed circle on the left of this
   arrow, for example `$\vcenter{\hbox{$\scriptstyle\bullet$}}\!-$'.

\item \psnon{leftarrowtriangle} There is an open triangle on the left of this
   arrow, for example `$\vcenter{\hbox{$\scriptstyle\triangleleft$}}\!-$'.

\end{itemize}
A \syntax{rightarrow} has the same possibilities, visually mirrored
around the vertical axis, and with `\syntax{left}' swapped with
`\syntax{right}'.  For example:
\begin{itemize}

\item[$\rightarrow$] is \psnon{leftarrownone}\psnon{rightarrowhead}.

\item[$\leftrightarrow$] is \psnon{leftarrowhead}\psnon{rightarrowhead}.

\item[$\vcenter{\hbox{$\scriptstyle\bullet$}}\!\!$\msam{22}]
   is \psnon{leftarrowbullet}\psnon{rightarrowturn}.

\end{itemize}
These arrows can be extended using \syntax{extarrow} glyphs, which say
how many extension pieces to put into the arrow.  An \syntax{extarrow} is
one of:
\begin{itemize}

\item \psnon{extarrowone} which extends the arrow.
\item \psnon{extarrowneg} which negates the arrow.
\item \psnon{extarrowoneneg} which extends the arrow and negates it.

\end{itemize}
If there is a negation, it should come in the middle of the list of
extensions, for example:
\begin{raggedright}\begin{description}

\item[$\not\Leftrightarrow$] is \psnon{leftarrowdblhead}\psnon
   {rightarrowdblhead}\psnon{extarrowneg}.

\item[$\Leftarrow\!\!\not\,\Rightarrow$]
   is \psnon{leftarrowdblhead}\psnon
   {rightarrowdblhead}\psnon{extarrowoneneg}.

\item[$\Leftarrow\!\not\Longrightarrow$]
   is \psnon{leftarrowdblhead}\psnon
   {rightarrowdblhead}\psnon{extarrowone}\psnon{extarrowneg}\psnon
   {extarrowone}.

\end{description}\end{raggedright}%
Note that not every font will be able to produce every combination of
\syntax{leftarrow} and \syntax{rightarrow}, for example some pi fonts do
not allow $\mapsto$ to be extended.  In fact, some of the combinations
make no sense, such as \psnon{leftarrowhook}\psnon{rightarrowdblhead}.
Such nonexistent arrows should be set with an eye-catching error glyph
such as `\errorglyph' and if possible should put a `Warning:' special
into the \verb|dvi| file.

We should not specify anything about the appearance of these control
glyphs, which should give font implementors enough freedom to convert
most pi fonts into this encoding.  One possible implementation of these
control glyphs is by ligaturing and kerning, for example by using the
ligatures:
\begin{eqnarray*}
   \lefteqn{\psnon{leftarrowhead} \psnon{rightarrowhead}} \\&
   \rightarrow & \psnon{leftrightarrow} \\
   \lefteqn{\psnon{leftrightarrow}\psnon{extarrowone}} \\&
   \rightarrow & \psnon{leftrightarrow}\psnon{rightarrow} \\
   \lefteqn{\psnon{leftrightarrow}\psnon{rightarrow}} \\&
   \rightarrow & \psnon{leftarrow}\psnon{rightarrow} \\
   \lefteqn{\psnon{rightarrow}\psnon{extarrowone}} \\&
   \rightarrow & \psnon{rightarrow}\psnon{rightarrow} \\
   \lefteqn{\psnon{rightarrow}\psnon{rightarrow}} \\&
   \rightarrow & \psnon{arrowext}\psnon{rightarrow}
\end{eqnarray*}
and appropriate kerns for:
\begin{center}
   \psnon{leftarrow}\psnon{rightarrow} \\
   \psnon{arrowext}\psnon{rightarrow}
\end{center}
then the `arrow-building kit' will build any length of
`$\leftrightarrow$' that is required, for example:
\begin{verbatim}
   \def\longrightarrow{\mathrel
      {\leftarrowheadchar
         \rightarrowheadchar
         \arrowextonechar}}
\end{verbatim}
Note that as long as the user does
not use the control glyphs of type mathord in their document, the
ligtable will never be used (rule 14 of Appendix G) and so input such as:
\begin{verbatim}
   {\rightarrow} \rightarrow
\end{verbatim}
will not unexpectedly ligature to something else.  There are a few
features missing from these control glyphs:
\begin{itemize}

\item The simpler arrows should be in fixed slots, so that they can be
   accessed quickly through a \verb|\mathchardef|.  We should ensure that
   this \verb|\mathchardef| is always of type mathrel, otherwise strange
   ligaturing might happen.

\item There is currently no syntax for accessing the negation glyphs on
   their own, which are necessary for building negated arrow leaders
   similar to \verb|\arrowfill|.

\end{itemize}
There are eight other `arrowlike' glyphs that are defined as
special glyphs, and do not fit into the `arrow-building kit'. These are
`\msam{08}', `\msam{09}', `\msam{1E}', `\msam{1F}', `\msam{4B}',
`\msam{4C}', `$\vec{x}$' and
`$\vcenter{\hbox{$\scriptstyle\leftrightarrow$}\kern-2ex\hbox{$-$}\kern-.5ex}$'.
These glyphs should be accessed directly.

All that these control glyphs are doing is simulating the extensible
vertical glyphs such as the growing delimiters.  If there were a
horizontal equivalent of growing delimiters then no such trickery would
be required!

\section{Diagonal arrows}

There is no easy way to build diagonal extended arrows.  All the font can
do is provide the building blocks, and leave \TeX\ macros to build the
arrows.  The font standard should specify how each of the diagonal
extended arrows is to be constructed, and any font dimensions that will
be necessary for the task.

\section{Conclusions}

Setting extensible vertical arrows with \TeX\ is simple, since the
growing delimiter mechanism already supports it.  Setting growing
horizontal arrows is trickier, and requires clever ligtable programming,
but it can still be done inside the font, and without use of \TeX\
macros.  Setting diagonal arrows can only be done by brute force and
\TeX\ programming.

\makesignature

\end{document}
