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