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