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