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