2020-12-29 17:03:05 +00:00
#LyX 2.4 created this file. For more info see https://www.lyx.org/
2024-01-11 16:06:40 +00:00
\lyxformat 620
2008-10-22 22:39:56 +00:00
\begin_document
\begin_header
2016-01-12 21:30:37 +00:00
\save_transient_properties true
2019-03-25 15:32:27 +00:00
\origin /systemlyxdir/examples/Graphics_and_Insets/
2009-02-17 00:50:37 +00:00
\textclass scrartcl
2008-10-22 22:39:56 +00:00
\begin_preamble
2013-02-16 18:34:16 +00:00
% DO NOT ALTER THIS PREAMBLE!!!
%
% This preamble is designed to ensure that the file prints
% out as advertised. If you mess with this preamble,
% parts of this document may not print out as expected. If you
% have problems LaTeXing this file, please contact
% the documentation team
% email: lyx-docs@lists.lyx.org
2008-10-22 22:39:56 +00:00
\usepackage[all]{xy}
2009-02-25 02:07:14 +00:00
% define new commands used in sec. 5.1
2008-10-22 22:39:56 +00:00
\newcommand{\xyR}[1]{
2009-02-25 02:07:14 +00:00
\xydef@\xymatrixrowsep@{#1}}
2008-10-22 22:39:56 +00:00
\newcommand{\xyC}[1]{
2009-02-25 02:07:14 +00:00
\xydef@\xymatrixcolsep@{#1}}
2008-10-22 22:39:56 +00:00
\newdir{|>}{!/4.5pt/@{|}*:(1,-.2)@^{>}*:(1,+.2)@_{>}}
2009-02-17 00:50:37 +00:00
% a pdf-bookmark for the TOC is added
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
\pdfbookmark[1]{\contentsname}{}
\myTOC }
% redefine the \LyX macro for PDF bookmarks
\def\LyX{\texorpdfstring{%
L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
{LyX}}
2013-02-16 18:34:16 +00:00
% if pdflatex is used
\usepackage{ifpdf}
\ifpdf
% set fonts for nicer pdf view
\IfFileExists{lmodern.sty}
{\usepackage{lmodern}}{}
\fi % end if pdflatex is used
2008-10-22 22:39:56 +00:00
\end_preamble
2009-02-17 00:50:37 +00:00
\options BCOR7.5mm
2008-10-25 22:46:25 +00:00
\use_default_options false
2020-12-29 17:03:05 +00:00
\maintain_unincluded_children no
2008-10-22 22:39:56 +00:00
\language english
2011-06-14 16:32:44 +00:00
\language_package default
2019-05-08 17:59:57 +00:00
\inputencoding utf8
2020-12-29 17:03:05 +00:00
\fontencoding auto
2015-11-13 18:14:45 +00:00
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
2008-10-22 22:39:56 +00:00
\font_default_family default
2011-06-14 16:32:44 +00:00
\use_non_tex_fonts false
2008-10-22 22:39:56 +00:00
\font_sc false
2022-12-11 16:12:05 +00:00
\font_roman_osf false
2020-12-29 17:03:05 +00:00
\font_sans_osf false
\font_typewriter_osf false
2015-11-13 18:14:45 +00:00
\font_sf_scale 100 100
\font_tt_scale 100 100
2017-04-24 04:03:19 +00:00
\use_microtype false
\use_dash_ligatures false
2008-10-22 22:39:56 +00:00
\graphics default
2010-03-28 19:43:49 +00:00
\default_output_format default
2011-06-14 16:32:44 +00:00
\output_sync 0
2010-03-28 19:43:49 +00:00
\bibtex_command default
\index_command default
2009-02-17 00:50:37 +00:00
\paperfontsize 12
2008-10-22 22:39:56 +00:00
\spacing single
2009-02-17 00:50:37 +00:00
\use_hyperref true
\pdf_title "Using XY-pc in LyX"
\pdf_author "H. Peter Gumm"
\pdf_subject "LyX's XY-pic manual"
\pdf_keywords "LyX, documentation"
\pdf_bookmarks true
\pdf_bookmarksnumbered true
\pdf_bookmarksopen true
\pdf_bookmarksopenlevel 2
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle false
2013-02-16 20:49:57 +00:00
\pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false"
2020-12-29 17:03:05 +00:00
\papersize a4
2008-10-22 22:39:56 +00:00
\use_geometry false
2013-02-16 20:49:57 +00:00
\use_package amsmath 1
\use_package amssymb 1
2017-10-19 12:47:51 +00:00
\use_package cancel 1
\use_package esint 1
2013-02-16 20:49:57 +00:00
\use_package mathdots 1
2017-10-19 12:47:51 +00:00
\use_package mathtools 1
2013-02-16 20:49:57 +00:00
\use_package mhchem 1
2017-10-19 12:47:51 +00:00
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
2008-10-22 22:39:56 +00:00
\cite_engine basic
2014-03-23 16:31:51 +00:00
\cite_engine_type default
2013-02-16 20:49:57 +00:00
\biblio_style plain
2008-10-22 22:39:56 +00:00
\use_bibtopic false
2010-03-28 19:43:49 +00:00
\use_indices false
2008-10-22 22:39:56 +00:00
\paperorientation portrait
2017-11-18 16:04:06 +00:00
\suppress_date true
2013-02-16 20:49:57 +00:00
\justification true
2011-06-14 16:32:44 +00:00
\use_refstyle 0
2017-11-18 16:04:06 +00:00
\use_minted 0
2020-12-29 17:03:05 +00:00
\use_lineno 0
2022-12-11 16:12:05 +00:00
\notefontcolor #0000ff
2010-03-28 19:43:49 +00:00
\index Index
\shortcut idx
\color #008000
\end_index
2008-10-22 22:39:56 +00:00
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
2010-03-28 19:43:49 +00:00
\paragraph_indentation default
2017-04-24 04:03:19 +00:00
\is_math_indent 0
2017-08-14 06:31:24 +00:00
\math_numbering_side default
2017-04-24 04:03:19 +00:00
\quotes_style english
2017-11-18 16:04:06 +00:00
\dynamic_quotes 0
2008-10-22 22:39:56 +00:00
\papercolumns 1
2009-02-17 00:50:37 +00:00
\papersides 2
2008-10-22 22:39:56 +00:00
\paperpagestyle default
2022-12-11 16:12:05 +00:00
\tablestyle default
2008-10-22 22:39:56 +00:00
\tracking_changes false
\output_changes false
2022-12-11 16:12:05 +00:00
\change_bars false
\postpone_fragile_content false
2010-03-28 19:43:49 +00:00
\html_math_output 0
2011-06-14 16:32:44 +00:00
\html_css_as_file 0
2010-03-28 19:43:49 +00:00
\html_be_strict true
2022-12-11 16:12:05 +00:00
\docbook_table_output 0
\docbook_mathml_prefix 1
2008-10-22 22:39:56 +00:00
\end_header
\begin_body
\begin_layout Title
Using
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2016-01-13 01:51:42 +00:00
-pic in \SpecialChar LyX
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Author
H.
Peter Gumm
\end_layout
\begin_layout Abstract
2016-01-13 01:51:42 +00:00
With the recent versions of \SpecialChar LyX
2015-11-13 18:14:45 +00:00
and with the
2008-10-22 22:39:56 +00:00
\family typewriter
preview
\family default
2016-01-13 01:51:42 +00:00
-style installed in the \SpecialChar LaTeX
2022-12-11 16:12:05 +00:00
-System,
the graph drawing package
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2016-01-13 01:51:42 +00:00
-pic can be conveniently used inside \SpecialChar LyX
2015-11-13 18:14:45 +00:00
.
2016-01-13 01:51:42 +00:00
Diagrams can be edited and displayed inside the main \SpecialChar LyX
2015-11-13 18:14:45 +00:00
editing window.
2022-12-11 16:12:05 +00:00
Here,
we shall describe how to use the
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
xymatrix
\family default
command from
\family typewriter
xypic
\family default
2016-01-13 01:51:42 +00:00
inside \SpecialChar LyX
2022-12-11 16:12:05 +00:00
in order to draw,
to edit and to preview diagrams as typically used in category theory,
algebra,
and related fields.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Abstract
\begin_inset CommandInset toc
LatexCommand tableofcontents
\end_inset
\end_layout
\begin_layout Section
Introduction
\end_layout
\begin_layout Standard
The
\family typewriter
xypic
\family default
2022-12-11 16:12:05 +00:00
-package has long served as a convenient tool for easily constructing graphs and diagrams in \SpecialChar LaTeX
2015-11-13 18:14:45 +00:00
.
2022-12-11 16:12:05 +00:00
Unfortunately,
its use in \SpecialChar LyX
2016-01-13 01:51:42 +00:00
had long been restricted to the infamous \SpecialChar TeX
2022-12-11 16:12:05 +00:00
code boxes,
meaning that the \SpecialChar LyX
2016-01-13 01:51:42 +00:00
editor could only display the \SpecialChar LaTeX
2022-12-11 16:12:05 +00:00
-source and not the finished diagram.
2008-10-22 22:39:56 +00:00
The new
\family typewriter
preview
\family default
2016-01-13 01:51:42 +00:00
-style of \SpecialChar LaTeX
which is part of the AUC\SpecialChar TeX
2015-11-13 18:14:45 +00:00
project
2008-10-22 22:39:56 +00:00
\begin_inset CommandInset citation
LatexCommand cite
key "AUCTeX"
2017-04-24 04:03:19 +00:00
literal "true"
2008-10-22 22:39:56 +00:00
\end_inset
2022-12-11 16:12:05 +00:00
,
finally enables the editing and displaying of
2008-10-22 22:39:56 +00:00
\family typewriter
xypic
\family default
2022-12-11 16:12:05 +00:00
-diagrams,
constructed,
displayed and interactively edited inside \SpecialChar LyX
2015-11-13 18:14:45 +00:00
.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
\begin_inset VSpace defskip
\end_inset
\end_layout
\begin_layout Standard
2009-02-16 23:38:01 +00:00
\align center
2008-10-22 22:39:56 +00:00
\begin_inset Graphics
2009-11-24 17:55:30 +00:00
filename xyfigure.png
2009-11-25 00:47:10 +00:00
width 75col%
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\begin_layout Standard
\begin_inset VSpace defskip
\end_inset
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
In this note,
we describe how
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2016-01-13 01:51:42 +00:00
-pic can be used from inside \SpecialChar LyX
2022-12-11 16:12:05 +00:00
,
how diagrams can be created and edited.
2016-01-13 01:51:42 +00:00
We have tested the following using \SpecialChar LyX
2022-12-11 16:12:05 +00:00
versions 1.3.7 up to 1.6,
running under Windows
2009-02-26 00:01:45 +00:00
\begin_inset space \thinspace{}
\end_inset
XP and under Windows Vista.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
There are two modes of operations:
For a start,
and for some first tests,
2008-10-22 22:39:56 +00:00
it may be easiest to first enter the
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2016-01-13 01:51:42 +00:00
-pic code inside the \SpecialChar LyX
2022-12-11 16:12:05 +00:00
-window,
select it all and convert it to a graphical representation by pressing
2008-10-22 22:39:56 +00:00
\family sans
Ctrl-m
\family default
or
\family sans
Ctrl-M
\family default
.
If you use
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-pic more frequently,
or if you want to modify your initial figure,
you will want to assemble and modify your figures using \SpecialChar LyX
2015-11-13 18:14:45 +00:00
's math editor.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Once the cursor is moved over a diagram,
this is displayed as an array of nodes and arrow-commands.
2008-10-22 22:39:56 +00:00
These can be changed interactively.
2022-12-11 16:12:05 +00:00
When the cursor leaves the editing area,
the diagram reappears.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
In the first two sections of this documentation,
we explain how to use \SpecialChar LyX
2008-10-22 22:39:56 +00:00
in the first mentioned mode and we introduce all
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-pic features that might be of use for drawing commutative diagrams,
graphs or automata.
2009-02-16 23:38:01 +00:00
Section
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:math-editor"
2022-12-11 16:12:05 +00:00
nolink "false"
2009-02-16 23:38:01 +00:00
\end_inset
explains how to use the
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2009-11-24 14:28:44 +00:00
-pic commands inside a math-editing area.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
It is not our intention to write another introduction to
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-pic,
rather our motivation is to give an introduction how the most important commands work inside \SpecialChar LyX
,
since the keystrokes as explained in the
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2009-11-24 14:28:44 +00:00
-pic manual
2008-10-22 22:39:56 +00:00
\begin_inset CommandInset citation
LatexCommand cite
key "xypic manual"
2017-04-24 04:03:19 +00:00
literal "true"
2008-10-22 22:39:56 +00:00
\end_inset
2016-01-13 01:51:42 +00:00
will not always function correctly inside \SpecialChar LyX
2015-11-13 18:14:45 +00:00
.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Section
Preparation
\end_layout
\begin_layout Standard
2016-01-13 01:51:42 +00:00
The following requires that the \SpecialChar LaTeX
2015-11-13 18:14:45 +00:00
-packages
2008-10-22 22:39:56 +00:00
\family typewriter
xypic
\family default
and
\family typewriter
preview
\family default
2016-01-13 01:51:42 +00:00
are installed in the \SpecialChar LaTeX
2015-11-13 18:14:45 +00:00
system.
2022-12-11 16:12:05 +00:00
They are available from CTAN,
see at
2008-10-22 22:39:56 +00:00
\begin_inset CommandInset citation
LatexCommand cite
key "instant-preview"
2017-04-24 04:03:19 +00:00
literal "true"
2008-10-22 22:39:56 +00:00
\end_inset
2022-12-11 16:12:05 +00:00
,
resp.
2008-10-22 22:39:56 +00:00
at
\begin_inset CommandInset citation
LatexCommand cite
key "xypic"
2017-04-24 04:03:19 +00:00
literal "true"
2008-10-22 22:39:56 +00:00
\end_inset
.
2022-12-11 16:12:05 +00:00
After freshly installing them,
it may be necessary,
to run
2008-10-22 22:39:56 +00:00
\family sans
2015-11-13 18:14:45 +00:00
Tools\SpecialChar menuseparator
2008-10-22 22:39:56 +00:00
Reconfigure
\family default
2016-01-13 01:51:42 +00:00
from the main \SpecialChar LyX
2015-11-13 18:14:45 +00:00
menu.
2016-01-13 01:51:42 +00:00
The steps to a first diagram output in \SpecialChar LyX
2015-11-13 18:14:45 +00:00
are then:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Enumerate
Activate and test
\family typewriter
preview
\end_layout
\begin_deeper
\begin_layout Enumerate
2016-01-13 01:51:42 +00:00
Open \SpecialChar LyX
2022-12-11 16:12:05 +00:00
,
choose
2008-10-22 22:39:56 +00:00
\family sans
2015-11-13 18:14:45 +00:00
Tools\SpecialChar menuseparator
Preferences\SpecialChar menuseparator
Look and Feel\SpecialChar menuseparator
2009-11-24 14:28:44 +00:00
Display
2008-10-22 22:39:56 +00:00
\family default
2009-10-11 02:12:51 +00:00
and turn
2008-10-22 22:39:56 +00:00
\emph on
Instant Preview
2009-10-11 02:12:51 +00:00
\emph default
on.
\end_layout
\begin_layout Enumerate
In
\family sans
2015-11-13 18:14:45 +00:00
Document\SpecialChar menuseparator
Settings\SpecialChar menuseparator
2009-10-11 02:12:51 +00:00
Math
\begin_inset space ~
\end_inset
Options
\family default
2022-12-11 16:12:05 +00:00
,
uncheck
2009-10-11 02:12:51 +00:00
\emph on
Use AMS Math package automatically
\emph default
and check
\emph on
Use AMS Math package
2008-10-22 22:39:56 +00:00
\emph default
.
\end_layout
\begin_layout Enumerate
2022-12-11 16:12:05 +00:00
Test,
if
2008-10-22 22:39:56 +00:00
\family typewriter
instant-preview
\family default
2016-01-13 01:51:42 +00:00
works by opening a \SpecialChar LyX
2022-12-11 16:12:05 +00:00
-document and entering any math-formula,
e.
2008-10-28 23:39:29 +00:00
\begin_inset space \thinspace{}
\end_inset
g.
2013-02-16 18:34:16 +00:00
\begin_inset space \space{}
\end_inset
2008-10-22 22:39:56 +00:00
\begin_inset Formula $a+b=c$
\end_inset
.
\end_layout
\begin_layout Enumerate
2022-12-11 16:12:05 +00:00
Move the cursor out of the formula,
and watch it change its appearance to look just like in the finished DVI- or PostScript document.
2008-10-22 22:39:56 +00:00
\end_layout
\end_deeper
\begin_layout Enumerate
Activate and test
2009-02-25 01:45:43 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2009-02-25 01:45:43 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2009-11-24 14:28:44 +00:00
-pic
2008-10-22 22:39:56 +00:00
\family typewriter
2009-02-25 01:45:43 +00:00
:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_deeper
\begin_layout Enumerate
2016-01-13 01:51:42 +00:00
Inside your \SpecialChar LyX
2022-12-11 16:12:05 +00:00
-Document,
enter the text
2008-10-22 22:39:56 +00:00
\family typewriter
\begin_inset Newline newline
\end_inset
\backslash
xymatrix{A
\backslash
ar[r] & B}
\family default
.
\end_layout
\begin_layout Enumerate
Select the whole text and choose
\family sans
2015-11-13 18:14:45 +00:00
Insert\SpecialChar menuseparator
Math\SpecialChar menuseparator
2008-10-22 22:39:56 +00:00
Display Formula
\family default
2022-12-11 16:12:05 +00:00
,
or use the corresponding keyboard shortcut
2008-10-22 22:39:56 +00:00
\family sans
Ctrl-M
\family default
.
\end_layout
\begin_layout Enumerate
2022-12-11 16:12:05 +00:00
Move the mouse cursor out of the editing box and wait for a split second to see an arrow appear:
2008-10-25 22:46:25 +00:00
\begin_inset Formula $\xymatrix{A\ar[r] & B}
2008-10-22 22:39:56 +00:00
$
\end_inset
.
\end_layout
\end_deeper
2009-10-04 15:58:46 +00:00
\begin_layout Section
Commutative diagrams
\end_layout
2008-10-22 22:39:56 +00:00
\begin_layout Standard
2022-12-11 16:12:05 +00:00
The following diagram,
which is taken from the documentation of
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2009-11-24 14:28:44 +00:00
-pic
2008-10-22 22:39:56 +00:00
\begin_inset CommandInset citation
LatexCommand cite
key "xypic manual"
2017-04-24 04:03:19 +00:00
literal "true"
2008-10-22 22:39:56 +00:00
\end_inset
by its creator Kristoffer H.
2022-12-11 16:12:05 +00:00
Rose,
will provide an example for many of the features available with that package.
Its source code is:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout LyX-Code
\backslash
xymatrix{
\begin_inset Newline newline
\end_inset
U
\backslash
ar@/_{1pc}/[ddr]_
\backslash
psi
\backslash
ar@/^{1pc}/[drr]^
\backslash
varphi
\begin_inset Newline newline
\end_inset
\backslash
ar@{.>}[dr]|-{(x,y)}
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& X
\backslash
times_Z Y
\backslash
ar[d]^q
\backslash
ar[r]_p & X
\backslash
ar[d]_f
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& Y
\backslash
ar[r]^g & Z }
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Again,
to turn this code into a graphical output,
select it all at once starting from the
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
xymatrix{
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
up to the closing brace \SpecialChar ldots
2008-10-22 22:39:56 +00:00
\family typewriter
}
\family default
and turn it into display-math as explained above.
2022-12-11 16:12:05 +00:00
A moment after the cursor leaves the math-area,
you should see the diagram in its full graphical glory as shown below.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2008-10-25 22:46:25 +00:00
\begin_inset Formula $\xymatrix{U\ar@/_{1pc}/[ddr]_{\psi}\ar@/{}^{1pc}/[drr]^{\varphi}\ar@{.>}[dr]|-{(x,y)}\\
& X\times_{Z}Y\ar[d]^{q}\ar[r]_{p} & X\ar[d]_{f}\\
2010-03-28 19:43:49 +00:00
& Y\ar[r]^{g} & Z
}
2008-10-22 22:39:56 +00:00
$
\end_inset
\end_layout
\begin_layout Subsection
The matrix layout of diagrams
\end_layout
\begin_layout Standard
\family typewriter
xymatrix
\family default
uses a matrix to define the layout of the vertices of a diagram.
2022-12-11 16:12:05 +00:00
For the above example,
we need a
2008-10-22 22:39:56 +00:00
\begin_inset Formula $3\times3$
\end_inset
-matrix of which 5 entries are used for the vertices
\begin_inset Formula $U$
\end_inset
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\begin_inset Formula $X\times_{Z}Y$
\end_inset
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\begin_inset Formula $X$
\end_inset
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\begin_inset Formula $Y$
\end_inset
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\begin_inset Formula $Z$
\end_inset
2022-12-11 16:12:05 +00:00
,
the other positions remaining empty.
In this case,
the following matrix determines the layout:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout LyX-Code
\backslash
xymatrix{
\begin_inset Newline newline
\end_inset
U
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& X
\backslash
times_Z Y & X
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& Y & Z }
\end_layout
\begin_layout Standard
2016-01-13 01:51:42 +00:00
The pattern should be familiar from \SpecialChar LaTeX
2022-12-11 16:12:05 +00:00
:
We see three rows,
the first two being terminated by the end-of-line-marker
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
\backslash
\family default
.
2022-12-11 16:12:05 +00:00
Each line consists of entries,
separated by the ampersand
2008-10-22 22:39:56 +00:00
\family typewriter
&
\family default
.
\end_layout
\begin_layout Subsection
Arrows
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Having entered the vertices,
we add arrows between them.
2008-10-22 22:39:56 +00:00
The basic
\family typewriter
xypic
\family default
-command to produce an arrow is
\family typewriter
\backslash
ar
\family default
2022-12-11 16:12:05 +00:00
,
it is entered into the cell of the matrix where the arrow is to start.
2008-10-22 22:39:56 +00:00
The target of the arrow is defined by direction commands
\family typewriter
u
\family default
(up)
\family typewriter
d
\family default
(down)
\family typewriter
l
\family default
2022-12-11 16:12:05 +00:00
(left),
or
2008-10-22 22:39:56 +00:00
\family typewriter
r
\family default
(right).
These can be combined to a path and enclosed in square brackets.
2022-12-11 16:12:05 +00:00
As an example,
the arrows from the vertex
2008-10-22 22:39:56 +00:00
\begin_inset Formula $U$
\end_inset
in the upper left corner down and right to the vertices
\begin_inset Formula $X\times_{Z}Y$
\end_inset
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\begin_inset Formula $Y$
\end_inset
2022-12-11 16:12:05 +00:00
,
and
2008-10-22 22:39:56 +00:00
\begin_inset Formula $X$
\end_inset
2022-12-11 16:12:05 +00:00
are,
respectively,
defined as
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[dr]
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[ddr]
\family default
and
\family typewriter
\backslash
ar[drr]
\family default
.
Thus the above diagram with all arrows added becomes:
\end_layout
\begin_layout LyX-Code
\backslash
xymatrix{
\begin_inset Newline newline
\end_inset
U
\backslash
ar[ddr]
\backslash
ar[drr]
\backslash
ar[dr]
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& X
\backslash
times_Z Y
\backslash
ar[d]
\backslash
ar[r]& X
\backslash
ar[d]
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& Y
\backslash
ar[r] & Z }
\end_layout
2013-02-16 18:34:16 +00:00
\begin_layout LyX-Code
\begin_inset Formula $\xymatrix{U\ar[ddr]\ar[drr]\ar[dr]\\
& X\times_{Z}Y\ar[d]\ar[r] & X\ar[d]\\
& Y\ar[r] & Z
2010-03-28 19:43:49 +00:00
}
2013-02-16 18:34:16 +00:00
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout Subsection
Labels
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Labels are attached to arrows by affixing them as upper or lower indices to the
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar
\family default
-command.
2022-12-11 16:12:05 +00:00
Thus,
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[drr]^
\backslash
varphi
\family default
2022-12-11 16:12:05 +00:00
defines an arrow going one cell down,
two to the right and having the label
2008-10-22 22:39:56 +00:00
\begin_inset Formula $\varphi$
\end_inset
attached above.
2022-12-11 16:12:05 +00:00
To attach a label below the arrow,
make it a lower index as in
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[ddr]_
\backslash
psi
\family default
.
This explanation is correct only for arrows pointing to the right.
2022-12-11 16:12:05 +00:00
More precisely,
imagine looking along the arrow in the direction it is pointing.
Then an upper index places a label to the left and a lower index places it to the right.
Consequently,
an arrow pointing from right to left,
such as
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[l]^
\backslash
alpha_
\backslash
beta
\family default
will have label
\begin_inset Formula $\alpha$
\end_inset
below and label
\begin_inset Formula $\beta$
\end_inset
2022-12-11 16:12:05 +00:00
above the arrow,
e.
2008-10-28 23:39:29 +00:00
\begin_inset space \thinspace{}
\end_inset
g.
2008-10-25 22:46:25 +00:00
\begin_inset space \space{}
\end_inset
\begin_inset Formula $\xymatrix{\ & \ \ar[l]_{\beta}^{\alpha}.}
2008-10-22 22:39:56 +00:00
$
\end_inset
2022-12-11 16:12:05 +00:00
Using the character | instead of ^ or _ ,
it is even possible to place the label right onto the arrow,
obscuring part of its shaft.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Normally,
a label is placed halfway between an arrow's start and target objects.
In the first diagram,
the central arrow starting in
2008-10-22 22:39:56 +00:00
\begin_inset Formula $U$
\end_inset
has the label
\begin_inset Formula $(x,y)$
\end_inset
2022-12-11 16:12:05 +00:00
in the middle of the arrow's shaft,
rather than in the middle between the two objects it connects.
This is achieved by prefixing the label with a minus sign,
here:
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[dr]|-{(x,y)}
\family default
.
\end_layout
\begin_layout LyX-Code
\backslash
xymatrix{
\begin_inset Newline newline
\end_inset
U
\backslash
ar[ddr]_
\backslash
psi
\backslash
ar[drr]^
\backslash
varphi
\backslash
ar[dr]|-{(x,y)}
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& X
\backslash
times_Z Y
\backslash
ar[d]^q
\backslash
ar[r]_p& X
\backslash
ar[d]_f
\backslash
\backslash
\begin_inset Newline newline
\end_inset
& Y
\backslash
ar[r]^g & Z }
\end_layout
\begin_layout LyX-Code
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{U\ar[ddr]_{\psi}\ar[drr]^{\varphi}\ar[dr]|-{(x,y)}\\
& X\times_{Z}Y\ar[d]^{q}\ar[r]_{p} & X\ar[d]_{f}\\
& Y\ar[r]^{g} & Z
2010-03-28 19:43:49 +00:00
}
2013-02-16 18:34:16 +00:00
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\begin_layout Standard
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-pic normally permits labels to be shifted towards the tip or towards the start of an arrow by prefixing the label with a ratio,
such as e.
2008-10-28 23:39:29 +00:00
\begin_inset space \thinspace{}
\end_inset
g.
2013-02-16 18:34:16 +00:00
\begin_inset space \space{}
\end_inset
2008-10-22 22:39:56 +00:00
\family typewriter
(.3)
\family default
.
2016-01-13 01:51:42 +00:00
In \SpecialChar LyX
2022-12-11 16:12:05 +00:00
this works only for labels which are placed on top of the arrow,
such as
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[r]|(0.3){
\backslash
phi}
\family default
.
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
For labels placed to the left or to the right of the arrow this does not work.
2008-10-22 22:39:56 +00:00
The corresponding
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2008-10-28 23:39:29 +00:00
-pic code such as e.
\begin_inset space \thinspace{}
\end_inset
g.
2013-02-16 18:34:16 +00:00
\begin_inset space \space{}
\end_inset
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[r]^(.3)
\backslash
phi
\family default
or
\family typewriter
\backslash
ar[r]_(.3)
\backslash
psi
\family default
2016-01-13 01:51:42 +00:00
is not correctly interpreted by \SpecialChar LyX
2015-11-13 18:14:45 +00:00
's math editor.
2008-10-22 22:39:56 +00:00
Two workarounds are suggested in the last section of this note.
\end_layout
\begin_layout Subsection
2009-02-26 00:01:45 +00:00
Arrow modification
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Modification of the design,
the form or the positioning of arrows are introduced by the
2008-10-22 22:39:56 +00:00
\family typewriter
@
\family default
-character.
2022-12-11 16:12:05 +00:00
This is followed by a pair of matching brackets,
where the form of the bracket pair,
2008-10-22 22:39:56 +00:00
\family typewriter
{ }
\family default
or
\family typewriter
< >
\family default
or
\family typewriter
/ /
\family default
2022-12-11 16:12:05 +00:00
indicates,
whether we want to modify the design,
the or the curvature of the arrow.
2009-02-26 00:01:45 +00:00
Various modifications can be applied to an arrow at the same time.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Subsubsection
2009-02-26 00:01:45 +00:00
Arrow design
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
Various designs such as
\emph on
solid
\emph default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\emph on
dotted
\emph default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\emph on
dashed
\emph default
or
\emph on
double
\emph default
are possible for the shaft of an arrow.
These can be combined with various ends and various tips.
2022-12-11 16:12:05 +00:00
In general,
the design of an arrow is described by following the command
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar
\family default
immediately by an
\family typewriter
@
\family default
2015-11-13 18:14:45 +00:00
-sign and a pair of braces {\SpecialChar ldots
2008-10-22 22:39:56 +00:00
} containing characters describing the end,
the shaft and the tip of the arrow.
2022-12-11 16:12:05 +00:00
These characters are chosen to give some form of ASCII-rendering of the real thing.
2008-10-22 22:39:56 +00:00
For instance
\family typewriter
\backslash
ar@{>..>>}
\family default
2022-12-11 16:12:05 +00:00
produces an arrow with split end,
a dotted shaft and double head.
2008-10-22 22:39:56 +00:00
A number of other arrow designs is given in the table below.
Note that the ends of embedding arrows
2008-10-25 22:46:25 +00:00
\begin_inset Formula $\xymatrix{A\ar@{^{(}->}[r] & B}
2008-10-22 22:39:56 +00:00
$
\end_inset
2022-12-11 16:12:05 +00:00
are described by raising or lowering opening parentheses,
such as in
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar@{^(->}[r].
\end_layout
\begin_layout Standard
2013-02-16 18:34:16 +00:00
\align center
2008-10-22 22:39:56 +00:00
\begin_inset Tabular
<lyxtabular version="3" rows="11" columns="2">
2016-01-13 01:51:42 +00:00
<features tabularvalignment="middle">
2013-02-16 18:34:16 +00:00
<column alignment="center" valignment="top" width="0pt">
2014-03-23 16:31:51 +00:00
<column alignment="center" valignment="top">
2008-10-22 22:39:56 +00:00
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Result
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2016-01-13 01:51:42 +00:00
Source code in \SpecialChar LyX
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{-->}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
2016-01-13 01:51:42 +00:00
ar@{-->}
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{..>}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{..>}
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{~>}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{~>}
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{->>}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{->>}
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{-->>}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
2016-01-13 01:51:42 +00:00
ar@{-->>}
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{>->>}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{>->>}
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{_{(}->}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{_(->}
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{^{(}->}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{^(->}
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{|-|}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{|-|}
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
\begin_layout Standard
2008-10-25 22:46:25 +00:00
\noindent
2022-12-11 16:12:05 +00:00
Following the @-character by either a 2,
3,
_ or a ^,
we can produce arrows with double,
triple shaft or arrows showing only the lower or upper half of their tips and ends.
Arrows need not have tips nor ends,
as the last example shows:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2013-02-16 18:34:16 +00:00
\align center
2008-10-22 22:39:56 +00:00
\begin_inset Tabular
<lyxtabular version="3" rows="8" columns="2">
2016-01-13 01:51:42 +00:00
<features tabularvalignment="middle">
2014-03-23 16:31:51 +00:00
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
2008-10-22 22:39:56 +00:00
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
Result
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2016-01-13 01:51:42 +00:00
Source code for \SpecialChar LyX
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
</row>
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@2[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@2
\end_layout
\end_inset
</cell>
</row>
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@3[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@3
\end_layout
\end_inset
</cell>
</row>
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@_{->}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@_{->}
\end_layout
\end_inset
</cell>
</row>
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@^{->}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@^{->}
\end_layout
\end_inset
</cell>
</row>
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@^{>>->>}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
2015-11-13 18:14:45 +00:00
ar@^{>\SpecialChar ligaturebreak
>->\SpecialChar ligaturebreak
2013-02-16 18:34:16 +00:00
>}
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
</row>
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@{^{<}-_{>}}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
ar@{^<-_>}
\end_layout
\end_inset
</cell>
</row>
<row>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
2013-02-16 18:34:16 +00:00
\begin_inset Formula $\xymatrix{\ \ar@2{--}[r] & \ }
$
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 18:34:16 +00:00
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
2013-02-16 18:34:16 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
2008-10-22 22:39:56 +00:00
\begin_inset Text
\begin_layout Plain Layout
\family typewriter
\backslash
2016-01-13 01:51:42 +00:00
ar@2{--}
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
\begin_layout Subsubsection
Designing your own arrows
\end_layout
\begin_layout Standard
Within certain limits there is even a way to design your own arrows.
Using some the characters
\family typewriter
><|ox+/()[
\family default
one can even design one's own arrow tips using the
\family typewriter
\backslash
newdir
\family default
2009-02-26 00:01:45 +00:00
command in the preamble.
2022-12-11 16:12:05 +00:00
For explanations,
we refer to the
2008-10-22 22:39:56 +00:00
\family typewriter
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
\family default
2022-12-11 16:12:05 +00:00
-manual,
from which we take the example:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
\family typewriter
\backslash
newdir{|>}{!/4.5pt/@{|}*:(1,-.2)@^{>}*:(1,+.2)@_{>}}
\family default
.
\end_layout
\begin_layout Standard
2008-10-25 22:46:25 +00:00
\noindent
2022-12-11 16:12:05 +00:00
This defines a new arrow tip,
referred to as
2008-10-22 22:39:56 +00:00
\family typewriter
|>
\family default
in
\family typewriter
\backslash
ar@{-|>}[r]
\family default
2016-01-13 01:51:42 +00:00
and which displays correctly in \SpecialChar LyX
2015-11-13 18:14:45 +00:00
as:
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2008-10-25 22:46:25 +00:00
\xymatrix{A\ar@{-|>}[r] & \ \ B}
2008-10-22 22:39:56 +00:00
\]
\end_inset
\end_layout
\begin_layout Subsection
Arrow positioning
\end_layout
\begin_layout Standard
Arrows are shifted sideways with the modifier
\family typewriter
@<
\family default
\begin_inset Formula $\ldots$
\end_inset
\family typewriter
>
\family default
where the ellipsis is replaced by a positive or negative measure.
2022-12-11 16:12:05 +00:00
For instance,
to design a pair of mutually opposing arrows between two nodes,
we shift them to see them apart.
Note that the direction of the shift (positive) is to the left if one looks along the arrow.
2008-10-22 22:39:56 +00:00
Thus
\end_layout
\begin_layout Standard
\family typewriter
\backslash
xymatrix{
\backslash
circ
\backslash
ar@<1ex>[r]&
\backslash
circ
\backslash
ar@<1ex>[l]}
\end_layout
\begin_layout Standard
2008-10-25 22:46:25 +00:00
\noindent
produces
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2008-10-25 22:46:25 +00:00
\xymatrix{\circ\ar@<1ex>[r] & \circ\ar@<1ex>[l]}
2008-10-22 22:39:56 +00:00
\]
\end_inset
\end_layout
\begin_layout Subsubsection
Inline or centered diagrams
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Arrows and diagrams can be used inline,
such as this one:
2008-10-25 22:46:25 +00:00
\begin_inset Formula $\xymatrix{\circ\ar@<1ex>[r] & \circ\ar@<1ex>[l]}
2008-10-22 22:39:56 +00:00
$
\end_inset
.
2016-01-13 01:51:42 +00:00
When their code is written inside \SpecialChar LyX
2022-12-11 16:12:05 +00:00
as above,
select it and choose either
2008-10-22 22:39:56 +00:00
\family sans
Ctrl-m
\family default
2009-02-26 00:01:45 +00:00
for inline appearance or
2008-10-22 22:39:56 +00:00
\family sans
Ctrl-M
\family default
for displaystyle.
2022-12-11 16:12:05 +00:00
Diagrams constructed inline can later be centered,
or,
conversely,
centered diagrams can be changed to inline formulas with
2008-10-22 22:39:56 +00:00
\family sans
2015-11-13 18:14:45 +00:00
Edit\SpecialChar menuseparator
2008-10-22 22:39:56 +00:00
Math
\family default
\family sans
2015-11-13 18:14:45 +00:00
\SpecialChar menuseparator
2009-11-24 14:28:44 +00:00
Change Formula Type.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Subsection
2009-02-26 00:01:45 +00:00
Bending arrows
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
There are two simple methods to make arrows bend.
2022-12-11 16:12:05 +00:00
The first is giving an explicit value by which the midpoint of the arrow's shaft is raised or depressed,
the other is by forcing the arrow to leave its origin in a prescribed compass direction and to make him enter the target at another direction.
2008-10-22 22:39:56 +00:00
The necessary bending of the arrow is determined automatically.
We describe both methods.
\end_layout
\begin_layout Subsubsection
Raising the shaft
\end_layout
\begin_layout Standard
2020-08-05 13:05:52 +00:00
For bending arrows we use the modifier
\family typewriter
@/
\family default
2008-10-22 22:39:56 +00:00
\begin_inset Formula $\ldots$
\end_inset
2020-08-05 13:05:52 +00:00
\family typewriter
/
\family default
.
2016-01-13 01:51:42 +00:00
The ellipsis stands for a \SpecialChar TeX
2022-12-11 16:12:05 +00:00
-measure which needs to be entered as a lower or upper index.
2008-10-22 22:39:56 +00:00
Whereas in
\family typewriter
xypic
\family default
2022-12-11 16:12:05 +00:00
,
we could simply write,
e.
2008-10-28 23:39:29 +00:00
\begin_inset space \thinspace{}
\end_inset
g.
2013-02-16 18:34:16 +00:00
\begin_inset space \space{}
\end_inset
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar@/_1pc/
\family default
for an arrow bending
\family typewriter
1pc
\family default
2022-12-11 16:12:05 +00:00
downwards,
this cannot directly be done in \SpecialChar LyX
2015-11-13 18:14:45 +00:00
.
2022-12-11 16:12:05 +00:00
It is necessary,
to enclose the measure in a pair of braces,
such as e.
2008-10-28 23:39:29 +00:00
\begin_inset space \thinspace{}
\end_inset
g.
2013-02-16 18:34:16 +00:00
\begin_inset space \space{}
\end_inset
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar@/_{1pc}/
\family default
.
2022-12-11 16:12:05 +00:00
As an example,
here are two opposing arrows between
2008-10-22 22:39:56 +00:00
\begin_inset Formula $A$
\end_inset
and
\begin_inset Formula $B$
\end_inset
2022-12-11 16:12:05 +00:00
,
each bending by .5 pica,
given by the following source code:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
\family typewriter
\backslash
xymatrix{A
\backslash
ar@/_{.5pc}/[r] & B
\backslash
ar@/_{.5pc}/[l]}
\end_layout
\begin_layout Standard
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2008-10-25 22:46:25 +00:00
\xymatrix{A\ar@/{}_{.5pc}/[r] & B\ar@/{}_{.5pc}/[l]}
2008-10-22 22:39:56 +00:00
\]
\end_inset
\end_layout
\begin_layout Subsubsection
2009-02-26 00:01:45 +00:00
Specifying exit- and entrance directions
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
An alternative for making arrows bend is by specifying their compass direction as they are leaving their source and their direction from which they enter their target.
Instead of north,
north-east,
east,
etc.,
the directions are named
2008-10-22 22:39:56 +00:00
\family typewriter
u
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
ur
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
r
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
dr
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
d
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
dl
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
l
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
ul
\family default
2022-12-11 16:12:05 +00:00
,
standing for up,
up-right,
right,
down-right,
etc..
2020-08-05 13:05:52 +00:00
A direction is specified as
\family typewriter
@(
\family default
2008-10-22 22:39:56 +00:00
\emph on
out
\emph default
,
\emph on
in
2020-08-05 13:05:52 +00:00
\family typewriter
2008-10-22 22:39:56 +00:00
\emph default
2020-08-05 13:05:52 +00:00
)
\family default
where
2008-10-22 22:39:56 +00:00
\emph on
out
\emph default
stands for the direction the first object is left and
\emph on
in
\emph default
stands for the direction from which the target is entered.
2022-12-11 16:12:05 +00:00
As an example,
we show some bending arrows and a loop,
which arises when we do not specify a target for an arrow,
just its incoming and outgoing direction:
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2008-10-25 22:46:25 +00:00
\xymatrix{A\ar@(dr,dl)[r]\ar@(dr,dl)[rr] & B\ar@(d,r)[dl] & C\\
2010-03-28 19:43:49 +00:00
E\ar@(ul,ur)
}
2008-10-22 22:39:56 +00:00
\]
\end_inset
\end_layout
\begin_layout LyX-Code
\backslash
xymatrix{A
\backslash
ar@(dr,dl)[r]
\backslash
ar@(dr,dl)[rr]
\begin_inset Newline newline
\end_inset
&B
\backslash
ar@(d,r)[dl] &C
\backslash
\backslash
\begin_inset Newline newline
\end_inset
E
\backslash
ar@(ul,ur)}
\end_layout
\begin_layout Subsection
Modifying vertices
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
The above example is reminiscent of an automata diagram,
except that in such a diagram states would be enclosed in small circles,
with double circles denoting final states.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Subsubsection
2009-02-26 00:01:45 +00:00
Framing objects
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
With
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-pic,
entries can obtain a single or a double frame,
such as
2008-10-22 22:39:56 +00:00
\begin_inset Formula $\xymatrix{*+[F]{A}}
$
\end_inset
or
\begin_inset Formula $\xymatrix{*+[F=]{B}}
$
\end_inset
by prefixing an entry with
\family typewriter
*[F-]
\family default
or
\family typewriter
*[F=]
\family default
and enclosing the portion of the entry to be framed in braces.
2022-12-11 16:12:05 +00:00
Normally,
the frame will be very tight so that it must be widened by prefixing with
2008-10-22 22:39:56 +00:00
\family typewriter
+
\family default
or with
\family typewriter
++
\family default
.
2022-12-11 16:12:05 +00:00
Round frames,
such as
2008-10-22 22:39:56 +00:00
\begin_inset Formula $\xymatrix{*++[o][F]{A}}
$
\end_inset
and
\begin_inset Formula $\xymatrix{*++[o][F=]{B}}
$
\end_inset
are obtained by specifying the shape as
\family typewriter
[o].
\family default
So the latter figure was constructed as *++[o][F=]{B}.
2022-12-11 16:12:05 +00:00
This way,
the following automaton
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2008-10-25 22:46:25 +00:00
\xymatrix{\txt{start}\ar[r] & *++[o][F]{1}\ar[r] & *++[o][F=]{2}\ar@(ur,dr)\ar@(ur,ul)[l]}
2008-10-22 22:39:56 +00:00
\]
\end_inset
\end_layout
\begin_layout Standard
2009-02-26 00:01:45 +00:00
\noindent
can be typeset as
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout LyX-Code
\backslash
xymatrix{
\backslash
txt{start}
\backslash
ar[r]
\end_layout
\begin_layout LyX-Code
& *++[o][F]{1}
\backslash
ar[r]
\end_layout
\begin_layout LyX-Code
& *++[o][F=]{2}
\backslash
ar@(ur,dr)
\backslash
ar@(ur,ul)[l]
\end_layout
\begin_layout LyX-Code
}.
\end_layout
\begin_layout Standard
2016-01-13 01:51:42 +00:00
The \SpecialChar LaTeX
2015-11-13 18:14:45 +00:00
command
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
entrymodifiers={
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2008-10-22 22:39:56 +00:00
\family typewriter
}
\family default
2022-12-11 16:12:05 +00:00
will make a certain entry style the default,
that can,
of course be overridden for individual entries.
Thus,
after
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
entrymodifiers={++[o][F-]}
\family default
2022-12-11 16:12:05 +00:00
,
all following entries inside
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
-matrices would be encircled.
\end_layout
\begin_layout Subsubsection
Framing rectangles
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Framing a whole rectangle inside an xymatrix is done with the macro pair
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
save ...
\backslash
restore
\family default
.
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
The dimension of the rectangle is given as a dotted pair
\begin_inset Formula $P_{0}.P_{1}$
\end_inset
of points denoting the top left and lower right corners of the rectangle.
2022-12-11 16:12:05 +00:00
Each point,
in turn,is given as a doubly quoted comma separated pair
2008-10-22 22:39:56 +00:00
\begin_inset Quotes eld
\end_inset
\begin_inset Formula $x,y$
\end_inset
\begin_inset Quotes erd
\end_inset
specifying row
\begin_inset Formula $x$
\end_inset
and column
\begin_inset Formula $y$
\end_inset
.
2022-12-11 16:12:05 +00:00
These are followed by the framing commands,
to produce figures such as the following:
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2008-10-25 22:46:25 +00:00
\xymatrix{A & B\ar@(d,r)[dl]\sp(0.2)\phi\sp(0.7)\psi\save"1,1"."2,1"*+[F=]\frm{}\restore\,\\
2010-03-28 19:43:49 +00:00
C & \save"1,1"."1,2"*++[F]\frm{}\restore
}
2008-10-22 22:39:56 +00:00
\]
\end_inset
2022-12-11 16:12:05 +00:00
Here,
the code
2008-10-22 22:39:56 +00:00
\family typewriter
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\backslash
save"1,1"."2,1"*+[F=]
\backslash
frm{}
\backslash
restore
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2022-12-11 16:12:05 +00:00
produces the doubly framed rectangle,
and the code for the extra wide horizontal rectangle is
2008-10-22 22:39:56 +00:00
\family typewriter
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
2020-08-05 13:05:52 +00:00
\begin_inset Newline newline
\end_inset
2008-10-22 22:39:56 +00:00
\backslash
save"1,1"."1,2"*++[F]
\backslash
frm{}
\backslash
restore
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2020-08-05 13:05:52 +00:00
\begin_inset Newline newline
\end_inset
This code can be placed in arbitrary cells of the xymatrix.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Section
2016-01-13 01:51:42 +00:00
Using \SpecialChar LyX
2015-11-13 18:14:45 +00:00
's math editor
2009-02-16 23:38:01 +00:00
\begin_inset CommandInset label
LatexCommand label
name "sec:math-editor"
\end_inset
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
As an alternative to writing the
\family typewriter
xypic
\family default
2022-12-11 16:12:05 +00:00
code,
then transforming it into a math-editing environment by marking it and applying
2008-10-22 22:39:56 +00:00
\family sans
Ctrl-m
\family default
2022-12-11 16:12:05 +00:00
,
or
2008-10-22 22:39:56 +00:00
\family sans
Ctrl-M
\family default
2022-12-11 16:12:05 +00:00
,
one may construct and modify the whole xypic-diagram inside \SpecialChar LyX
2016-01-13 01:51:42 +00:00
's math editor.
2008-10-22 22:39:56 +00:00
We describe the editing steps for a figure just like the one above.
\end_layout
\begin_layout Subsection
Caveat - how to enter braces
\end_layout
\begin_layout Standard
2016-01-13 01:51:42 +00:00
Recall that in \SpecialChar LyX
2015-11-13 18:14:45 +00:00
's math-editor any pair of braces
2008-10-22 22:39:56 +00:00
\family typewriter
{
\family default
and
\family typewriter
}
\family default
that are to enclose a macro-parameter must be entered by typing just
\family typewriter
\backslash
{
\family default
.
2022-12-11 16:12:05 +00:00
The closing brace is automatically supplied and in between a box into which to the parameter is entered.
2008-10-22 22:39:56 +00:00
In connection with
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-diagrams,
this applies in particular to arrow modifications that are normally given in the form
2008-10-22 22:39:56 +00:00
\family typewriter
@{
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2008-10-22 22:39:56 +00:00
\family typewriter
}
\family default
2022-12-11 16:12:05 +00:00
with the ellipsis standing for the description of end,
shaft and tip of the arrow.
Inside the math-editor,
enter just
2008-10-22 22:39:56 +00:00
\family typewriter
@
\backslash
{
\family default
2016-01-13 01:51:42 +00:00
and let \SpecialChar LyX
2022-12-11 16:12:05 +00:00
provide the closing brace and the box into which to enter the description of the arrow.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
Braces that are entered without the backslash
\family typewriter
\backslash
\family default
2022-12-11 16:12:05 +00:00
will just appear as typed,
but cannot be used to receive a macro parameter.
They are useful,
for instance to denote sets,
e.
2008-10-28 23:39:29 +00:00
\begin_inset space \thinspace{}
\end_inset
g.
2013-02-16 18:34:16 +00:00
\begin_inset space \space{}
\end_inset
2008-10-22 22:39:56 +00:00
\family typewriter
{x
\backslash
in X
\backslash
mid x
\backslash
notin x}
\family default
will display as
\begin_inset Formula $\{x\in X\mid x\notin x\}$
\end_inset
.
\end_layout
\begin_layout Subsection
Setting up the matrix
\end_layout
\begin_layout Standard
With
\family sans
Ctrl-m
\family default
or
\family sans
Ctrl-M
\family default
2022-12-11 16:12:05 +00:00
open a formula environment and enter:
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
xymatrix
\family default
.
This produces a 1
\begin_inset Formula $\times$
\end_inset
1-
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
-matrix.
Add extra rows by typing
\family sans
Ctrl-Enter
\family default
and add columns by typing
\family sans
Alt-m c i.
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
At any time,
further rows or columns can be entered or deleted using commands available from
2008-10-22 22:39:56 +00:00
\family sans
2015-11-13 18:14:45 +00:00
Edit\SpecialChar menuseparator
2008-10-22 22:39:56 +00:00
Math,
2022-12-11 16:12:05 +00:00
2008-10-22 22:39:56 +00:00
\family default
resp.
2022-12-11 16:12:05 +00:00
their shortcuts,
beginning with
2008-10-22 22:39:56 +00:00
\family sans
Alt-m c
\family default
for the column commands or
\family sans
Alt-m w
\family default
for the row commands.
2022-12-11 16:12:05 +00:00
A more direct way uses the icons in the math toolbar once it has been activated via
2009-11-24 14:28:44 +00:00
\family sans
2015-11-13 18:14:45 +00:00
View\SpecialChar menuseparator
2009-11-24 14:28:44 +00:00
Toolbars.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Subsection
2022-12-11 16:12:05 +00:00
Entering nodes,
arrows and labels
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
Type the nodes into the correct positions of the matrix.
2022-12-11 16:12:05 +00:00
If you move the cursor out of the matrix,
you should see a first rendering of the node layout.
Next,
add the arrows at the nodes from where they should emanate by typing
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[
\family default
\emph on
p
\family typewriter
\emph default
]
\family default
2022-12-11 16:12:05 +00:00
,
where
2008-10-22 22:39:56 +00:00
\emph on
p
\emph default
can be any path made up from the characters
\family typewriter
u
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
d
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
l
\family default
2022-12-11 16:12:05 +00:00
,
2008-10-22 22:39:56 +00:00
\family typewriter
r
\family default
.
Make sure that the path indeed leads to an existing node within the matrix.
2022-12-11 16:12:05 +00:00
Otherwise,
the figure will not display when the cursor leaves the editing area.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Next,
label the arrows by attaching a label text as upper or lower indices to the end of the arrow's path.
2016-01-13 01:51:42 +00:00
As always in \SpecialChar LyX
2022-12-11 16:12:05 +00:00
's math editor,
an underscore
2008-10-22 22:39:56 +00:00
\family typewriter
_
\family default
opens a box for a lower index and a
\family typewriter
^
\family default
followed by a space opens a box for an upper index.
2016-01-13 01:51:42 +00:00
You can enter any \SpecialChar LaTeX
2015-11-13 18:14:45 +00:00
-code as a label.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Subsection
2009-02-26 00:01:45 +00:00
Modifying arrows
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Finally,
you can modify the appearance of the arrows by entering @-modifiers
2009-02-25 01:45:43 +00:00
\family typewriter
@{
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2009-02-25 01:45:43 +00:00
\family typewriter
}
\family default
2022-12-11 16:12:05 +00:00
,
2009-02-25 01:45:43 +00:00
\family typewriter
@<
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2020-08-05 13:05:52 +00:00
\family typewriter
>
\family default
2022-12-11 16:12:05 +00:00
,
2009-02-25 01:45:43 +00:00
\family typewriter
@(
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
,\SpecialChar ldots
2020-08-05 13:05:52 +00:00
\family typewriter
)
\family default
or
2009-02-25 01:45:43 +00:00
\family typewriter
@/
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2009-02-25 01:45:43 +00:00
\family typewriter
/
\family default
.
2008-10-22 22:39:56 +00:00
The above caveat applies to the first form only.
It must be entered as
\family typewriter
@
\backslash
{
\family default
2016-01-13 01:51:42 +00:00
with the arrow description entered inside the \SpecialChar LyX
2015-11-13 18:14:45 +00:00
-supplied box.
2022-12-11 16:12:05 +00:00
If this box remains empty,
you have specified an empty arrow.
This is a useful construction,
too,
as you will see in the next section.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
The other modifiers,
2009-02-25 01:45:43 +00:00
\family typewriter
@<
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2009-02-25 01:45:43 +00:00
\family typewriter
>
\family default
2022-12-11 16:12:05 +00:00
,
2009-02-25 01:45:43 +00:00
\family typewriter
@(
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
,\SpecialChar ldots
2009-02-25 01:45:43 +00:00
\family typewriter
)
\family default
and
\family typewriter
@/
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2009-02-25 01:45:43 +00:00
\family typewriter
/
\family default
are typed as shown with the arrow description replacing the ellipsis.
2022-12-11 16:12:05 +00:00
The code for bending arrows,
which in
2008-10-22 22:39:56 +00:00
\family typewriter
xypic
\family default
2009-02-25 01:45:43 +00:00
is
\family typewriter
@/_
\family default
2008-10-22 22:39:56 +00:00
\emph on
measure
2009-02-25 01:45:43 +00:00
\family typewriter
2008-10-22 22:39:56 +00:00
\emph default
2009-02-25 01:45:43 +00:00
/
\family default
or
\family typewriter
@/
2008-10-22 22:39:56 +00:00
\emph on
2009-02-25 01:45:43 +00:00
^
\family default
measure
\family typewriter
2008-10-22 22:39:56 +00:00
\emph default
2009-02-25 01:45:43 +00:00
/
\family default
where
2008-10-22 22:39:56 +00:00
\emph on
measure
\emph default
2016-01-13 01:51:42 +00:00
is any valid \SpecialChar TeX
2022-12-11 16:12:05 +00:00
-measure that should be entered as upper or lower index to the first slash /.
Make sure that the ending slash does not end up being part of the upper or lower index.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Subsection
What if something goes wrong
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
When constructing a diagram,
you should at times check it by just moving the cursor out of the editing area to see whether instant preview can successfully convert it into graphical output.
If this does not happen,
it may either be that instant preview for some reason is not aware that it should retranslate the graphics.
Moving the cursor into the editing area and out again sometimes wakes up instant preview.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
A more serious reason could be a syntactical error in your input (in that case,
the math edition area disappears completely).
If necessary,
undo the last editing steps,
using
2009-11-24 14:28:44 +00:00
\family sans
2009-02-26 00:01:45 +00:00
Ctrl+Z
2009-11-24 14:28:44 +00:00
\family default
2022-12-11 16:12:05 +00:00
,
or try to translate the \SpecialChar LyX
2015-11-13 18:14:45 +00:00
-file into
2009-11-24 14:28:44 +00:00
\family sans
2009-02-26 00:01:45 +00:00
DVI
2009-11-24 14:28:44 +00:00
\family default
2009-02-25 01:45:43 +00:00
using
2009-11-24 14:28:44 +00:00
\family sans
2009-02-26 00:01:45 +00:00
Ctrl+D
2009-11-24 14:28:44 +00:00
\family default
2009-02-25 01:45:43 +00:00
or
2008-10-22 22:39:56 +00:00
\family sans
2015-11-13 18:14:45 +00:00
View\SpecialChar menuseparator
2009-02-26 00:01:45 +00:00
DVI
2008-10-22 22:39:56 +00:00
\family default
.
2022-12-11 16:12:05 +00:00
There should be some error generated,
which hopefully gives you a hint as to the source of the mistake.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Section
Hacks
\end_layout
\begin_layout Standard
2016-01-13 01:51:42 +00:00
Certain things do not work correctly inside \SpecialChar LyX
2015-11-13 18:14:45 +00:00
.
2022-12-11 16:12:05 +00:00
The ones that we (used to) miss most are the horizontal and vertical scaling of diagrams,
and the correct positioning of arrows.
2008-10-22 22:39:56 +00:00
There are some workarounds that we are explaining here.
\end_layout
\begin_layout Subsection
Horizontal and vertical scaling
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
It is often convenient to stretch the horizontal or the vertical dimensions of an entire diagram by using spacing commands for rows and/or columns.
2008-10-22 22:39:56 +00:00
According to the
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-manual,
2013-02-16 20:49:57 +00:00
\begin_inset CommandInset citation
LatexCommand cite
key "xypic manual"
2017-04-24 04:03:19 +00:00
literal "true"
2013-02-16 20:49:57 +00:00
\end_inset
2022-12-11 16:12:05 +00:00
,
for instance,
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
xymatrix@R=1pc{
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2008-10-22 22:39:56 +00:00
\family typewriter
}
\family default
defines an
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2013-02-16 20:49:57 +00:00
-matrix with row spacing of 1
\begin_inset space ~
\end_inset
pica.
2022-12-11 16:12:05 +00:00
Similarly,
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
xymatrix@C=
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2008-10-22 22:39:56 +00:00
\family typewriter
{
\family default
2015-11-13 18:14:45 +00:00
\SpecialChar ldots
2008-10-22 22:39:56 +00:00
\family typewriter
}
\family default
allows to modify the space between columns.
2022-12-11 16:12:05 +00:00
Unfortunately,
one cannot type
2013-02-16 20:49:57 +00:00
\begin_inset Quotes eld
\end_inset
2008-10-22 22:39:56 +00:00
2013-02-16 20:49:57 +00:00
\family typewriter
2008-10-22 22:39:56 +00:00
\backslash
2013-02-16 20:49:57 +00:00
xymatrix@R=1pc
\family default
\begin_inset Quotes erd
\end_inset
2022-12-11 16:12:05 +00:00
into a formula to get the desired matrix because the @-character is interpreted by \SpecialChar LyX
2015-11-13 18:14:45 +00:00
as ending the
2013-02-16 20:49:57 +00:00
\family typewriter
\backslash
xymatrix
\family default
command.
But there are two other ways of getting the desired matrix:
2008-10-22 22:39:56 +00:00
\end_layout
2013-02-16 20:49:57 +00:00
\begin_layout Itemize
One types e.g.
\begin_inset space \space{}
\end_inset
\family typewriter
\backslash
xymatrix@R=1pc
\family default
2022-12-11 16:12:05 +00:00
as normal document text,
then either highlight it and press
2013-02-16 20:49:57 +00:00
\begin_inset Info
type "shortcut"
arg "math-mode"
2008-10-22 22:39:56 +00:00
\end_inset
2022-12-11 16:12:05 +00:00
to get a formula,
or copy it into an existing formula.
2013-02-16 20:49:57 +00:00
You can now continue as normal.
\begin_inset Newline newline
\end_inset
\begin_inset Note Greyedout
status open
\begin_layout Plain Layout
\series bold
Note:
2022-12-11 16:12:05 +00:00
2013-02-16 20:49:57 +00:00
\series default
2022-12-11 16:12:05 +00:00
This method only works for single spacing settings,
so using
2013-02-16 20:49:57 +00:00
\begin_inset Newline newline
\end_inset
\family typewriter
\backslash
xymatrix@M=1pt
\family default
is possible while
\family typewriter
\backslash
xymatrix@M=1pt@C=1dd
\family default
is not.
2022-12-11 16:12:05 +00:00
The method also don't work if you use '!' to get a fixed grid with a defined dimension,
e.g.
2013-02-16 20:49:57 +00:00
\begin_inset space \space{}
\end_inset
\family typewriter
\backslash
xymatrix@!R=3pt
\family default
fails while
\family typewriter
2008-10-22 22:39:56 +00:00
2013-02-16 20:49:57 +00:00
\backslash
xymatrix@!R
\family default
works.
2008-10-22 22:39:56 +00:00
\end_layout
2013-02-16 20:49:57 +00:00
\end_inset
\begin_inset Newline newline
\end_inset
2022-12-11 16:12:05 +00:00
For the following matrix,
the command
2013-02-16 20:49:57 +00:00
\family typewriter
\backslash
xymatrix@C=9pc
\family default
was used:
\begin_inset Formula
\[
\xymatrix@C=9pc{A\ar[r]\ar[d] & B\\
C\ar@{}[ur]|{\text{{horizontal stretch}}}
}
\]
\end_inset
\end_layout
\begin_layout Itemize
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
\begin_inset space ~
\end_inset
2013-02-16 20:49:57 +00:00
stores the values for row-spacing and column-spacing in the variables
\begin_inset Newline newline
\end_inset
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
xymatrixrowsep@
\family default
and
\family typewriter
\backslash
2020-08-05 13:05:52 +00:00
xymatrixcolsep@
2008-10-22 22:39:56 +00:00
\family default
2013-02-16 20:49:57 +00:00
.
So one can add the following macro to the preamble (
2008-10-22 22:39:56 +00:00
\family sans
2015-11-13 18:14:45 +00:00
Layout\SpecialChar menuseparator
Document\SpecialChar menuseparator
2009-02-25 02:01:46 +00:00
Preamble
\family default
):
2008-10-22 22:39:56 +00:00
\end_layout
2013-02-16 20:49:57 +00:00
\begin_deeper
2008-10-22 22:39:56 +00:00
\begin_layout LyX-Code
\backslash
newcommand{
\backslash
2013-02-16 20:49:57 +00:00
xyR}[1]{%
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout LyX-Code
\backslash
xydef@
\backslash
2009-02-25 02:01:46 +00:00
xymatrixrowsep@{#1}}
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
A macro
\family typewriter
\backslash
xyC
\family default
can be defined correspondingly by replacing
\family typewriter
\backslash
xymatrixrowsep@
\family default
with
\family typewriter
\backslash
xymatrixcolsep@
\family default
.
2022-12-11 16:12:05 +00:00
Now,
a figure can be scaled by entering
2008-10-22 22:39:56 +00:00
\backslash
2013-02-16 20:49:57 +00:00
xyR{ into the formula before the
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
-matrix.
2022-12-11 16:12:05 +00:00
Place the cursor inside the matrix,
just before the first entry.
2008-10-22 22:39:56 +00:00
Then enter
\family typewriter
\backslash
xyR
\backslash
{
\family default
or
\family typewriter
\backslash
xyC
\backslash
{
\family default
or both.
2022-12-11 16:12:05 +00:00
Don't forget the backslashes and remember,
that the closing brace is automatically supplied by \SpecialChar LyX
2015-11-13 18:14:45 +00:00
.
2008-10-22 22:39:56 +00:00
Inside the braces enter the dimensions.
2013-02-16 20:49:57 +00:00
\begin_inset Newline newline
\end_inset
\begin_inset Note Greyedout
status open
\begin_layout Plain Layout
\series bold
Note:
2022-12-11 16:12:05 +00:00
2013-02-16 20:49:57 +00:00
\series default
these commands affect all following
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
-matrices.
2022-12-11 16:12:05 +00:00
Therefore don't forget to reset the values to default after the usage of
2008-10-22 22:39:56 +00:00
\family typewriter
2013-02-16 20:49:57 +00:00
\backslash
xyR
\family default
2020-08-05 13:05:52 +00:00
etc.
2013-02-16 20:49:57 +00:00
\end_layout
\end_inset
\begin_inset Newline newline
\end_inset
The default is
\family typewriter
2pc
2008-10-22 22:39:56 +00:00
\family default
.
2022-12-11 16:12:05 +00:00
Here you see a diagram which is squashed vertically and stretched horizontally with
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
2013-02-16 20:49:57 +00:00
xyR{.5pc}
2008-10-22 22:39:56 +00:00
\backslash
2013-02-16 20:49:57 +00:00
xyC{9pc}
2008-10-22 22:39:56 +00:00
\family default
:
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2013-02-16 20:49:57 +00:00
\xyR{.5pc}\xyC{9pc}\xymatrix{A\ar[r]\ar[d] & B\\
2010-03-28 19:43:49 +00:00
C\ar@{}[ur]|{\text{{horizontal stretch}}}
}
2008-10-22 22:39:56 +00:00
\]
\end_inset
2013-02-16 20:49:57 +00:00
\begin_inset Formula $\xyR{2pc}\xyC{2pc}$
\end_inset
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
reset to default
\end_layout
\end_inset
2008-10-22 22:39:56 +00:00
\end_layout
2013-02-16 20:49:57 +00:00
\end_deeper
2008-10-22 22:39:56 +00:00
\begin_layout Subsection
Label positioning
\end_layout
\begin_layout Standard
Another useful
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2009-02-26 00:01:45 +00:00
-command allows the correct positioning of labels along the shaft of arrows.
2022-12-11 16:12:05 +00:00
This feature is sometimes necessary,
when the default position of a label would otherwise clutter the picture,
or would even coincide with other items,
such as the intersection of the arrows in the figure below.
In order to shift a label position alongside the shaft of an arrow,
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
\begin_inset space ~
\end_inset
2022-12-11 16:12:05 +00:00
allows to prefix the label by a decimal number in parentheses,
specifying the fraction of distance alongside the arrow where the label is to be placed.
For instance,
the code
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[r]|(0.3)
\backslash
varphi
\family default
2022-12-11 16:12:05 +00:00
,
will place the label on the shaft,
but only about one third of the way.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
Doing the same with labels above or below arrows as
\family typewriter
\backslash
ar[dr]^(0.3)
\backslash
varphi,
2022-12-11 16:12:05 +00:00
2008-10-22 22:39:56 +00:00
\family default
respectively
\family typewriter
\backslash
ar[ur]_(0.3)
\backslash
phi
\family default
2022-12-11 16:12:05 +00:00
,
does not work from inside \SpecialChar LyX
2015-11-13 18:14:45 +00:00
.
2022-12-11 16:12:05 +00:00
Instead,
one has to replace the hat-symbol ^,
resp.
the underscore _ ,
by the macros
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
sp
\family default
2022-12-11 16:12:05 +00:00
,
resp.
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
sb
\family default
2022-12-11 16:12:05 +00:00
,
obtaining
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[dr]
\backslash
sp(0.3)
\backslash
varphi
\family default
and
\family typewriter
\backslash
ar[ur]
\backslash
sb(0.3)
\backslash
phi.
\family default
2022-12-11 16:12:05 +00:00
It is,
in fact,
possible to enter several labels this way and those labels are placed correctly,
even if the arrow bends.
In the following figure,
the bending arrow with its four labels has been produced with
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar@(r,r)[d]
\backslash
sp(0.2){
\backslash
phi_{1}}
\backslash
sp(0.4){
\backslash
phi_{2}}
\backslash
sb(0.6){
\backslash
phi_{3}}
\backslash
sp(0.8){
\backslash
phi_{4}}.
\end_layout
\begin_layout Standard
2011-06-14 16:32:44 +00:00
\begin_inset Formula
\[
2008-10-25 22:46:25 +00:00
\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}}\\
2010-03-28 19:43:49 +00:00
\circ\ar[ur]\sb(0.3)\phi & \bullet
}
2008-10-22 22:39:56 +00:00
\]
\end_inset
\end_layout
\begin_layout Subsection
Invisible stretched arrows
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
A more general trick uses invisible arrows to place any object almost anywhere inside a diagram.
Produce an invisible arrow,
shorten (or prolong) it past its goal by adding a decimal stretching ratio,
e.
2008-10-28 23:39:29 +00:00
\begin_inset space \thinspace{}
\end_inset
g.
2013-02-16 18:34:16 +00:00
\begin_inset space \space{}
\end_inset
2008-10-22 22:39:56 +00:00
\family typewriter
(0.6)
\family default
or
\family typewriter
(1.4)
\family default
to its path.
Attach a label to this invisible arrow.
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Thus,
the down pointing arrow with its label
2008-10-22 22:39:56 +00:00
\begin_inset Formula $\varphi$
\end_inset
2022-12-11 16:12:05 +00:00
at (0.3) of its way along the shaft might as well have been produced by adding to the regular arrow
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
ar[dr]
\family default
an invisible
\begin_inset Formula $\varphi$
\end_inset
-labelled arrow
\family typewriter
\backslash
ar@{}[dr(0.6)]^
\backslash
varphi
\family default
2022-12-11 16:12:05 +00:00
,
reaching only 0.6 of the way.
2008-10-22 22:39:56 +00:00
Its label will now appear at 0.3 of the way of the original visible arrow.
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
This workaround has two minor drawbacks:
First,
it does not work with bending arrows.
Secondly,
prolonging an invisible arrow beyond the normal dimension of the figure will invisibly extend the figure box,
and thereby cause too much vertical space between the figure and the preceding or the following paragraph.
2008-10-22 22:39:56 +00:00
\end_layout
\begin_layout Standard
2022-12-11 16:12:05 +00:00
Nevertheless,
invisible arrows are an important tool,
since they can,
in principle,
be used to place information at any chosen place in a diagram.
In the above figure,
for instance,
we have used an invisible arrow to carry the
2008-10-22 22:39:56 +00:00
\family typewriter
\backslash
vdots
\family default
2022-12-11 16:12:05 +00:00
as label and at the earlier figure we had used an invisible arrow to carry the text
2008-10-22 22:39:56 +00:00
\begin_inset Quotes eld
\end_inset
\family typewriter
horizontal stretch
\family default
\begin_inset Quotes erd
\end_inset
into the center of the figure.
\end_layout
2009-02-16 23:38:01 +00:00
\begin_layout Subsection
2009-02-25 01:45:43 +00:00
Further
\family typewriter
Xy
\family default
-tricks
2009-02-16 23:38:01 +00:00
\end_layout
\begin_layout Standard
2009-02-25 01:45:43 +00:00
Here we have focused only on the
\family typewriter
2009-02-16 23:38:01 +00:00
\backslash
2009-02-25 01:45:43 +00:00
xymatrix
\family default
2022-12-11 16:12:05 +00:00
command,
which is just one of the features available in Kris Rose's amazing
2009-02-25 01:45:43 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2009-02-16 23:38:01 +00:00
\begin_layout Plain Layout
2009-02-25 01:45:43 +00:00
\backslash
Xy
\end_layout
\end_inset
-package.
The
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2009-02-25 01:45:43 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2009-11-24 14:28:44 +00:00
-pic manual
2009-02-25 01:45:43 +00:00
\begin_inset CommandInset citation
LatexCommand cite
key "xypic manual"
2017-04-24 04:03:19 +00:00
literal "true"
2009-02-25 01:45:43 +00:00
\end_inset
demonstrates many of the advanced possibilities of that package.
2022-12-11 16:12:05 +00:00
Beware,
that its style is rather terse and you will likely need a lot of experimenting and modifying the many worked examples.
2009-02-25 01:45:43 +00:00
Lauda
\begin_inset CommandInset citation
LatexCommand cite
key "Lauda"
2017-04-24 04:03:19 +00:00
literal "true"
2009-02-25 01:45:43 +00:00
\end_inset
explains how to use
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2009-02-25 01:45:43 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2022-12-11 16:12:05 +00:00
-pic to make braids,
cobordism,
string diagrams,
and much more.
2010-03-28 22:19:31 +00:00
You might want to look on
\family typewriter
2020-08-05 13:05:52 +00:00
Instant_Preview.lyx
2010-03-28 22:19:31 +00:00
\family default
2016-01-13 01:51:42 +00:00
example shipped with \SpecialChar LyX
2022-12-11 16:12:05 +00:00
,
which demonstrates how to use more advanced
2010-03-28 22:19:31 +00:00
\begin_inset ERT
2010-04-01 23:44:38 +00:00
status collapsed
2010-03-28 22:19:31 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
-commands via
\family typewriter
2016-01-13 01:51:42 +00:00
\SpecialChar TeX
2014-03-29 04:08:01 +00:00
\begin_inset space ~
\end_inset
Code
2010-03-28 22:19:31 +00:00
\family default
and
\family typewriter
Instant preview
\family default
insets.
2013-02-16 20:49:57 +00:00
\end_layout
\begin_layout Standard
\begin_inset Newpage newpage
\end_inset
2009-02-25 01:45:43 +00:00
2013-02-16 20:49:57 +00:00
\end_layout
\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "xypic manual"
2017-04-24 04:03:19 +00:00
literal "true"
2013-02-16 20:49:57 +00:00
\end_inset
Kristoffer H.
2022-12-11 16:12:05 +00:00
Rose:
2009-02-25 01:45:43 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2009-02-25 01:45:43 +00:00
\begin_layout Plain Layout
\backslash
Xy
2009-02-16 23:38:01 +00:00
\end_layout
\end_inset
2009-02-25 01:45:43 +00:00
2013-02-16 20:49:57 +00:00
\emph on
-pic User's Guide
\emph default
.
\begin_inset Newline newline
\end_inset
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
2024-10-10 13:56:07 +00:00
https://mirrors.ctan.org/macros/generic/diagrams/xypic/doc/xyguide.pdf
2013-02-16 20:49:57 +00:00
\end_layout
2009-02-25 01:45:43 +00:00
\end_inset
2013-02-16 20:49:57 +00:00
2009-02-16 23:38:01 +00:00
\end_layout
2008-10-22 22:39:56 +00:00
\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
2013-02-16 20:49:57 +00:00
key "xypic reference"
2017-04-24 04:03:19 +00:00
literal "true"
2008-10-22 22:39:56 +00:00
\end_inset
Kristoffer H.
2022-12-11 16:12:05 +00:00
Rose and Ross Moore:
2008-10-22 22:39:56 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2008-10-22 22:39:56 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
\emph on
2013-02-16 20:49:57 +00:00
-pic Reference Manual
2008-10-22 22:39:56 +00:00
\emph default
.
2013-02-16 20:49:57 +00:00
\begin_inset Newline newline
2008-10-22 22:39:56 +00:00
\end_inset
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
2024-10-09 15:43:23 +00:00
https://mirrors.ctan.org/macros/generic/diagrams/xypic/doc/xyrefer.pdf
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
\end_layout
\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "xypic"
2017-04-24 04:03:19 +00:00
literal "true"
2008-10-22 22:39:56 +00:00
\end_inset
2013-02-16 20:49:57 +00:00
Homepage of the package
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
2008-10-22 22:39:56 +00:00
2013-02-16 20:49:57 +00:00
\emph on
-pic
\emph default
2022-12-11 16:12:05 +00:00
:
2008-10-22 22:39:56 +00:00
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
2020-08-02 18:51:42 +00:00
https://www.ctan.org/pkg/xypic
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
\end_layout
\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
2013-02-16 20:49:57 +00:00
key "instant-preview"
2017-04-24 04:03:19 +00:00
literal "true"
2013-02-16 20:49:57 +00:00
\end_inset
2008-10-22 22:39:56 +00:00
2013-02-16 20:49:57 +00:00
Homepage of preview-latex:
\begin_inset Newline newline
2008-10-22 22:39:56 +00:00
\end_inset
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
2020-08-02 18:51:42 +00:00
https://www.gnu.org/software/auctex/preview-latex.html
2008-10-22 22:39:56 +00:00
\end_layout
\end_inset
2009-02-25 01:45:43 +00:00
\end_layout
\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
2013-02-16 20:49:57 +00:00
key "AUCTeX"
2017-04-24 04:03:19 +00:00
literal "true"
2009-02-25 01:45:43 +00:00
\end_inset
2016-01-13 01:51:42 +00:00
Homepage of AUC\SpecialChar TeX
2022-12-11 16:12:05 +00:00
:
2009-02-25 01:45:43 +00:00
\begin_inset Flex URL
2010-03-28 22:19:31 +00:00
status collapsed
2009-02-25 01:45:43 +00:00
\begin_layout Plain Layout
2020-08-02 18:51:42 +00:00
https://www.gnu.org/software/auctex/
2009-02-25 01:45:43 +00:00
\end_layout
\end_inset
\end_layout
\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
2013-02-16 20:49:57 +00:00
key "Lauda"
2017-04-24 04:03:19 +00:00
literal "true"
2009-02-25 01:45:43 +00:00
\end_inset
2022-12-11 16:12:05 +00:00
Aaron Lauda:
2009-02-25 01:45:43 +00:00
\begin_inset ERT
2009-08-25 11:31:03 +00:00
status collapsed
2009-02-25 01:45:43 +00:00
\begin_layout Plain Layout
\backslash
Xy
\end_layout
\end_inset
\emph on
2009-11-24 14:28:44 +00:00
-pic
2009-02-25 01:45:43 +00:00
\emph default
2013-02-16 20:49:57 +00:00
2009-02-25 01:45:43 +00:00
\emph on
2013-02-16 20:49:57 +00:00
tutorial with an archive of examples
2009-02-25 01:45:43 +00:00
\emph default
.
2013-02-16 20:49:57 +00:00
\begin_inset Newline newline
\end_inset
2009-02-25 01:45:43 +00:00
\begin_inset Flex URL
2020-08-02 18:51:42 +00:00
status collapsed
2009-02-25 01:45:43 +00:00
\begin_layout Plain Layout
2022-12-11 16:12:05 +00:00
https://web.archive.org/web/20080222044349/https://www.dpmms.cam.ac.uk/~al366/xytutorial.html
2009-02-25 01:45:43 +00:00
\end_layout
\end_inset
2008-10-22 22:39:56 +00:00
\end_layout
\end_body
\end_document