Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/lib/texmf/doc/generic/xypic/xyguide-html/node20.html

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos ([email protected]), 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>&gt;&lt;</code><code>|</code><code>ox+/()[]</code><code> </code> <TD>&#32;&#160;&#32;<em>tip</em> characters<TR><TD>
 <code>-.~:=</code> <TD>&#32;&#160;&#32;<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&nbsp;<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&nbsp;<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>&#32;&#160;&#32;shift object <em>vector</em>
</TABLE></CENTER><P>
<P>
	(where the possibilities for <em>vector</em> are described in
	section&nbsp;<A HREF="node17.html#arrowschanging">2.6</A>).  Combined with the direction code this
	is very powerful, for example,
<BLOCKQUOTE><PRE>\newdir{|&gt;}{%
 !/4.5pt/@{|}*:(1,-.2)@^{&gt;}*:(1,+.2)@_{&gt;}}</PRE></BLOCKQUOTE>
<P>
	defines a new tip that makes
<BLOCKQUOTE><PRE>\xymatrix{ A \ar @{=|&gt;} [r] &amp; B }</PRE></BLOCKQUOTE>
<P>
	typeset
	<IMG WIDTH=90 HEIGHT=21 ALIGN=MIDDLE ALT="tex2html_wrap_inline2718" SRC="img57.gif">&nbsp;.  Notice how the "relative direction" is used here to
	rotate some of the composed components.
<P>
<A NAME="Exercise14">&#160;</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> &gt;</code> to generate
	a "tail-spaced" arrow.  Do this such that
<BLOCKQUOTE><PRE>\xymatrix{ A \ar @{&gt;-&gt;}  @&lt; 2pt&gt; [r]
             \ar @{ &gt;-&gt;} @&lt;-2pt&gt; [r] &amp; 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@{-&gt;&gt;|}[r]&amp;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">&#160;</A><H4><A NAME="SECTION00049020000000000000">Exercise 15.</A></H4>	Typeset <IMG WIDTH=82 HEIGHT=20 ALIGN=MIDDLE ALT="tex2html_wrap_inline2728" SRC="img60.gif">&nbsp;.  <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&nbsp;<A HREF="node13.html#arrowsobjects">2.2</A>) in
	any context.
<P>
<A HREF="node33.html#Answer15">Answer.</A>
<P>
<P>&#160;<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>
&lt;<a href="mailto:[email protected]">[email protected]</a>&gt;
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>

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].