]> git.lyx.org Git - lyx.git/blob - lib/examples/xypic.lyx
79ed0f8d8877fa31ba5c533b22b8fd8cb59c1c14
[lyx.git] / lib / examples / xypic.lyx
1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 370
3 \begin_document
4 \begin_header
5 \textclass scrartcl
6 \begin_preamble
7 \usepackage[all]{xy}
8
9
10 % define new commands used in sec. 5.1
11 \newcommand{\xyR}[1]{
12   \xydef@\xymatrixrowsep@{#1}}
13 \newcommand{\xyC}[1]{
14   \xydef@\xymatrixcolsep@{#1}}
15
16 \newdir{|>}{!/4.5pt/@{|}*:(1,-.2)@^{>}*:(1,+.2)@_{>}}
17
18 % a pdf-bookmark for the TOC is added
19 \let\myTOC\tableofcontents
20 \renewcommand\tableofcontents{%
21   \pdfbookmark[1]{\contentsname}{}
22   \myTOC }
23
24 % redefine the \LyX macro for PDF bookmarks
25 \def\LyX{\texorpdfstring{%
26   L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
27   {LyX}}
28 \end_preamble
29 \options BCOR7.5mm
30 \use_default_options false
31 \language english
32 \inputencoding auto
33 \font_roman ae
34 \font_sans default
35 \font_typewriter default
36 \font_default_family default
37 \use_xetex false
38 \font_sc false
39 \font_osf false
40 \font_sf_scale 100
41 \font_tt_scale 100
42
43 \graphics default
44 \default_output_format default
45 \bibtex_command default
46 \index_command default
47 \paperfontsize 12
48 \spacing single
49 \use_hyperref true
50 \pdf_title "Using XY-pc in LyX"
51 \pdf_author "H. Peter Gumm"
52 \pdf_subject "LyX's XY-pic manual"
53 \pdf_keywords "LyX, documentation"
54 \pdf_bookmarks true
55 \pdf_bookmarksnumbered true
56 \pdf_bookmarksopen true
57 \pdf_bookmarksopenlevel 2
58 \pdf_breaklinks false
59 \pdf_pdfborder false
60 \pdf_colorlinks true
61 \pdf_backref false
62 \pdf_pdfusetitle false
63 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
64 \papersize a4paper
65 \use_geometry false
66 \use_amsmath 1
67 \use_esint 0
68 \cite_engine basic
69 \use_bibtopic false
70 \use_indices false
71 \paperorientation portrait
72 \suppress_date false
73 \index Index
74 \shortcut idx
75 \color #008000
76 \end_index
77 \secnumdepth 3
78 \tocdepth 3
79 \paragraph_separation indent
80 \paragraph_indentation default
81 \quotes_language english
82 \papercolumns 1
83 \papersides 2
84 \paperpagestyle default
85 \tracking_changes false
86 \output_changes false
87 \end_header
88
89 \begin_body
90
91 \begin_layout Title
92 Using 
93 \begin_inset ERT
94 status collapsed
95
96 \begin_layout Plain Layout
97
98
99 \backslash
100 Xy
101 \end_layout
102
103 \end_inset
104
105 -pic in LyX
106 \end_layout
107
108 \begin_layout Author
109 H.
110  Peter Gumm
111 \end_layout
112
113 \begin_layout Abstract
114 With the recent versions of LyX and with the 
115 \family typewriter
116 preview
117 \family default
118 -style installed in the LaTeX-System, the graph drawing package 
119 \family typewriter
120
121 \begin_inset ERT
122 status collapsed
123
124 \begin_layout Plain Layout
125
126
127 \backslash
128 Xy
129 \end_layout
130
131 \end_inset
132
133
134 \family default
135 -Pic can be conveniently used inside LyX.
136  Diagrams can be edited and displayed inside the main LyX editing window.
137  Here, we shall describe how to use the 
138 \family typewriter
139
140 \backslash
141 xymatrix
142 \family default
143  command from 
144 \family typewriter
145 xypic
146 \family default
147  inside LyX in order to draw, to edit and to preview diagrams as typically
148  used in category theory, algebra, and related fields.
149  
150 \end_layout
151
152 \begin_layout Abstract
153 \begin_inset CommandInset toc
154 LatexCommand tableofcontents
155
156 \end_inset
157
158
159 \end_layout
160
161 \begin_layout Section
162 Introduction 
163 \end_layout
164
165 \begin_layout Standard
166 The 
167 \family typewriter
168 xypic
169 \family default
170 -package has long served as a convenient tool for easily constructing graphs
171  and diagrams in LaTeX.
172  Unfortunately, its use in LyX had long been restricted to the infamous
173  TeX code boxes, meaning that the LyX editor could only display the LaTeX-source
174  and not the finished diagram.
175  The new 
176 \family typewriter
177 preview
178 \family default
179 -style of LaTeX which is part of the AUCTeX project
180 \begin_inset CommandInset citation
181 LatexCommand cite
182 key "AUCTeX"
183
184 \end_inset
185
186 , finally enables the editing and displaying of 
187 \family typewriter
188 xypic
189 \family default
190 -diagrams, constructed, displayed and interactively edited inside LyX.
191 \end_layout
192
193 \begin_layout Standard
194 \begin_inset VSpace defskip
195 \end_inset
196
197
198 \end_layout
199
200 \begin_layout Standard
201 \align center
202 \begin_inset Graphics
203         filename xyfigure.png
204         scale 50
205         BoundingBox 0bp 0bp 580bp 440bp
206         clip
207
208 \end_inset
209
210
211 \end_layout
212
213 \begin_layout Standard
214 \begin_inset VSpace defskip
215 \end_inset
216
217
218 \end_layout
219
220 \begin_layout Standard
221 In this note, we describe how 
222 \begin_inset ERT
223 status collapsed
224
225 \begin_layout Plain Layout
226
227
228 \backslash
229 Xy
230 \end_layout
231
232 \end_inset
233
234 -pic can be used from inside LyX, how diagrams can be created and edited.
235  We have tested the following using LyX versions 1.3.7 up to 1.6, running under
236  Windows
237 \begin_inset space \thinspace{}
238 \end_inset
239
240 XP and under Windows Vista.
241  
242 \end_layout
243
244 \begin_layout Standard
245 There are two modes of operations: For a start, and for some first tests,
246  it may be easiest to first enter the 
247 \begin_inset ERT
248 status collapsed
249
250 \begin_layout Plain Layout
251
252
253 \backslash
254 Xy
255 \end_layout
256
257 \end_inset
258
259 -Pic code inside the LyX-window, select it all and convert it to a graphical
260  representation by pressing 
261 \family sans
262 Ctrl-m
263 \family default
264  or 
265 \family sans
266 Ctrl-M
267 \family default
268 .
269  If you use 
270 \begin_inset ERT
271 status collapsed
272
273 \begin_layout Plain Layout
274
275
276 \backslash
277 Xy
278 \end_layout
279
280 \end_inset
281
282 -Pic more frequently, or if you want to modify your initial figure, you
283  will want to assemble and modify your figures using LyX's math editor.
284  
285 \end_layout
286
287 \begin_layout Standard
288 Once the cursor is moved over a diagram, this is displayed as an array of
289  nodes and arrow-commands.
290  These can be changed interactively.
291  When the cursor leaves the editing area, the diagram reappears.
292  
293 \end_layout
294
295 \begin_layout Standard
296 In the first two sections of this documentation, we explain how to use LyX
297  in the first mentioned mode and we introduce all 
298 \begin_inset ERT
299 status collapsed
300
301 \begin_layout Plain Layout
302
303
304 \backslash
305 Xy
306 \end_layout
307
308 \end_inset
309
310 -Pic features that might be of use for drawing commutative diagrams, graphs
311  or automata.
312  Section 
313 \begin_inset CommandInset ref
314 LatexCommand ref
315 reference "sec:math-editor"
316
317 \end_inset
318
319  explains how to use the 
320 \begin_inset ERT
321 status collapsed
322
323 \begin_layout Plain Layout
324
325
326 \backslash
327 Xy
328 \end_layout
329
330 \end_inset
331
332 -Pic commands inside a math-editing area.
333  
334 \end_layout
335
336 \begin_layout Standard
337 It is not our intention to write another introduction to 
338 \begin_inset ERT
339 status collapsed
340
341 \begin_layout Plain Layout
342
343
344 \backslash
345 Xy
346 \end_layout
347
348 \end_inset
349
350 -Pic, rather our motivation is to give an introduction how the most important
351  commands work inside LyX, since the keystrokes as explained in the 
352 \begin_inset ERT
353 status collapsed
354
355 \begin_layout Plain Layout
356
357
358 \backslash
359 Xy
360 \end_layout
361
362 \end_inset
363
364 -Pic manual
365 \begin_inset CommandInset citation
366 LatexCommand cite
367 key "xypic manual"
368
369 \end_inset
370
371  will not always function correctly inside LyX.
372  
373 \end_layout
374
375 \begin_layout Section
376 Preparation
377 \end_layout
378
379 \begin_layout Standard
380 The following requires that the LaTeX-packages 
381 \family typewriter
382 xypic
383 \family default
384  and 
385 \family typewriter
386 preview
387 \family default
388  are installed in the LaTeX system.
389  They are available from CTAN, see at 
390 \begin_inset CommandInset citation
391 LatexCommand cite
392 key "instant-preview"
393
394 \end_inset
395
396 , resp.
397  at 
398 \begin_inset CommandInset citation
399 LatexCommand cite
400 key "xypic"
401
402 \end_inset
403
404 .
405  After freshly installing them, it may be necessary, to run 
406 \family sans
407 Edit\SpecialChar \menuseparator
408 Reconfigure
409 \family default
410  from the main LyX menu.
411  The steps to a first diagram output in LyX are then:
412 \end_layout
413
414 \begin_layout Enumerate
415 Activate and test 
416 \family typewriter
417 preview
418 \end_layout
419
420 \begin_deeper
421 \begin_layout Enumerate
422 Open LyX, choose 
423 \family sans
424 Edit\SpecialChar \menuseparator
425 Preferences\SpecialChar \menuseparator
426 Look and Feel\SpecialChar \menuseparator
427 Graphics
428 \family default
429  and place a check-mark at 
430 \emph on
431 Instant Preview
432 \emph default
433 .
434  
435 \end_layout
436
437 \begin_layout Enumerate
438 Test, if 
439 \family typewriter
440 instant-preview
441 \family default
442  works by opening a LyX-document and entering any math-formula, e.
443 \begin_inset space \thinspace{}
444 \end_inset
445
446 g.
447  
448 \begin_inset Formula $a+b=c$
449 \end_inset
450
451 .
452  
453 \end_layout
454
455 \begin_layout Enumerate
456 Move the cursor out of the formula, and watch it change its appearance to
457  look just like in the finished DVI- or PostScript document.
458  
459 \end_layout
460
461 \end_deeper
462 \begin_layout Enumerate
463 Activate and test 
464 \begin_inset ERT
465 status collapsed
466
467 \begin_layout Plain Layout
468
469
470 \backslash
471 Xy
472 \end_layout
473
474 \end_inset
475
476 -Pic
477 \family typewriter
478 :
479 \end_layout
480
481 \begin_deeper
482 \begin_layout Enumerate
483 Inside your LyX-Document, enter the text 
484 \family typewriter
485
486 \begin_inset Newline newline
487 \end_inset
488
489
490 \backslash
491 xymatrix{A 
492 \backslash
493 ar[r] & B}
494 \family default
495  .
496 \end_layout
497
498 \begin_layout Enumerate
499 Select the whole text and choose 
500 \family sans
501 Insert\SpecialChar \menuseparator
502 Math\SpecialChar \menuseparator
503 Display Formula
504 \family default
505 , or use the corresponding keyboard shortcut 
506 \family sans
507 Ctrl-M
508 \family default
509 .
510  
511 \end_layout
512
513 \begin_layout Enumerate
514 Move the mouse cursor out of the editing box and wait for a split second
515  to see an arrow appear: 
516 \begin_inset Formula $\xymatrix{A\ar[r] & B}
517 $
518 \end_inset
519
520 .
521  
522 \end_layout
523
524 \end_deeper
525 \begin_layout Section
526 Commutative diagrams
527 \end_layout
528
529 \begin_layout Standard
530 The following diagram, which is taken from the documentation of 
531 \begin_inset ERT
532 status collapsed
533
534 \begin_layout Plain Layout
535
536
537 \backslash
538 Xy
539 \end_layout
540
541 \end_inset
542
543 -Pic
544 \begin_inset CommandInset citation
545 LatexCommand cite
546 key "xypic manual"
547
548 \end_inset
549
550  by its creator Kristoffer H.
551  Rose, will provide an example for many of the features available with that
552  package.
553  Its source code is: 
554 \end_layout
555
556 \begin_layout LyX-Code
557
558 \backslash
559 xymatrix{
560 \begin_inset Newline newline
561 \end_inset
562
563   U     
564 \backslash
565 ar@/_{1pc}/[ddr]_
566 \backslash
567 psi
568 \backslash
569 ar@/^{1pc}/[drr]^
570 \backslash
571 varphi
572 \begin_inset Newline newline
573 \end_inset
574
575
576 \backslash
577 ar@{.>}[dr]|-{(x,y)}
578 \backslash
579
580 \backslash
581
582 \begin_inset Newline newline
583 \end_inset
584
585     & X 
586 \backslash
587 times_Z Y 
588 \backslash
589 ar[d]^q 
590 \backslash
591 ar[r]_p  &  X 
592 \backslash
593 ar[d]_f
594 \backslash
595
596 \backslash
597
598 \begin_inset Newline newline
599 \end_inset
600
601     & Y 
602 \backslash
603 ar[r]^g                      &  Z }
604 \end_layout
605
606 \begin_layout LyX-Code
607
608 \end_layout
609
610 \begin_layout Standard
611 Again, to turn this code into a graphical output, select it all at once
612  starting from the 
613 \family typewriter
614
615 \backslash
616 xymatrix{
617 \family default
618  \SpecialChar \ldots{}
619  up to the closing brace \SpecialChar \ldots{}
620  
621 \family typewriter
622 }
623 \family default
624  and turn it into display-math as explained above.
625  A moment after the cursor leaves the math-area, you should see the diagram
626  in its full graphical glory as shown below.
627  
628 \end_layout
629
630 \begin_layout Standard
631 \begin_inset Formula $\xymatrix{U\ar@/_{1pc}/[ddr]_{\psi}\ar@/{}^{1pc}/[drr]^{\varphi}\ar@{.>}[dr]|-{(x,y)}\\
632  & X\times_{Z}Y\ar[d]^{q}\ar[r]_{p} & X\ar[d]_{f}\\
633  & Y\ar[r]^{g} & Z
634 }
635 $
636 \end_inset
637
638  
639 \end_layout
640
641 \begin_layout Subsection
642 The matrix layout of diagrams
643 \end_layout
644
645 \begin_layout Standard
646
647 \family typewriter
648 xymatrix
649 \family default
650  uses a matrix to define the layout of the vertices of a diagram.
651  For the above example, we need a 
652 \begin_inset Formula $3\times3$
653 \end_inset
654
655 -matrix of which 5 entries are used for the vertices 
656 \begin_inset Formula $U$
657 \end_inset
658
659
660 \begin_inset Formula $X\times_{Z}Y$
661 \end_inset
662
663
664 \begin_inset Formula $X$
665 \end_inset
666
667
668 \begin_inset Formula $Y$
669 \end_inset
670
671
672 \begin_inset Formula $Z$
673 \end_inset
674
675 , the other positions remaining empty.
676  In this case, the following matrix determines the layout:
677 \end_layout
678
679 \begin_layout LyX-Code
680
681 \backslash
682 xymatrix{
683 \begin_inset Newline newline
684 \end_inset
685
686     U                       
687 \backslash
688
689 \backslash
690  
691 \begin_inset Newline newline
692 \end_inset
693
694        & X
695 \backslash
696 times_Z Y   & X  
697 \backslash
698
699 \backslash
700  
701 \begin_inset Newline newline
702 \end_inset
703
704        & Y             & Z    } 
705 \end_layout
706
707 \begin_layout Standard
708 The pattern should be familiar from LaTeX: We see three rows, the first
709  two being terminated by the end-of-line-marker 
710 \family typewriter
711
712 \backslash
713
714 \backslash
715
716 \family default
717  .
718  Each line consists of entries, separated by the ampersand 
719 \family typewriter
720 &
721 \family default
722 .
723  
724 \end_layout
725
726 \begin_layout Subsection
727 Arrows
728 \end_layout
729
730 \begin_layout Standard
731 Having entered the vertices, we add arrows between them.
732  The basic 
733 \family typewriter
734 xypic
735 \family default
736 -command to produce an arrow is 
737 \family typewriter
738
739 \backslash
740 ar
741 \family default
742  , it is entered into the cell of the matrix where the arrow is to start.
743  The target of the arrow is defined by direction commands 
744 \family typewriter
745 u
746 \family default
747  (up) 
748 \family typewriter
749 d
750 \family default
751  (down) 
752 \family typewriter
753 l
754 \family default
755  (left), or 
756 \family typewriter
757 r
758 \family default
759  (right).
760  These can be combined to a path and enclosed in square brackets.
761  As an example, the arrows from the vertex 
762 \begin_inset Formula $U$
763 \end_inset
764
765  in the upper left corner down and right to the vertices 
766 \begin_inset Formula $X\times_{Z}Y$
767 \end_inset
768
769
770 \begin_inset Formula $Y$
771 \end_inset
772
773 , and 
774 \begin_inset Formula $X$
775 \end_inset
776
777  are, respectively, defined as 
778 \family typewriter
779
780 \backslash
781 ar[dr]
782 \family default
783
784 \family typewriter
785
786 \backslash
787 ar[ddr]
788 \family default
789  and 
790 \family typewriter
791
792 \backslash
793 ar[drr]
794 \family default
795 .
796  Thus the above diagram with all arrows added becomes:
797 \end_layout
798
799 \begin_layout LyX-Code
800
801 \backslash
802 xymatrix{
803 \begin_inset Newline newline
804 \end_inset
805
806     U 
807 \backslash
808 ar[ddr] 
809 \backslash
810 ar[drr] 
811 \backslash
812 ar[dr]
813 \backslash
814
815 \backslash
816
817 \begin_inset Newline newline
818 \end_inset
819
820     & X 
821 \backslash
822 times_Z Y 
823 \backslash
824 ar[d] 
825 \backslash
826 ar[r]& X 
827 \backslash
828 ar[d]
829 \backslash
830
831 \backslash
832
833 \begin_inset Newline newline
834 \end_inset
835
836     & Y 
837 \backslash
838 ar[r] & Z }
839 \end_layout
840
841 \begin_layout Standard
842 \begin_inset Formula \xymatrix{ U \ar[ddr] \ar[drr] \ar[dr]\\
843  &  X \times_{Z} Y \ar[d] \ar[r]  &  X \ar[d]\\
844  &  Y \ar[r]  &  Z 
845 }
846
847
848 \end_inset
849
850
851 \end_layout
852
853 \begin_layout LyX-Code
854
855 \end_layout
856
857 \begin_layout LyX-Code
858
859 \end_layout
860
861 \begin_layout Subsection
862 Labels
863 \end_layout
864
865 \begin_layout Standard
866 Labels are attached to arrows by affixing them as upper or lower indices
867  to the 
868 \family typewriter
869
870 \backslash
871 ar
872 \family default
873 -command.
874  Thus, 
875 \family typewriter
876
877 \backslash
878 ar[drr]^
879 \backslash
880 varphi
881 \family default
882  defines an arrow going one cell down, two to the right and having the label
883  
884 \begin_inset Formula $\varphi$
885 \end_inset
886
887  attached above.
888  To attach a label below the arrow, make it a lower index as in 
889 \family typewriter
890
891 \backslash
892 ar[ddr]_
893 \backslash
894 psi
895 \family default
896 .
897  This explanation is correct only for arrows pointing to the right.
898  More precisely, imagine looking along the arrow in the direction it is
899  pointing.
900  Then an upper index places a label to the left and a lower index places
901  it to the right.
902  Consequently, an arrow pointing from right to left, such as 
903 \family typewriter
904
905 \backslash
906 ar[l]^
907 \backslash
908 alpha_
909 \backslash
910 beta
911 \family default
912  will have label 
913 \begin_inset Formula $\alpha$
914 \end_inset
915
916  below and label 
917 \begin_inset Formula $\beta$
918 \end_inset
919
920  above the arrow, i.
921 \begin_inset space \thinspace{}
922 \end_inset
923
924 g.
925 \begin_inset space \space{}
926 \end_inset
927
928
929 \begin_inset Formula $\xymatrix{\  & \ \ar[l]_{\beta}^{\alpha}.}
930 $
931 \end_inset
932
933 Using the character | instead of ^ or _ , it is even possible to place the
934  label right onto the arrow, obscuring part of its shaft.
935  
936 \end_layout
937
938 \begin_layout Standard
939 Normally, a label is placed halfway between an arrow's start and target
940  objects.
941  In the first diagram, the central arrow starting in 
942 \begin_inset Formula $U$
943 \end_inset
944
945  has the label 
946 \begin_inset Formula $(x,y)$
947 \end_inset
948
949  in the middle of the arrow's shaft, rather than in the middle between the
950  two objects it connects.
951  This is achieved by prefixing the label with a minus sign, here: 
952 \family typewriter
953
954 \backslash
955 ar[dr]|-{(x,y)}
956 \family default
957 .
958 \end_layout
959
960 \begin_layout LyX-Code
961
962 \backslash
963 xymatrix{
964 \begin_inset Newline newline
965 \end_inset
966
967     U 
968 \backslash
969 ar[ddr]_
970 \backslash
971 psi 
972 \backslash
973 ar[drr]^
974 \backslash
975 varphi
976 \backslash
977 ar[dr]|-{(x,y)}
978 \backslash
979
980 \backslash
981
982 \begin_inset Newline newline
983 \end_inset
984
985     & X 
986 \backslash
987 times_Z Y 
988 \backslash
989 ar[d]^q 
990 \backslash
991 ar[r]_p& X 
992 \backslash
993 ar[d]_f
994 \backslash
995
996 \backslash
997
998 \begin_inset Newline newline
999 \end_inset
1000
1001     & Y 
1002 \backslash
1003 ar[r]^g & Z }
1004 \end_layout
1005
1006 \begin_layout LyX-Code
1007 \begin_inset Formula \xymatrix{ U \ar[ddr]_{\psi}\ar[drr]^{\varphi}\ar[dr]|-{(x,y)}\\
1008  &  X \times_{Z} Y \ar[d]^{q} \ar[r]_{p}  &  X \ar[d]_{f}\\
1009  &  Y \ar[r]^{g}  &  Z 
1010 }
1011
1012
1013 \end_inset
1014
1015
1016 \end_layout
1017
1018 \begin_layout Standard
1019 \begin_inset ERT
1020 status collapsed
1021
1022 \begin_layout Plain Layout
1023
1024
1025 \backslash
1026 Xy
1027 \end_layout
1028
1029 \end_inset
1030
1031 -pic normally permits labels to be shifted towards the tip or towards the
1032  start of an arrow by prefixing the label with a ratio, such as e.
1033 \begin_inset space \thinspace{}
1034 \end_inset
1035
1036 g.
1037  
1038 \family typewriter
1039 (.3)
1040 \family default
1041 .
1042  In LyX this works only for labels which are placed on top of the arrow,
1043  such as 
1044 \family typewriter
1045
1046 \backslash
1047 ar[r]|(0.3){
1048 \backslash
1049 phi}
1050 \family default
1051 .
1052  
1053 \end_layout
1054
1055 \begin_layout Standard
1056 For labels placed to the left or to the right of the arrow this does not
1057  work.
1058  The corresponding 
1059 \begin_inset ERT
1060 status collapsed
1061
1062 \begin_layout Plain Layout
1063
1064
1065 \backslash
1066 Xy
1067 \end_layout
1068
1069 \end_inset
1070
1071 -pic code such as e.
1072 \begin_inset space \thinspace{}
1073 \end_inset
1074
1075 g.
1076  
1077 \family typewriter
1078
1079 \backslash
1080 ar[r]^(.3)
1081 \backslash
1082 phi
1083 \family default
1084  or 
1085 \family typewriter
1086
1087 \backslash
1088 ar[r]_(.3)
1089 \backslash
1090 psi
1091 \family default
1092  is not correctly interpreted by LyX's math editor.
1093  Two workarounds are suggested in the last section of this note.
1094 \end_layout
1095
1096 \begin_layout Subsection
1097 Arrow modification
1098 \end_layout
1099
1100 \begin_layout Standard
1101 Modification of the design, the form or the positioning of arrows are introduced
1102  by the 
1103 \family typewriter
1104 @
1105 \family default
1106 -character.
1107  This is followed by a pair of matching brackets, where the form of the
1108  bracket pair, 
1109 \family typewriter
1110 { }
1111 \family default
1112  or 
1113 \family typewriter
1114 < >
1115 \family default
1116  or 
1117 \family typewriter
1118 / /
1119 \family default
1120  indicates, whether we want to modify the design, the or the curvature of
1121  the arrow.
1122  Various modifications can be applied to an arrow at the same time.
1123 \end_layout
1124
1125 \begin_layout Subsubsection
1126 Arrow design
1127 \end_layout
1128
1129 \begin_layout Standard
1130 Various designs such as 
1131 \emph on
1132 solid
1133 \emph default
1134
1135 \emph on
1136 dotted
1137 \emph default
1138
1139 \emph on
1140 dashed
1141 \emph default
1142  or 
1143 \emph on
1144 double
1145 \emph default
1146  are possible for the shaft of an arrow.
1147  These can be combined with various ends and various tips.
1148  In general, the design of an arrow is described by following the command
1149  
1150 \family typewriter
1151
1152 \backslash
1153 ar
1154 \family default
1155  immediately by an 
1156 \family typewriter
1157 @
1158 \family default
1159 -sign and a pair of braces {\SpecialChar \ldots{}
1160 } containing characters describing the end,
1161  the shaft and the tip of the arrow.
1162  These characters are chosen to give some form of ASCII-rendering of the
1163  real thing.
1164  For instance 
1165 \family typewriter
1166
1167 \backslash
1168 ar@{>..>>}
1169 \family default
1170  produces an arrow with split end, a dotted shaft and double head.
1171  A number of other arrow designs is given in the table below.
1172  Note that the ends of embedding arrows 
1173 \begin_inset Formula $\xymatrix{A\ar@{^{(}->}[r] & B}
1174 $
1175 \end_inset
1176
1177  are described by raising or lowering opening parentheses, such as in 
1178 \family typewriter
1179
1180 \backslash
1181 ar@{^(->}[r].
1182 \begin_inset Newline newline
1183 \end_inset
1184
1185
1186 \end_layout
1187
1188 \begin_layout Standard
1189 \begin_inset Tabular
1190 <lyxtabular version="3" rows="11" columns="2">
1191 <features islongtable="true" longtabularalignment="center">
1192 <column alignment="center" valignment="top" width="0">
1193 <column alignment="center" valignment="top" width="0">
1194 <row>
1195 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1196 \begin_inset Text
1197
1198 \begin_layout Plain Layout
1199 Result
1200 \end_layout
1201
1202 \end_inset
1203 </cell>
1204 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1205 \begin_inset Text
1206
1207 \begin_layout Plain Layout
1208 Source code in LyX
1209 \end_layout
1210
1211 \end_inset
1212 </cell>
1213 </row>
1214 <row>
1215 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1216 \begin_inset Text
1217
1218 \begin_layout Plain Layout
1219 \begin_inset Formula \xymatrix{\ \ar[r]  &  \ }
1220
1221
1222 \end_inset
1223
1224
1225 \end_layout
1226
1227 \end_inset
1228 </cell>
1229 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1230 \begin_inset Text
1231
1232 \begin_layout Plain Layout
1233
1234 \family typewriter
1235
1236 \backslash
1237 ar 
1238 \end_layout
1239
1240 \end_inset
1241 </cell>
1242 </row>
1243 <row>
1244 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1245 \begin_inset Text
1246
1247 \begin_layout Plain Layout
1248 \begin_inset Formula \xymatrix{\ \ar@{-->}[r]  &  \ }
1249
1250
1251 \end_inset
1252
1253
1254 \end_layout
1255
1256 \end_inset
1257 </cell>
1258 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1259 \begin_inset Text
1260
1261 \begin_layout Plain Layout
1262
1263 \family typewriter
1264
1265 \backslash
1266 ar@{-->}
1267 \end_layout
1268
1269 \end_inset
1270 </cell>
1271 </row>
1272 <row>
1273 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1274 \begin_inset Text
1275
1276 \begin_layout Plain Layout
1277 \begin_inset Formula \xymatrix{\ \ar@{..>}[r]  &  \ }
1278
1279
1280 \end_inset
1281
1282
1283 \end_layout
1284
1285 \end_inset
1286 </cell>
1287 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1288 \begin_inset Text
1289
1290 \begin_layout Plain Layout
1291
1292 \family typewriter
1293
1294 \backslash
1295 ar@{..>}
1296 \end_layout
1297
1298 \end_inset
1299 </cell>
1300 </row>
1301 <row>
1302 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1303 \begin_inset Text
1304
1305 \begin_layout Plain Layout
1306 \begin_inset Formula \xymatrix{\ \ar@{~>}[r]  &  \ }
1307
1308
1309 \end_inset
1310
1311
1312 \end_layout
1313
1314 \end_inset
1315 </cell>
1316 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1317 \begin_inset Text
1318
1319 \begin_layout Plain Layout
1320
1321 \family typewriter
1322
1323 \backslash
1324 ar@{~>}
1325 \end_layout
1326
1327 \end_inset
1328 </cell>
1329 </row>
1330 <row>
1331 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1332 \begin_inset Text
1333
1334 \begin_layout Plain Layout
1335 \begin_inset Formula \xymatrix{\ \ar@{->>}[r]  &  \ }
1336
1337
1338 \end_inset
1339
1340
1341 \end_layout
1342
1343 \end_inset
1344 </cell>
1345 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1346 \begin_inset Text
1347
1348 \begin_layout Plain Layout
1349
1350 \family typewriter
1351
1352 \backslash
1353 ar@{->>}
1354 \end_layout
1355
1356 \end_inset
1357 </cell>
1358 </row>
1359 <row>
1360 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1361 \begin_inset Text
1362
1363 \begin_layout Plain Layout
1364 \begin_inset Formula \xymatrix{\ \ar@{-->>}[r]  &  \ }
1365
1366
1367 \end_inset
1368
1369
1370 \end_layout
1371
1372 \end_inset
1373 </cell>
1374 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1375 \begin_inset Text
1376
1377 \begin_layout Plain Layout
1378
1379 \family typewriter
1380
1381 \backslash
1382 ar@{-->>}
1383 \end_layout
1384
1385 \end_inset
1386 </cell>
1387 </row>
1388 <row>
1389 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1390 \begin_inset Text
1391
1392 \begin_layout Plain Layout
1393 \begin_inset Formula \xymatrix{\ \ar@{>->>}[r]  &  \ }
1394
1395
1396 \end_inset
1397
1398
1399 \end_layout
1400
1401 \end_inset
1402 </cell>
1403 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1404 \begin_inset Text
1405
1406 \begin_layout Plain Layout
1407
1408 \family typewriter
1409
1410 \backslash
1411 ar@{>->>}
1412 \end_layout
1413
1414 \end_inset
1415 </cell>
1416 </row>
1417 <row>
1418 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1419 \begin_inset Text
1420
1421 \begin_layout Plain Layout
1422 \begin_inset Formula \xymatrix{\ \ar@{_{(}->}[r]  &  \ }
1423
1424
1425 \end_inset
1426
1427
1428 \end_layout
1429
1430 \end_inset
1431 </cell>
1432 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1433 \begin_inset Text
1434
1435 \begin_layout Plain Layout
1436
1437 \family typewriter
1438
1439 \backslash
1440 ar@{_(->}
1441 \end_layout
1442
1443 \end_inset
1444 </cell>
1445 </row>
1446 <row>
1447 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1448 \begin_inset Text
1449
1450 \begin_layout Plain Layout
1451 \begin_inset Formula \xymatrix{\ \ar@{^{(}->}[r]  &  \ }
1452
1453
1454 \end_inset
1455
1456
1457 \end_layout
1458
1459 \end_inset
1460 </cell>
1461 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1462 \begin_inset Text
1463
1464 \begin_layout Plain Layout
1465
1466 \family typewriter
1467
1468 \backslash
1469 ar@{^(->}
1470 \end_layout
1471
1472 \end_inset
1473 </cell>
1474 </row>
1475 <row>
1476 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1477 \begin_inset Text
1478
1479 \begin_layout Plain Layout
1480 \begin_inset Formula \xymatrix{\ \ar@{|-|}[r]  &  \ }
1481
1482
1483 \end_inset
1484
1485
1486 \end_layout
1487
1488 \end_inset
1489 </cell>
1490 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1491 \begin_inset Text
1492
1493 \begin_layout Plain Layout
1494
1495 \family typewriter
1496
1497 \backslash
1498 ar@{|-|}
1499 \end_layout
1500
1501 \end_inset
1502 </cell>
1503 </row>
1504 </lyxtabular>
1505
1506 \end_inset
1507
1508
1509 \end_layout
1510
1511 \begin_layout Standard
1512 \noindent
1513 Following the @-character by either a 2, 3, _,or a ^, we can produce arrows
1514  with double, triple shaft or arrows showing only the lower or upper half
1515  of their tips and ends.
1516  Arrows need not have tips nor ends, as the last example shows :
1517 \begin_inset Newline newline
1518 \end_inset
1519
1520
1521 \end_layout
1522
1523 \begin_layout Standard
1524 \begin_inset Tabular
1525 <lyxtabular version="3" rows="8" columns="2">
1526 <features islongtable="true" longtabularalignment="center">
1527 <column alignment="center" valignment="top" width="0">
1528 <column alignment="center" valignment="top" width="0">
1529 <row>
1530 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1531 \begin_inset Text
1532
1533 \begin_layout Plain Layout
1534 Result
1535 \end_layout
1536
1537 \end_inset
1538 </cell>
1539 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1540 \begin_inset Text
1541
1542 \begin_layout Plain Layout
1543 Source code for LyX
1544 \end_layout
1545
1546 \end_inset
1547 </cell>
1548 </row>
1549 <row>
1550 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1551 \begin_inset Text
1552
1553 \begin_layout Plain Layout
1554 \begin_inset Formula \xymatrix{\ \ar@2[r]  &  \ }
1555
1556
1557 \end_inset
1558
1559
1560 \end_layout
1561
1562 \end_inset
1563 </cell>
1564 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1565 \begin_inset Text
1566
1567 \begin_layout Plain Layout
1568
1569 \family typewriter
1570
1571 \backslash
1572 ar@2
1573 \end_layout
1574
1575 \end_inset
1576 </cell>
1577 </row>
1578 <row>
1579 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1580 \begin_inset Text
1581
1582 \begin_layout Plain Layout
1583 \begin_inset Formula \xymatrix{\ \ar@3[r]  &  \ }
1584
1585
1586 \end_inset
1587
1588
1589 \end_layout
1590
1591 \end_inset
1592 </cell>
1593 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1594 \begin_inset Text
1595
1596 \begin_layout Plain Layout
1597
1598 \family typewriter
1599
1600 \backslash
1601 ar@3
1602 \end_layout
1603
1604 \end_inset
1605 </cell>
1606 </row>
1607 <row>
1608 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1609 \begin_inset Text
1610
1611 \begin_layout Plain Layout
1612 \begin_inset Formula \xymatrix{\ \ar@_{->}[r]  &  \ }
1613
1614
1615 \end_inset
1616
1617
1618 \end_layout
1619
1620 \end_inset
1621 </cell>
1622 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1623 \begin_inset Text
1624
1625 \begin_layout Plain Layout
1626
1627 \family typewriter
1628
1629 \backslash
1630 ar@_{->}
1631 \end_layout
1632
1633 \end_inset
1634 </cell>
1635 </row>
1636 <row>
1637 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1638 \begin_inset Text
1639
1640 \begin_layout Plain Layout
1641 \begin_inset Formula \xymatrix{\ \ar@^{->}[r]  &  \ }
1642
1643
1644 \end_inset
1645
1646
1647 \end_layout
1648
1649 \end_inset
1650 </cell>
1651 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1652 \begin_inset Text
1653
1654 \begin_layout Plain Layout
1655
1656 \family typewriter
1657
1658 \backslash
1659 ar@^{->}
1660 \end_layout
1661
1662 \end_inset
1663 </cell>
1664 </row>
1665 <row>
1666 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1667 \begin_inset Text
1668
1669 \begin_layout Plain Layout
1670 \begin_inset Formula \xymatrix{\ \ar@^{>>->>}[r]  &  \ }
1671
1672
1673 \end_inset
1674
1675
1676 \end_layout
1677
1678 \end_inset
1679 </cell>
1680 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1681 \begin_inset Text
1682
1683 \begin_layout Plain Layout
1684
1685 \family typewriter
1686
1687 \backslash
1688 ar@^{>>->>}
1689 \end_layout
1690
1691 \end_inset
1692 </cell>
1693 </row>
1694 <row>
1695 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1696 \begin_inset Text
1697
1698 \begin_layout Plain Layout
1699 \begin_inset Formula \xymatrix{\ \ar@{^{<}-_{>}}[r]  &  \ }
1700
1701
1702 \end_inset
1703
1704
1705 \end_layout
1706
1707 \end_inset
1708 </cell>
1709 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1710 \begin_inset Text
1711
1712 \begin_layout Plain Layout
1713
1714 \family typewriter
1715
1716 \backslash
1717 ar@{^<-_>}
1718 \end_layout
1719
1720 \end_inset
1721 </cell>
1722 </row>
1723 <row>
1724 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1725 \begin_inset Text
1726
1727 \begin_layout Plain Layout
1728 \begin_inset Formula \xymatrix{\ \ar@2{--}[r]  &  \ }
1729
1730
1731 \end_inset
1732
1733
1734 \end_layout
1735
1736 \end_inset
1737 </cell>
1738 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1739 \begin_inset Text
1740
1741 \begin_layout Plain Layout
1742
1743 \family typewriter
1744
1745 \backslash
1746 ar@2{--}
1747 \end_layout
1748
1749 \end_inset
1750 </cell>
1751 </row>
1752 </lyxtabular>
1753
1754 \end_inset
1755
1756
1757 \end_layout
1758
1759 \begin_layout Subsubsection
1760 Designing your own arrows
1761 \end_layout
1762
1763 \begin_layout Standard
1764 Within certain limits there is even a way to design your own arrows.
1765  Using some the characters 
1766 \family typewriter
1767 ><|ox+/()[
1768 \family default
1769  one can even design one's own arrow tips using the 
1770 \family typewriter
1771
1772 \backslash
1773 newdir
1774 \family default
1775  command in the preamble.
1776  For explanations, we refer to the 
1777 \family typewriter
1778
1779 \begin_inset ERT
1780 status collapsed
1781
1782 \begin_layout Plain Layout
1783
1784
1785 \backslash
1786 Xy
1787 \end_layout
1788
1789 \end_inset
1790
1791
1792 \family default
1793 -manual, from which we take the example: 
1794 \end_layout
1795
1796 \begin_layout Standard
1797
1798 \family typewriter
1799
1800 \backslash
1801 newdir{|>}{!/4.5pt/@{|}*:(1,-.2)@^{>}*:(1,+.2)@_{>}}
1802 \family default
1803 .
1804 \end_layout
1805
1806 \begin_layout Standard
1807 \noindent
1808 This defines a new arrow tip, referred to as 
1809 \family typewriter
1810 |>
1811 \family default
1812  in 
1813 \family typewriter
1814
1815 \backslash
1816 ar@{-|>}[r]
1817 \family default
1818  and which displays correctly in LyX as:
1819 \begin_inset Formula \[
1820 \xymatrix{A\ar@{-|>}[r] & \ \ B}
1821 \]
1822
1823 \end_inset
1824
1825
1826 \end_layout
1827
1828 \begin_layout Subsection
1829 Arrow positioning
1830 \end_layout
1831
1832 \begin_layout Standard
1833 Arrows are shifted sideways with the modifier 
1834 \family typewriter
1835 @<
1836 \family default
1837
1838 \begin_inset Formula $\ldots$
1839 \end_inset
1840
1841  
1842 \family typewriter
1843 >
1844 \family default
1845  where the ellipsis is replaced by a positive or negative measure.
1846  For instance, to design a pair of mutually opposing arrows between two
1847  nodes, we shift them to see them apart.
1848  Note that the direction of the shift (positive) is to the left if one looks
1849  along the arrow.
1850  Thus
1851 \end_layout
1852
1853 \begin_layout Standard
1854
1855 \family typewriter
1856
1857 \backslash
1858 xymatrix{
1859 \backslash
1860 circ 
1861 \backslash
1862 ar@<1ex>[r]& 
1863 \backslash
1864 circ 
1865 \backslash
1866 ar@<1ex>[l]}
1867 \end_layout
1868
1869 \begin_layout Standard
1870 \noindent
1871 produces
1872 \begin_inset space ~
1873 \end_inset
1874
1875
1876 \begin_inset space ~
1877 \end_inset
1878
1879
1880 \begin_inset Formula \[
1881 \xymatrix{\circ\ar@<1ex>[r] & \circ\ar@<1ex>[l]}
1882 \]
1883  
1884
1885 \end_inset
1886
1887
1888 \end_layout
1889
1890 \begin_layout Subsubsection
1891 Inline or centered diagrams
1892 \end_layout
1893
1894 \begin_layout Standard
1895 Arrows and diagrams can be used inline, such as this one: 
1896 \begin_inset Formula $\xymatrix{\circ\ar@<1ex>[r] & \circ\ar@<1ex>[l]}
1897 $
1898 \end_inset
1899
1900 .
1901  When their code is written inside LyX as above, select it and choose either
1902  
1903 \family sans
1904 Ctrl-m
1905 \family default
1906  for inline appearance or 
1907 \family sans
1908 Ctrl-M
1909 \family default
1910  for displaystyle.
1911  Diagrams constructed inline can later be centered, or, conversely, centered
1912  diagrams can be changed to inline formulas with 
1913 \family sans
1914 Edit\SpecialChar \menuseparator
1915 Math
1916 \family default
1917  
1918 \family sans
1919 \SpecialChar \menuseparator
1920 Alignment.
1921 \end_layout
1922
1923 \begin_layout Subsection
1924 Bending arrows
1925 \end_layout
1926
1927 \begin_layout Standard
1928 There are two simple methods to make arrows bend.
1929  The first is giving an explicit value by which the midpoint of the arrow's
1930  shaft is raised or depressed, the other is by forcing the arrow to leave
1931  its origin in a prescribed compass direction and to make him enter the
1932  target at another direction.
1933  The necessary bending of the arrow is determined automatically.
1934  We describe both methods.
1935 \end_layout
1936
1937 \begin_layout Subsubsection
1938 Raising the shaft
1939 \end_layout
1940
1941 \begin_layout Standard
1942 For bending arrows we use the modifier @/
1943 \begin_inset Formula $\ldots$
1944 \end_inset
1945
1946 / .
1947  The ellipsis stands for a TeX-measure which needs to be entered as a lower
1948  or upper index.
1949  Whereas in 
1950 \family typewriter
1951 xypic
1952 \family default
1953 , we could simply write, e.
1954 \begin_inset space \thinspace{}
1955 \end_inset
1956
1957 g.
1958  
1959 \family typewriter
1960
1961 \backslash
1962 ar@/_1pc/
1963 \family default
1964  for an arrow bending 
1965 \family typewriter
1966 1pc
1967 \family default
1968  downwards, this cannot directly be done in LyX.
1969  It is necessary, to enclose the measure in a pair of braces, such as e.
1970 \begin_inset space \thinspace{}
1971 \end_inset
1972
1973 g.
1974  
1975 \family typewriter
1976
1977 \backslash
1978 ar@/_{1pc}/
1979 \family default
1980 .
1981  As an example, here are two opposing arrows between 
1982 \begin_inset Formula $A$
1983 \end_inset
1984
1985  and 
1986 \begin_inset Formula $B$
1987 \end_inset
1988
1989 , each bending by .5 pica, given by the following source code: 
1990 \end_layout
1991
1992 \begin_layout Standard
1993
1994 \family typewriter
1995
1996 \backslash
1997 xymatrix{A 
1998 \backslash
1999 ar@/_{.5pc}/[r] & B 
2000 \backslash
2001 ar@/_{.5pc}/[l]}
2002 \end_layout
2003
2004 \begin_layout Standard
2005 \begin_inset Formula \[
2006 \xymatrix{A\ar@/{}_{.5pc}/[r] & B\ar@/{}_{.5pc}/[l]}
2007 \]
2008
2009 \end_inset
2010
2011
2012 \end_layout
2013
2014 \begin_layout Subsubsection
2015 Specifying exit- and entrance directions
2016 \end_layout
2017
2018 \begin_layout Standard
2019 An alternative for making arrows bend is by specifying their compass direction
2020  as they are leaving their source and their direction from which they enter
2021  their target.
2022  Instead of north, north-east, east, etc., the directions are named 
2023 \family typewriter
2024 u
2025 \family default
2026
2027 \family typewriter
2028 ur
2029 \family default
2030
2031 \family typewriter
2032 r
2033 \family default
2034
2035 \family typewriter
2036 dr
2037 \family default
2038
2039 \family typewriter
2040 d
2041 \family default
2042
2043 \family typewriter
2044 dl
2045 \family default
2046
2047 \family typewriter
2048 l
2049 \family default
2050
2051 \family typewriter
2052 ul
2053 \family default
2054 , standing for up, up-right, right, down-right, etc..
2055  A direction is specified as @(
2056 \emph on
2057 out
2058 \emph default
2059 ,
2060 \emph on
2061 in
2062 \emph default
2063 ) where 
2064 \emph on
2065 out
2066 \emph default
2067  stands for the direction the first object is left and 
2068 \emph on
2069 in
2070 \emph default
2071  stands for the direction from which the target is entered.
2072  As an example, we show some bending arrows and a loop, which arises when
2073  we do not specify a target for an arrow, just its incoming and outgoing
2074  direction:
2075 \end_layout
2076
2077 \begin_layout Standard
2078 \begin_inset Formula \[
2079 \xymatrix{A\ar@(dr,dl)[r]\ar@(dr,dl)[rr] & B\ar@(d,r)[dl] & C\\
2080 E\ar@(ul,ur)
2081 }
2082 \]
2083
2084 \end_inset
2085
2086
2087 \end_layout
2088
2089 \begin_layout LyX-Code
2090
2091 \backslash
2092 xymatrix{A 
2093 \backslash
2094 ar@(dr,dl)[r]
2095 \backslash
2096 ar@(dr,dl)[rr] 
2097 \begin_inset Newline newline
2098 \end_inset
2099
2100                     &B
2101 \backslash
2102 ar@(d,r)[dl]  &C 
2103 \backslash
2104
2105 \backslash
2106  
2107 \begin_inset Newline newline
2108 \end_inset
2109
2110             E 
2111 \backslash
2112 ar@(ul,ur)}
2113 \end_layout
2114
2115 \begin_layout Subsection
2116 Modifying vertices
2117 \end_layout
2118
2119 \begin_layout Standard
2120 The above example is reminiscent of an automata diagram, except that in
2121  such a diagram states would be enclosed in small circles, with double circles
2122  denoting final states.
2123  
2124 \end_layout
2125
2126 \begin_layout Subsubsection
2127 Framing objects
2128 \end_layout
2129
2130 \begin_layout Standard
2131 With 
2132 \begin_inset ERT
2133 status collapsed
2134
2135 \begin_layout Plain Layout
2136
2137
2138 \backslash
2139 Xy
2140 \end_layout
2141
2142 \end_inset
2143
2144 -Pic, entries can obtain a single or a double frame, such as 
2145 \begin_inset Formula $\xymatrix{*+[F]{A}}
2146 $
2147 \end_inset
2148
2149  or 
2150 \begin_inset Formula $\xymatrix{*+[F=]{B}}
2151 $
2152 \end_inset
2153
2154  by prefixing an entry with 
2155 \family typewriter
2156 *[F-]
2157 \family default
2158  or 
2159 \family typewriter
2160 *[F=]
2161 \family default
2162  and enclosing the portion of the entry to be framed in braces.
2163  Normally, the frame will be very tight so that it must be widened by prefixing
2164  with 
2165 \family typewriter
2166 +
2167 \family default
2168  or with 
2169 \family typewriter
2170 ++
2171 \family default
2172 .
2173  Round frames, such as 
2174 \begin_inset Formula $\xymatrix{*++[o][F]{A}}
2175 $
2176 \end_inset
2177
2178  and 
2179 \begin_inset Formula $\xymatrix{*++[o][F=]{B}}
2180 $
2181 \end_inset
2182
2183  are obtained by specifying the shape as 
2184 \family typewriter
2185 [o].
2186
2187 \family default
2188  So the latter figure was constructed as *++[o][F=]{B}.
2189  This way, the following automaton 
2190 \end_layout
2191
2192 \begin_layout Standard
2193 \begin_inset Formula \[
2194 \xymatrix{\txt{start}\ar[r] & *++[o][F]{1}\ar[r] & *++[o][F=]{2}\ar@(ur,dr)\ar@(ur,ul)[l]}
2195 \]
2196
2197 \end_inset
2198
2199
2200 \end_layout
2201
2202 \begin_layout Standard
2203 \noindent
2204 can be typeset as
2205 \end_layout
2206
2207 \begin_layout LyX-Code
2208
2209 \backslash
2210 xymatrix{
2211 \backslash
2212 txt{start}
2213 \backslash
2214 ar[r]
2215 \end_layout
2216
2217 \begin_layout LyX-Code
2218             & *++[o][F]{1}
2219 \backslash
2220 ar[r]
2221 \end_layout
2222
2223 \begin_layout LyX-Code
2224             & *++[o][F=]{2}
2225 \backslash
2226 ar@(ur,dr)
2227 \backslash
2228 ar@(ur,ul)[l]
2229 \end_layout
2230
2231 \begin_layout LyX-Code
2232            }.
2233 \end_layout
2234
2235 \begin_layout Standard
2236 The LaTeX command 
2237 \family typewriter
2238
2239 \backslash
2240 entrymodifiers={
2241 \family default
2242 \SpecialChar \ldots{}
2243
2244 \family typewriter
2245 }
2246 \family default
2247  will make a certain entry style the default, that can, of course be overridden
2248  for individual entries.
2249  Thus, after 
2250 \family typewriter
2251
2252 \backslash
2253 entrymodifiers={++[o][F-]}
2254 \family default
2255 , all following entries inside 
2256 \begin_inset ERT
2257 status collapsed
2258
2259 \begin_layout Plain Layout
2260
2261
2262 \backslash
2263 Xy
2264 \end_layout
2265
2266 \end_inset
2267
2268 -matrices would be encircled.
2269 \end_layout
2270
2271 \begin_layout Subsubsection
2272 Framing rectangles
2273 \end_layout
2274
2275 \begin_layout Standard
2276 Framing a whole rectangle inside an xymatrix is done with the macro pair
2277  
2278 \family typewriter
2279
2280 \backslash
2281 save ...
2282  
2283 \backslash
2284 restore
2285 \family default
2286 .
2287  
2288 \family roman
2289 \series medium
2290 \shape up
2291 \size normal
2292 \emph off
2293 \bar no
2294 \noun off
2295 \color none
2296 The dimension of the rectangle is given as a dotted pair 
2297 \begin_inset Formula $P_{0}.P_{1}$
2298 \end_inset
2299
2300  of points denoting the top left and lower right corners of the rectangle.
2301  Each point, in turn,is given as a doubly quoted comma separated pair 
2302 \begin_inset Quotes eld
2303 \end_inset
2304
2305
2306 \begin_inset Formula $x,y$
2307 \end_inset
2308
2309
2310 \begin_inset Quotes erd
2311 \end_inset
2312
2313  specifying row 
2314 \begin_inset Formula $x$
2315 \end_inset
2316
2317  and column 
2318 \begin_inset Formula $y$
2319 \end_inset
2320
2321 .
2322  These are followed by the framing commands, to produce figures such as
2323  the following: 
2324 \begin_inset Formula \[
2325 \xymatrix{A & B\ar@(d,r)[dl]\sp(0.2)\phi\sp(0.7)\psi\save"1,1"."2,1"*+[F=]\frm{}\restore\,\\
2326 C & \save"1,1"."1,2"*++[F]\frm{}\restore
2327 }
2328 \]
2329
2330 \end_inset
2331
2332  Here, the code 
2333 \family typewriter
2334 \series default
2335 \shape default
2336 \size default
2337 \emph default
2338 \bar default
2339 \noun default
2340 \color inherit
2341
2342 \backslash
2343 save"1,1"."2,1"*+[F=]
2344 \backslash
2345 frm{}
2346 \backslash
2347 restore
2348 \family roman
2349 \series medium
2350 \shape up
2351 \size normal
2352 \emph off
2353 \bar no
2354 \noun off
2355 \color none
2356  produces the doubly framed rectangle, and the code for the extra wide horizonta
2357 l rectangle is 
2358 \family typewriter
2359 \series default
2360 \shape default
2361 \size default
2362 \emph default
2363 \bar default
2364 \noun default
2365 \color inherit
2366
2367 \backslash
2368 save"1,1"."1,2"*++[F]
2369 \backslash
2370 frm{}
2371 \backslash
2372 restore
2373 \family roman
2374 \series medium
2375 \shape up
2376 \size normal
2377 \emph off
2378 \bar no
2379 \noun off
2380 \color none
2381 .
2382  This code can be placed in arbitrary cells of the xymatrix.
2383  
2384 \end_layout
2385
2386 \begin_layout Section
2387 Using LyX's math editor
2388 \begin_inset CommandInset label
2389 LatexCommand label
2390 name "sec:math-editor"
2391
2392 \end_inset
2393
2394
2395 \end_layout
2396
2397 \begin_layout Standard
2398 As an alternative to writing the 
2399 \family typewriter
2400 xypic
2401 \family default
2402  code, then transforming it into a math-editing environment by marking it
2403  and applying 
2404 \family sans
2405 Ctrl-m
2406 \family default
2407 , or 
2408 \family sans
2409 Ctrl-M
2410 \family default
2411 , one may construct and modify the whole xypic-diagram inside LyX's math
2412  editor.
2413  We describe the editing steps for a figure just like the one above.
2414  
2415 \end_layout
2416
2417 \begin_layout Subsection
2418 Caveat - how to enter braces
2419 \end_layout
2420
2421 \begin_layout Standard
2422 Recall that in LyX's math-editor any pair of braces 
2423 \family typewriter
2424 {
2425 \family default
2426  and 
2427 \family typewriter
2428 }
2429 \family default
2430  that are to enclose a macro-parameter must be entered by typing just 
2431 \family typewriter
2432
2433 \backslash
2434 {
2435 \family default
2436  .
2437  The closing brace is automatically supplied and in between a box into which
2438  to the parameter is entered.
2439  In connection with 
2440 \begin_inset ERT
2441 status collapsed
2442
2443 \begin_layout Plain Layout
2444
2445
2446 \backslash
2447 Xy
2448 \end_layout
2449
2450 \end_inset
2451
2452 -diagrams, this applies in particular to arrow modifications that are normally
2453  given in the form 
2454 \family typewriter
2455 @{
2456 \family default
2457  \SpecialChar \ldots{}
2458  
2459 \family typewriter
2460 }
2461 \family default
2462  with the ellipsis standing for the description of end, shaft and tip of
2463  the arrow.
2464  Inside the math-editor, enter just 
2465 \family typewriter
2466 @
2467 \backslash
2468 {
2469 \family default
2470  and let LyX provide the closing brace and the box into which to enter the
2471  description of the arrow.
2472 \end_layout
2473
2474 \begin_layout Standard
2475 Braces that are entered without the backslash 
2476 \family typewriter
2477
2478 \backslash
2479
2480 \family default
2481  will just appear as typed, but cannot be used to receive a macro parameter.
2482  They are useful, for instance to denote sets, e.
2483 \begin_inset space \thinspace{}
2484 \end_inset
2485
2486 g.
2487  
2488 \family typewriter
2489 {x
2490 \backslash
2491 in X 
2492 \backslash
2493 mid x
2494 \backslash
2495 notin x}
2496 \family default
2497  will display as 
2498 \begin_inset Formula $\{x\in X\mid x\notin x\}$
2499 \end_inset
2500
2501 .
2502 \end_layout
2503
2504 \begin_layout Subsection
2505 Setting up the matrix
2506 \end_layout
2507
2508 \begin_layout Standard
2509 With 
2510 \family sans
2511 Ctrl-m
2512 \family default
2513  or 
2514 \family sans
2515 Ctrl-M
2516 \family default
2517  open a formula environment and enter: 
2518 \family typewriter
2519
2520 \backslash
2521 xymatrix
2522 \family default
2523 .
2524  This produces a 1
2525 \begin_inset Formula $\times$
2526 \end_inset
2527
2528 1- 
2529 \begin_inset ERT
2530 status collapsed
2531
2532 \begin_layout Plain Layout
2533
2534
2535 \backslash
2536 Xy
2537 \end_layout
2538
2539 \end_inset
2540
2541 -matrix.
2542  Add extra rows by typing 
2543 \family sans
2544 Ctrl-Enter
2545 \family default
2546  and add columns by typing 
2547 \family sans
2548 Alt-m c i.
2549  
2550 \end_layout
2551
2552 \begin_layout Standard
2553 At any time, further rows or columns can be entered or deleted using commands
2554  available from 
2555 \family sans
2556 Edit\SpecialChar \menuseparator
2557 Math,
2558 \family default
2559  resp.
2560  their shortcuts, beginning with 
2561 \family sans
2562 Alt-m c
2563 \family default
2564  for the column commands or 
2565 \family sans
2566 Alt-m w
2567 \family default
2568  for the row commands.
2569  
2570 \end_layout
2571
2572 \begin_layout Subsection
2573 Entering nodes, arrows and labels
2574 \end_layout
2575
2576 \begin_layout Standard
2577 Type the nodes into the correct positions of the matrix.
2578  If you move the cursor out of the matrix, you should see a first rendering
2579  of the node layout.
2580  Next, add the arrows at the nodes from where they should emanate by typing
2581  
2582 \family typewriter
2583
2584 \backslash
2585 ar[
2586 \family default
2587 \emph on
2588 p
2589 \family typewriter
2590 \emph default
2591 ]
2592 \family default
2593 , where 
2594 \emph on
2595 p
2596 \emph default
2597  can be any path made up from the characters 
2598 \family typewriter
2599 u
2600 \family default
2601
2602 \family typewriter
2603 d
2604 \family default
2605
2606 \family typewriter
2607 l
2608 \family default
2609
2610 \family typewriter
2611 r
2612 \family default
2613 .
2614  Make sure that the path indeed leads to an existing node within the matrix.
2615  Otherwise, the figure will not display when the cursor leaves the editing
2616  area.
2617 \end_layout
2618
2619 \begin_layout Standard
2620 Next, label the arrows by attaching a label text as upper or lower indices
2621  to the end of the arrow's path.
2622  As always in LyX's math editor, an underscore 
2623 \family typewriter
2624 _
2625 \family default
2626  opens a box for a lower index and a 
2627 \family typewriter
2628 ^
2629 \family default
2630  followed by a space opens a box for an upper index.
2631  You can enter any LaTeX-code as a label.
2632 \end_layout
2633
2634 \begin_layout Subsection
2635 Modifying arrows
2636 \end_layout
2637
2638 \begin_layout Standard
2639 Finally, you can modify the appearance of the arrows by entering @-modifiers
2640  
2641 \family typewriter
2642 @{
2643 \family default
2644 \SpecialChar \ldots{}
2645
2646 \family typewriter
2647 }
2648 \family default
2649
2650 \family typewriter
2651 @<
2652 \family default
2653 \SpecialChar \ldots{}
2654 >, 
2655 \family typewriter
2656 @(
2657 \family default
2658 \SpecialChar \ldots{}
2659 ,\SpecialChar \ldots{}
2660 ) or 
2661 \family typewriter
2662 @/
2663 \family default
2664 \SpecialChar \ldots{}
2665
2666 \family typewriter
2667 /
2668 \family default
2669 .
2670  The above caveat applies to the first form only.
2671  It must be entered as 
2672 \family typewriter
2673 @
2674 \backslash
2675 {
2676 \family default
2677  with the arrow description entered inside the LyX-supplied box.
2678  If this box remains empty, you have specified an empty arrow.
2679  This is a useful construction, too, as you will see in the next section.
2680  
2681 \end_layout
2682
2683 \begin_layout Standard
2684 The other modifiers, 
2685 \family typewriter
2686 @<
2687 \family default
2688 \SpecialChar \ldots{}
2689
2690 \family typewriter
2691 >
2692 \family default
2693
2694 \family typewriter
2695 @(
2696 \family default
2697 \SpecialChar \ldots{}
2698 ,\SpecialChar \ldots{}
2699
2700 \family typewriter
2701
2702 \family default
2703 and 
2704 \family typewriter
2705 @/
2706 \family default
2707 \SpecialChar \ldots{}
2708
2709 \family typewriter
2710
2711 \family default
2712 are typed as shown with the arrow description replacing the ellipsis.
2713  The code for bending arrows, which in 
2714 \family typewriter
2715 xypic
2716 \family default
2717  is 
2718 \family typewriter
2719 @/_
2720 \family default
2721 \emph on
2722 measure
2723 \family typewriter
2724 \emph default
2725
2726 \family default
2727 or 
2728 \family typewriter
2729 @/
2730 \emph on
2731 ^
2732 \family default
2733 measure
2734 \family typewriter
2735 \emph default
2736
2737 \family default
2738 where 
2739 \emph on
2740 measure
2741 \emph default
2742  is any valid TeX-measure that should be entered as upper or lower index
2743  to the first slash /.
2744  Make sure that the ending slash does not end up being part of the upper
2745  or lower index.
2746 \end_layout
2747
2748 \begin_layout Subsection
2749 What if something goes wrong
2750 \end_layout
2751
2752 \begin_layout Standard
2753 When constructing a diagram, you should at times check it by just moving
2754  the cursor out of the editing area to see whether instant preview can successfu
2755 lly convert it into graphical output.
2756  If this does not happen, it may either be that instant preview for some
2757  reason is not aware that it should retranslate the graphics.
2758  Moving the cursor into the editing area and out again sometimes wakes up
2759  instant preview.
2760 \end_layout
2761
2762 \begin_layout Standard
2763 A more serious reason could be a syntactical error in your input.
2764  If necessary, redo the last editing steps, using 
2765 \emph on
2766 Ctrl+Z
2767 \emph default
2768 , or try to translate the LyX-file into 
2769 \emph on
2770 DVI
2771 \emph default
2772  using 
2773 \emph on
2774 Ctrl+D
2775 \emph default
2776  or 
2777 \family sans
2778 View\SpecialChar \menuseparator
2779 DVI
2780 \family default
2781 .
2782  There should be some error generated, which hopefully gives you a hint
2783  as to the source of the mistake.
2784 \end_layout
2785
2786 \begin_layout Section
2787 Hacks
2788 \end_layout
2789
2790 \begin_layout Standard
2791 Certain things do not work correctly inside LyX.
2792  The ones that we (used to) miss most are the horizontal and vertical scaling
2793  of diagrams, and the correct positioning of arrows.
2794  There are some workarounds that we are explaining here.
2795  
2796 \end_layout
2797
2798 \begin_layout Subsection
2799 Horizontal and vertical scaling
2800 \end_layout
2801
2802 \begin_layout Standard
2803 It is often convenient to stretch the horizontal or the vertical dimensions
2804  of an entire diagram by using spacing commands for rows and/or columns.
2805  According to the 
2806 \begin_inset ERT
2807 status collapsed
2808
2809 \begin_layout Plain Layout
2810
2811
2812 \backslash
2813 Xy
2814 \end_layout
2815
2816 \end_inset
2817
2818 -manual, for instance, 
2819 \family typewriter
2820
2821 \backslash
2822 xymatrix@R=1pc{
2823 \family default
2824 \SpecialChar \ldots{}
2825
2826 \family typewriter
2827 }
2828 \family default
2829  defines an 
2830 \begin_inset ERT
2831 status collapsed
2832
2833 \begin_layout Plain Layout
2834
2835
2836 \backslash
2837 Xy
2838 \end_layout
2839
2840 \end_inset
2841
2842 -matrix with row spacing of 1 pica.
2843  Similarly, 
2844 \family typewriter
2845
2846 \backslash
2847 xymatrix@C=
2848 \family default
2849 \SpecialChar \ldots{}
2850
2851 \family typewriter
2852 {
2853 \family default
2854 \SpecialChar \ldots{}
2855
2856 \family typewriter
2857 }
2858 \family default
2859  allows to modify the space between columns.
2860  Unfortunately, these commands do currently not work inside LyX, as the
2861  @-character is interpreted by LyX as ending the 
2862 \begin_inset ERT
2863 status collapsed
2864
2865 \begin_layout Plain Layout
2866
2867
2868 \backslash
2869 Xy
2870 \end_layout
2871
2872 \end_inset
2873
2874 -matrix-macro.
2875  
2876 \end_layout
2877
2878 \begin_layout Standard
2879 Knowing that 
2880 \begin_inset ERT
2881 status collapsed
2882
2883 \begin_layout Plain Layout
2884
2885
2886 \backslash
2887 Xy
2888 \end_layout
2889
2890 \end_inset
2891
2892
2893 \begin_inset space ~
2894 \end_inset
2895
2896  stores the values for row-spacing and column-spacing in the variables 
2897 \family typewriter
2898
2899 \backslash
2900 xymatrixrowsep@
2901 \family default
2902  and 
2903 \family typewriter
2904
2905 \backslash
2906 xymatrixrowsep@
2907 \family default
2908 , add the following macro to the preamble (
2909 \family sans
2910 Layout\SpecialChar \menuseparator
2911 Document\SpecialChar \menuseparator
2912 Preamble
2913 \family default
2914 ):
2915 \begin_inset Newpage pagebreak
2916 \end_inset
2917
2918
2919 \end_layout
2920
2921 \begin_layout LyX-Code
2922
2923 \backslash
2924 newcommand{
2925 \backslash
2926 xyR}[1]{% 
2927 \end_layout
2928
2929 \begin_layout LyX-Code
2930
2931 \backslash
2932 xydef@
2933 \backslash
2934 xymatrixrowsep@{#1}}
2935 \end_layout
2936
2937 \begin_layout LyX-Code
2938
2939 \end_layout
2940
2941 \begin_layout Standard
2942 A macro 
2943 \family typewriter
2944
2945 \backslash
2946 xyC
2947 \family default
2948  can be defined correspondingly by replacing 
2949 \family typewriter
2950
2951 \backslash
2952 xymatrixrowsep@
2953 \family default
2954  with 
2955 \family typewriter
2956
2957 \backslash
2958 xymatrixcolsep@
2959 \family default
2960 .
2961  Now, a figure can be scaled by entering 
2962 \backslash
2963 xyR{...} into the 
2964 \begin_inset ERT
2965 status collapsed
2966
2967 \begin_layout Plain Layout
2968
2969
2970 \backslash
2971 Xy
2972 \end_layout
2973
2974 \end_inset
2975
2976 -matrix.
2977  Place the cursor inside the matrix, just before the first entry.
2978  Then enter 
2979 \family typewriter
2980
2981 \backslash
2982 xyR
2983 \backslash
2984 {
2985 \family default
2986  or 
2987 \family typewriter
2988
2989 \backslash
2990 xyC
2991 \backslash
2992 {
2993 \family default
2994  or both.
2995  Don't forget the backslashes and remember, that the closing brace is automatica
2996 lly supplied by LyX.
2997  Inside the braces enter the dimensions.
2998  The default is 
2999 \family typewriter
3000 2pt
3001 \family default
3002 .
3003  Here you see a diagram which is squashed vertically and stretched horizontally
3004  with 
3005 \family typewriter
3006
3007 \backslash
3008 xyR{9pc}
3009 \backslash
3010 xyC{.5pc}
3011 \family default
3012 :
3013 \end_layout
3014
3015 \begin_layout Standard
3016 \begin_inset Formula \[
3017 \xyC{.5pc}\xyC{9pc}\xymatrix{A\ar[r]\ar[d] & B\\
3018 C\ar@{}[ur]|{\text{{horizontal stretch}}}
3019 }
3020 \]
3021
3022 \end_inset
3023
3024
3025 \end_layout
3026
3027 \begin_layout Subsection
3028 Label positioning
3029 \end_layout
3030
3031 \begin_layout Standard
3032 Another useful 
3033 \begin_inset ERT
3034 status collapsed
3035
3036 \begin_layout Plain Layout
3037
3038
3039 \backslash
3040 Xy
3041 \end_layout
3042
3043 \end_inset
3044
3045 -command allows the correct positioning of labels along the shaft of arrows.
3046  This feature is sometimes necessary, when the default position of a label
3047  would otherwise clutter the picture, or would even coincide with other
3048  items, such as the intersection of the arrows in the figure below.
3049  In order to shift a label position alongside the shaft of an arrow, 
3050 \begin_inset ERT
3051 status collapsed
3052
3053 \begin_layout Plain Layout
3054
3055
3056 \backslash
3057 Xy
3058 \end_layout
3059
3060 \end_inset
3061
3062
3063 \begin_inset space ~
3064 \end_inset
3065
3066  allows to prefix the label by a decimal number in parentheses, specifying
3067  the fraction of distance alongside the arrow where the label is to be placed.
3068  For instance, the code 
3069 \family typewriter
3070
3071 \backslash
3072 ar[r]|(0.3)
3073 \backslash
3074 varphi
3075 \family default
3076 , will place the label on the shaft, but only about one third of the way.
3077  
3078 \end_layout
3079
3080 \begin_layout Standard
3081 Doing the same with labels above or below arrows as 
3082 \family typewriter
3083
3084 \backslash
3085 ar[dr]^(0.3)
3086 \backslash
3087 varphi,
3088 \family default
3089  respectively 
3090 \family typewriter
3091
3092 \backslash
3093 ar[ur]_(0.3)
3094 \backslash
3095 phi
3096 \family default
3097 , does not work from inside LyX.
3098  Instead, one has to replace the hat-symbol ^, resp.
3099  the underscore _ , by the macros 
3100 \family typewriter
3101
3102 \backslash
3103 sp
3104 \family default
3105 , resp.
3106  
3107 \family typewriter
3108
3109 \backslash
3110 sb
3111 \family default
3112 , obtaining 
3113 \family typewriter
3114
3115 \backslash
3116 ar[dr]
3117 \backslash
3118 sp(0.3)
3119 \backslash
3120 varphi 
3121 \family default
3122 and
3123 \family typewriter
3124  
3125 \backslash
3126 ar[ur]
3127 \backslash
3128 sb(0.3)
3129 \backslash
3130 phi.
3131  
3132 \family default
3133 It is, in fact, possible to enter several labels this way and those labels
3134  are placed correctly, even if the arrow bends.
3135  In the following figure, the bending arrow with its four labels has been
3136  produced with 
3137 \family typewriter
3138
3139 \backslash
3140 ar@(r,r)[d] 
3141 \backslash
3142 sp(0.2){
3143 \backslash
3144 phi_{1}} 
3145 \backslash
3146 sp(0.4){
3147 \backslash
3148 phi_{2}} 
3149 \backslash
3150 sb(0.6){
3151 \backslash
3152 phi_{3}} 
3153 \backslash
3154 sp(0.8){
3155 \backslash
3156 phi_{4}}.
3157 \end_layout
3158
3159 \begin_layout Standard
3160 \begin_inset Formula \[
3161 \xyC{4pc}\xymatrix{\bullet\ar[dr]\sp(0.3)\varphi & \circ\ar@{}[d]|\vdots\ar@(r,r)[d]\sp(0.2){\phi_{1}}\sp(0.4){\phi_{2}}\sb(0.6){\phi_{3}}\sp(0.8){\phi_{4}}\\
3162 \circ\ar[ur]\sb(0.3)\phi & \bullet
3163 }
3164 \]
3165
3166 \end_inset
3167
3168
3169 \end_layout
3170
3171 \begin_layout Subsection
3172 Invisible stretched arrows
3173 \end_layout
3174
3175 \begin_layout Standard
3176 A more general trick uses invisible arrows to place any object almost anywhere
3177  inside a diagram.
3178  Produce an invisible arrow, shorten (or prolong) it past its goal by adding
3179  a decimal stretching ratio, e.
3180 \begin_inset space \thinspace{}
3181 \end_inset
3182
3183 g.
3184  
3185 \family typewriter
3186 (0.6)
3187 \family default
3188  or 
3189 \family typewriter
3190 (1.4)
3191 \family default
3192  to its path.
3193  Attach a label to this invisible arrow.
3194  
3195 \end_layout
3196
3197 \begin_layout Standard
3198 Thus, the down pointing arrow with its label 
3199 \begin_inset Formula $\varphi$
3200 \end_inset
3201
3202  at (0.3) of its way along the shaft might as well have been produced by
3203  adding to the regular arrow 
3204 \family typewriter
3205
3206 \backslash
3207 ar[dr] 
3208 \family default
3209 an invisible 
3210 \begin_inset Formula $\varphi$
3211 \end_inset
3212
3213 -labelled arrow 
3214 \family typewriter
3215
3216 \backslash
3217 ar@{}[dr(0.6)]^
3218 \backslash
3219 varphi
3220 \family default
3221 , reaching only 0.6 of the way.
3222  Its label will now appear at 0.3 of the way of the original visible arrow.
3223  
3224 \end_layout
3225
3226 \begin_layout Standard
3227 This workaround has two minor drawbacks: First, it does not work with bending
3228  arrows.
3229  Secondly, prolonging an invisible arrow beyond the normal dimension of
3230  the figure will invisibly extend the figure box, and thereby cause too
3231  much vertical space between the figure and the preceding or the following
3232  paragraph.
3233  
3234 \end_layout
3235
3236 \begin_layout Standard
3237 Nevertheless, invisible arrows are an important tool, since they can, in
3238  principle, be used to place information at any chosen place in a diagram.
3239  In the above figure, for instance, we have used an invisible arrow to carry
3240  the 
3241 \family typewriter
3242
3243 \backslash
3244 vdots
3245 \family default
3246  as label and at the earlier figure we had used an invisible arrow to carry
3247  the text 
3248 \begin_inset Quotes eld
3249 \end_inset
3250
3251
3252 \family typewriter
3253 horizontal stretch
3254 \family default
3255
3256 \begin_inset Quotes erd
3257 \end_inset
3258
3259  into the center of the figure.
3260 \end_layout
3261
3262 \begin_layout Subsection
3263 Further 
3264 \family typewriter
3265
3266 \begin_inset ERT
3267 status collapsed
3268
3269 \begin_layout Plain Layout
3270
3271
3272 \backslash
3273 Xy
3274 \end_layout
3275
3276 \end_inset
3277
3278
3279 \family default
3280 -tricks
3281 \end_layout
3282
3283 \begin_layout Standard
3284 Here we have focused only on the 
3285 \family typewriter
3286
3287 \backslash
3288 xymatrix
3289 \family default
3290  command, which is just one of the features available in Kris Rose's amazing
3291 \family typewriter
3292  
3293 \begin_inset ERT
3294 status collapsed
3295
3296 \begin_layout Plain Layout
3297
3298
3299 \backslash
3300 Xy
3301 \end_layout
3302
3303 \end_inset
3304
3305
3306 \family default
3307 -package.
3308  The 
3309 \family typewriter
3310
3311 \begin_inset ERT
3312 status collapsed
3313
3314 \begin_layout Plain Layout
3315
3316
3317 \backslash
3318 Xy
3319 \end_layout
3320
3321 \end_inset
3322
3323
3324 \family default
3325 -Pic manual 
3326 \begin_inset CommandInset citation
3327 LatexCommand cite
3328 key "xypic manual"
3329
3330 \end_inset
3331
3332  demonstrates many of the advanced possibilities of that package.
3333  Beware, that its style is rather terse and you will likely need a lot of
3334  experimenting and modifying the many worked examples.
3335  Lauda 
3336 \begin_inset CommandInset citation
3337 LatexCommand cite
3338 key "Lauda"
3339
3340 \end_inset
3341
3342  explains how to use 
3343 \begin_inset ERT
3344 status collapsed
3345
3346 \begin_layout Plain Layout
3347
3348
3349 \backslash
3350 Xy
3351 \end_layout
3352
3353 \end_inset
3354
3355 -pic to make braids, cobordism, string diagrams, and much more.
3356  A good and rather systematic introduction to 
3357 \family typewriter
3358
3359 \begin_inset ERT
3360 status collapsed
3361
3362 \begin_layout Plain Layout
3363
3364
3365 \backslash
3366 Xy
3367 \end_layout
3368
3369 \end_inset
3370
3371
3372 \family default
3373 -matrix is 
3374 \begin_inset CommandInset citation
3375 LatexCommand cite
3376 key "Ouvaton"
3377
3378 \end_inset
3379
3380 .
3381  Even if you share with me the disadvantage of not being fluent in Esperanto,
3382  you will be able to understand most of it.
3383  
3384 \end_layout
3385
3386 \begin_layout Bibliography
3387 \labelwidthstring References
3388 \begin_inset CommandInset bibitem
3389 LatexCommand bibitem
3390 label "1"
3391 key "xypic manual"
3392
3393 \end_inset
3394
3395 Kristoffer H.
3396  Rose: 
3397 \begin_inset ERT
3398 status collapsed
3399
3400 \begin_layout Plain Layout
3401
3402
3403 \backslash
3404 Xy
3405 \end_layout
3406
3407 \end_inset
3408
3409
3410 \emph on
3411 -Pic User's Guide
3412 \emph default
3413 .
3414  Version 3.7, Feb.
3415  16, 1999.
3416  Available as part of the 
3417 \family typewriter
3418 xypic
3419 \family default
3420  LaTeX package.
3421  
3422 \end_layout
3423
3424 \begin_layout Bibliography
3425 \labelwidthstring References
3426 \begin_inset CommandInset bibitem
3427 LatexCommand bibitem
3428 label "2"
3429 key "instant-preview"
3430
3431 \end_inset
3432
3433
3434 \begin_inset Flex URL
3435 status collapsed
3436
3437 \begin_layout Plain Layout
3438
3439 http://www.tug.org/tex-archive/help/Catalogue/entries/preview-latex.html
3440 \end_layout
3441
3442 \end_inset
3443
3444
3445 \end_layout
3446
3447 \begin_layout Bibliography
3448 \labelwidthstring References
3449 \begin_inset CommandInset bibitem
3450 LatexCommand bibitem
3451 label "3"
3452 key "xypic"
3453
3454 \end_inset
3455
3456
3457 \begin_inset Flex URL
3458 status collapsed
3459
3460 \begin_layout Plain Layout
3461
3462 http://www.tug.org/tex-archive/help/Catalogue/entries/xypic.html
3463 \end_layout
3464
3465 \end_inset
3466
3467
3468 \end_layout
3469
3470 \begin_layout Bibliography
3471 \labelwidthstring References
3472 \begin_inset CommandInset bibitem
3473 LatexCommand bibitem
3474 label "4"
3475 key "AUCTeX"
3476
3477 \end_inset
3478
3479
3480 \begin_inset Flex URL
3481 status collapsed
3482
3483 \begin_layout Plain Layout
3484
3485 http://www.gnu.org/software/auctex/
3486 \end_layout
3487
3488 \end_inset
3489
3490
3491 \end_layout
3492
3493 \begin_layout Bibliography
3494 \labelwidthstring References
3495 \begin_inset CommandInset bibitem
3496 LatexCommand bibitem
3497 label "5"
3498 key "Lauda"
3499
3500 \end_inset
3501
3502 Aarlon Lauda: 
3503 \begin_inset ERT
3504 status collapsed
3505
3506 \begin_layout Plain Layout
3507
3508
3509 \backslash
3510 Xy
3511 \end_layout
3512
3513 \end_inset
3514
3515
3516 \emph on
3517 -Pic
3518 \emph default
3519  
3520 \emph on
3521 tutorial with an archive of examples
3522 \emph default
3523 .
3524 \begin_inset Flex URL
3525 status collapsed
3526
3527 \begin_layout Plain Layout
3528
3529 http://www.dpmms.cam.ac.uk/~al366/xytutorial.html
3530 \end_layout
3531
3532 \end_inset
3533
3534
3535 \end_layout
3536
3537 \begin_layout Bibliography
3538 \labelwidthstring References
3539 \begin_inset CommandInset bibitem
3540 LatexCommand bibitem
3541 label "6"
3542 key "Ouvaton"
3543
3544 \end_inset
3545
3546 Filipp Ouvaton: 
3547 \begin_inset ERT
3548 status collapsed
3549
3550 \begin_layout Plain Layout
3551
3552
3553 \backslash
3554 Xy
3555 \end_layout
3556
3557 \end_inset
3558
3559
3560 \emph on
3561 -Pic
3562 \emph default
3563
3564 \emph on
3565 Enkonduko pri Xymatrix
3566 \emph default
3567 .
3568  
3569 \begin_inset Flex URL
3570 status collapsed
3571
3572 \begin_layout Plain Layout
3573
3574 http://filip.ouvaton.org/xypic/xymatrix/index.html
3575 \end_layout
3576
3577 \end_inset
3578
3579
3580 \end_layout
3581
3582 \end_body
3583 \end_document