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