<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>2.9 Defining new arrow types</TITLE>
<META NAME="description" CONTENT="2.9 Defining new arrow types">
<META NAME="keywords" CONTENT="xyguide-html">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="xyguide-html.css">
</HEAD>
<BODY LANG="EN" BGCOLOR="#FFFFFF">
<P ALIGN=RIGHT><FONT SIZE=1>Xy-pic User's Guide</FONT> <A HREF="18pt.html"><IMG SRC="./quest.gif" ALIGN=TOP HEIGHT=27 WIDTH=21 BORDER=0 ALT="?"></A><A NAME="arrowsdefining" NAME="tex2html303" HREF="node19.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="previous" SRC="./previous.gif"></A><A NAME="tex2html305" HREF="node19.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="previous" SRC="./previoussection.gif"></A><A NAME="tex2html307" HREF="node11.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="up" SRC="./up.gif"></A><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="next" SRC="./nextsection_gr.gif"><A NAME="tex2html309" HREF="node21.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="next" SRC="./next.gif"></A></P><H2><A NAME="SECTION00049000000000000000">2.9 Defining new arrow types</A></H2> Last in this treatment of arrows we will explain how new arrows
can be defined. The crucial fact is that the
characters used for <em>tips</em> and <em>shafts</em> are
restricted to the following:
<P><CENTER><TABLE BORDER=BASIC CELLPADDING=3 COLS=2><TR><TD> <code>><</code><code>|</code><code>ox+/()[]</code><code> </code> <TD>   <em>tip</em> characters<TR><TD>
<code>-.~:=</code> <TD>   <em>shaft</em> characters
</TABLE></CENTER><P>
<P>
When an arrow is interpreted by Xy-pic it is first split into the
three components and then each component is looked up in a library of
so-called "directionals." It is possible to add new such
directionals using the command
<P><CENTER><TABLE BORDER=BASIC CELLPADDING=3 COLS=1><TR><TD> <code>\newdir</code><code>{</code> <em>directional</em> <code>}{</code> <em>composite</em> <code>}</code>
</TABLE></CENTER><P>
<P>
where <em>directional</em> should be a sequence either of tip
characters or of shaft characters, and <em>composite</em> should be a
list of objects separated with <code>*</code> just like
the argument to <code>\composite</code> described in
section <A HREF="node13.html#arrowsobjects">2.2</A>. If arrows of a particular
<em>variant</em> (always one of the letters <code>^_23</code>) needs an
alternate definition then another declaration can be given with the
variant inserted between <code>\newdir</code> and the first <code>{</code>.
There is one object modifier which is very useful in this
context, in addition to those of section <A HREF="node13.html#arrowsobjects">2.2</A>:
<P><CENTER><TABLE BORDER=BASIC CELLPADDING=3 COLS=2><TR><TD> <code>!</code><em>vector</em> <TD>   shift object <em>vector</em>
</TABLE></CENTER><P>
<P>
(where the possibilities for <em>vector</em> are described in
section <A HREF="node17.html#arrowschanging">2.6</A>). Combined with the direction code this
is very powerful, for example,
<BLOCKQUOTE><PRE>\newdir{|>}{%
!/4.5pt/@{|}*:(1,-.2)@^{>}*:(1,+.2)@_{>}}</PRE></BLOCKQUOTE>
<P>
defines a new tip that makes
<BLOCKQUOTE><PRE>\xymatrix{ A \ar @{=|>} [r] & B }</PRE></BLOCKQUOTE>
<P>
typeset
<IMG WIDTH=90 HEIGHT=21 ALIGN=MIDDLE ALT="tex2html_wrap_inline2718" SRC="img57.gif"> . Notice how the "relative direction" is used here to
rotate some of the composed components.
<P>
<A NAME="Exercise14"> </A><H4><A NAME="SECTION00049010000000000000">Exercise 14.</A></H4> Often tips used as "tails" have their ink on the wrong side of the
point where they are placed. Fortunately space (<code> </code>) is also a
tip character so we can define the directional <code> ></code> to generate
a "tail-spaced" arrow. Do this such that
<BLOCKQUOTE><PRE>\xymatrix{ A \ar @{>->} @< 2pt> [r]
\ar @{ >->} @<-2pt> [r] & B }</PRE></BLOCKQUOTE>
<P>
typesets
<P><CENTER><BR><IMG WIDTH=195 HEIGHT=15 ALIGN=BOTTOM ALT="displaymath920" SRC="img58.gif"><BR></CENTER><P>
<P>
<A HREF="node33.html#Answer14">Answer.</A>
<P>
Finally, when Xy-pic diagrams are used in conjunction with Knuth's
<em>computer modern fonts</em> then the declaration
<P><CENTER><TABLE BORDER=BASIC CELLPADDING=3 COLS=1><TR><TD> <code>\SelectTips{cm}{}</code>
</TABLE></CENTER><P>
<P>
will change the tips to some that look similar, <I>e.g.</I>,
<BLOCKQUOTE><PRE>$\SelectTips{cm}{}
\xymatrix@1{A\ar@{->>|}[r]&B}$</PRE></BLOCKQUOTE>
typesets <IMG WIDTH=82 HEIGHT=15 ALIGN=BOTTOM ALT="tex2html_wrap2726" SRC="img59.gif">. The second argument (here <code>{}</code>) can be used
to specify a point size <code>{10}</code>, <code>{11}</code>, or <code>{12}</code>, if desired (the
default is <code>{10}</code><A NAME="tex2html9" HREF="footnode.html#1606"><IMG ALIGN=ABSMIDDLE ALT="gif" SRC="./foot.gif"></A>); <code>{cm}</code> can be
replaced by <code>{eu}</code> and <code>{xy}</code> to get tips in "Euler" and the
default technical style, respectively. The declaration respects
TeX grouping.
<P>
<A NAME="Exercise15"> </A><H4><A NAME="SECTION00049020000000000000">Exercise 15.</A></H4> Typeset <IMG WIDTH=82 HEIGHT=20 ALIGN=MIDDLE ALT="tex2html_wrap_inline2728" SRC="img60.gif"> . <em>Hint</em>: With the construction
<code>\object</code><em>object</em> one can typeset an Xy-pic <em>object</em>
(anything that could follow a <code>*</code> in section <A HREF="node13.html#arrowsobjects">2.2</A>) in
any context.
<P>
<A HREF="node33.html#Answer15">Answer.</A>
<P>
<P> <P ALIGN=RIGHT><FONT SIZE=1>Xy-pic User's Guide</FONT> <A HREF="18pt.html"><IMG SRC="./quest.gif" ALIGN=TOP HEIGHT=27 WIDTH=21 BORDER=0 ALT="?"></A><A NAME="tex2html303" HREF="node19.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="previous" SRC="./previous.gif"></A><A NAME="tex2html305" HREF="node19.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="previous" SRC="./previoussection.gif"></A><A NAME="tex2html307" HREF="node11.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="up" SRC="./up.gif"></A><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="next" SRC="./nextsection_gr.gif"><A NAME="tex2html309" HREF="node21.html"><IMG WIDTH=27 HEIGHT=27 BORDER=0 ALIGN=ABSMIDDLE ALT="next" SRC="./next.gif"></A><P><ADDRESS>
<BR><HR>
<a href="COPYING/index.html">�/a> <a href="http://www.brics.dk/~krisrose/">Kristoffer H. Rose</a>
<<a href="mailto:krisrose@brics.dk">krisrose@brics.dk</a>>
January 6, 1997
/
<a href="http://www-dsed.llnl.gov/files/programs/unix/latex2html/manual/">LaTeX2<TT>HTML</TT>v96.1-h</a>
</FONT>
</ADDRESS>
</BODY>
</HTML>
|