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