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