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