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