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