-#LyX 2.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 462
+#LyX 2.2 created this file. For more info see http://www.lyx.org/
+\lyxformat 506
\begin_document
\begin_header
+\save_transient_properties true
+\origin /systemlyxdir/examples/
\textclass scrartcl
\begin_preamble
% DO NOT ALTER THIS PREAMBLE!!!
\language_package default
\inputencoding auto
\fontencoding global
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_math auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
+\font_sf_scale 100 100
+\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
+\use_package cancel 0
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
-\cite_engine_type numerical
+\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\end_inset
--pic in LyX
+-pic in \SpecialChar LyX
+
\end_layout
\begin_layout Author
\end_layout
\begin_layout Abstract
-With the recent versions of LyX and with the
+With the recent versions of \SpecialChar LyX
+ and with the
\family typewriter
preview
\family default
--style installed in the LaTeX-System, the graph drawing package
+-style installed in the \SpecialChar LaTeX
+-System, the graph drawing package
\family typewriter
\begin_inset ERT
\family default
--pic can be conveniently used inside LyX.
- Diagrams can be edited and displayed inside the main LyX editing window.
+-pic can be conveniently used inside \SpecialChar LyX
+.
+ Diagrams can be edited and displayed inside the main \SpecialChar LyX
+ editing window.
Here, we shall describe how to use the
\family typewriter
\family typewriter
xypic
\family default
- inside LyX in order to draw, to edit and to preview diagrams as typically
+ inside \SpecialChar LyX
+ in order to draw, to edit and to preview diagrams as typically
used in category theory, algebra, and related fields.
\end_layout
xypic
\family default
-package has long served as a convenient tool for easily constructing graphs
- and diagrams in LaTeX.
- Unfortunately, its use in LyX had long been restricted to the infamous
- TeX code boxes, meaning that the LyX editor could only display the LaTeX-source
- and not the finished diagram.
+ and diagrams in \SpecialChar LaTeX
+.
+ Unfortunately, its use in \SpecialChar LyX
+ had long been restricted to the infamous \SpecialChar TeX
+ code
+ boxes, meaning that the \SpecialChar LyX
+ editor could only display the \SpecialChar LaTeX
+-source and not
+ the finished diagram.
The new
\family typewriter
preview
\family default
--style of LaTeX which is part of the AUCTeX project
+-style of \SpecialChar LaTeX
+ which is part of the AUC\SpecialChar TeX
+ project
\begin_inset CommandInset citation
LatexCommand cite
key "AUCTeX"
\family typewriter
xypic
\family default
--diagrams, constructed, displayed and interactively edited inside LyX.
+-diagrams, constructed, displayed and interactively edited inside \SpecialChar LyX
+.
\end_layout
\begin_layout Standard
\end_inset
--pic can be used from inside LyX, how diagrams can be created and edited.
- We have tested the following using LyX versions 1.3.7 up to 1.6, running under
+-pic can be used from inside \SpecialChar LyX
+, how diagrams can be created and edited.
+ We have tested the following using \SpecialChar LyX
+ versions 1.3.7 up to 1.6, running under
Windows
\begin_inset space \thinspace{}
\end_inset
\end_inset
--pic code inside the LyX-window, select it all and convert it to a graphical
+-pic code inside the \SpecialChar LyX
+-window, select it all and convert it to a graphical
representation by pressing
\family sans
Ctrl-m
\end_inset
-pic more frequently, or if you want to modify your initial figure, you
- will want to assemble and modify your figures using LyX's math editor.
+ will want to assemble and modify your figures using \SpecialChar LyX
+'s math editor.
\end_layout
\end_layout
\begin_layout Standard
-In the first two sections of this documentation, we explain how to use LyX
+In the first two sections of this documentation, we explain how to use \SpecialChar LyX
+
in the first mentioned mode and we introduce all
\begin_inset ERT
status collapsed
\end_inset
-pic, rather our motivation is to give an introduction how the most important
- commands work inside LyX, since the keystrokes as explained in the
+ commands work inside \SpecialChar LyX
+, since the keystrokes as explained in the
\begin_inset ERT
status collapsed
\end_inset
- will not always function correctly inside LyX.
+ will not always function correctly inside \SpecialChar LyX
+.
\end_layout
\end_layout
\begin_layout Standard
-The following requires that the LaTeX-packages
+The following requires that the \SpecialChar LaTeX
+-packages
\family typewriter
xypic
\family default
\family typewriter
preview
\family default
- are installed in the LaTeX system.
+ are installed in the \SpecialChar LaTeX
+ system.
They are available from CTAN, see at
\begin_inset CommandInset citation
LatexCommand cite
.
After freshly installing them, it may be necessary, to run
\family sans
-Tools\SpecialChar \menuseparator
+Tools\SpecialChar menuseparator
Reconfigure
\family default
- from the main LyX menu.
- The steps to a first diagram output in LyX are then:
+ from the main \SpecialChar LyX
+ menu.
+ The steps to a first diagram output in \SpecialChar LyX
+ are then:
\end_layout
\begin_layout Enumerate
Activate and test
\family typewriter
preview
+\family default
+
+\begin_inset Separator parbreak
+\end_inset
+
+
\end_layout
\begin_deeper
\begin_layout Enumerate
-Open LyX, choose
+Open \SpecialChar LyX
+, choose
\family sans
-Tools\SpecialChar \menuseparator
-Preferences\SpecialChar \menuseparator
-Look and Feel\SpecialChar \menuseparator
+Tools\SpecialChar menuseparator
+Preferences\SpecialChar menuseparator
+Look and Feel\SpecialChar menuseparator
Display
\family default
and turn
\begin_layout Enumerate
In
\family sans
-Document\SpecialChar \menuseparator
-Settings\SpecialChar \menuseparator
+Document\SpecialChar menuseparator
+Settings\SpecialChar menuseparator
Math
\begin_inset space ~
\end_inset
\family typewriter
instant-preview
\family default
- works by opening a LyX-document and entering any math-formula, e.
+ works by opening a \SpecialChar LyX
+-document and entering any math-formula, e.
\begin_inset space \thinspace{}
\end_inset
-pic
\family typewriter
:
+\family default
+
+\begin_inset Separator parbreak
+\end_inset
+
+
\end_layout
\begin_deeper
\begin_layout Enumerate
-Inside your LyX-Document, enter the text
+Inside your \SpecialChar LyX
+-Document, enter the text
\family typewriter
\begin_inset Newline newline
\begin_layout Enumerate
Select the whole text and choose
\family sans
-Insert\SpecialChar \menuseparator
-Math\SpecialChar \menuseparator
+Insert\SpecialChar menuseparator
+Math\SpecialChar menuseparator
Display Formula
\family default
, or use the corresponding keyboard shortcut
\backslash
xymatrix{
\family default
- \SpecialChar \ldots{}
- up to the closing brace \SpecialChar \ldots{}
+ \SpecialChar ldots
+ up to the closing brace \SpecialChar ldots
\family typewriter
}
\end_layout
\begin_layout Standard
-The pattern should be familiar from LaTeX: We see three rows, the first
- two being terminated by the end-of-line-marker
+The pattern should be familiar from \SpecialChar LaTeX
+: We see three rows, the first two being
+ terminated by the end-of-line-marker
\family typewriter
\backslash
(.3)
\family default
.
- In LyX this works only for labels which are placed on top of the arrow,
- such as
+ In \SpecialChar LyX
+ this works only for labels which are placed on top of the arrow, such
+ as
\family typewriter
\backslash
\backslash
psi
\family default
- is not correctly interpreted by LyX's math editor.
+ is not correctly interpreted by \SpecialChar LyX
+'s math editor.
Two workarounds are suggested in the last section of this note.
\end_layout
\family typewriter
@
\family default
--sign and a pair of braces {\SpecialChar \ldots{}
+-sign and a pair of braces {\SpecialChar ldots
} containing characters describing the end,
the shaft and the tip of the arrow.
These characters are chosen to give some form of ASCII-rendering of the
\backslash
ar@{^(->}[r].
+\family default
+
+\begin_inset Separator parbreak
+\end_inset
+
+
\end_layout
\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="11" columns="2">
-<features rotate="0" tabularvalignment="middle">
+<features tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
-<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_inset Text
\begin_layout Plain Layout
-Source code in LyX
+Source code in \SpecialChar LyX
+
\end_layout
\end_inset
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:
+\begin_inset Separator parbreak
+\end_inset
+
+
\end_layout
\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="8" columns="2">
-<features rotate="0" tabularvalignment="middle">
-<column alignment="center" valignment="top" width="0">
-<column alignment="center" valignment="top" width="0">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top">
+<column alignment="center" valignment="top">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_inset Text
\begin_layout Plain Layout
-Source code for LyX
+Source code for \SpecialChar LyX
+
\end_layout
\end_inset
\family typewriter
\backslash
-ar@^{>\SpecialChar \textcompwordmark{}
->->\SpecialChar \textcompwordmark{}
+ar@^{>\SpecialChar ligaturebreak
+>->\SpecialChar ligaturebreak
>}
\end_layout
\backslash
ar@{-|>}[r]
\family default
- and which displays correctly in LyX as:
+ and which displays correctly in \SpecialChar LyX
+ as:
\begin_inset Formula
\[
\xymatrix{A\ar@{-|>}[r] & \ \ B}
\end_inset
.
- When their code is written inside LyX as above, select it and choose either
+ When their code is written inside \SpecialChar LyX
+ as above, select it and choose either
\family sans
Ctrl-m
Diagrams constructed inline can later be centered, or, conversely, centered
diagrams can be changed to inline formulas with
\family sans
-Edit\SpecialChar \menuseparator
+Edit\SpecialChar menuseparator
Math
\family default
\family sans
-\SpecialChar \menuseparator
+\SpecialChar menuseparator
Change Formula Type.
\end_layout
\end_inset
/ .
- The ellipsis stands for a TeX-measure which needs to be entered as a lower
+ The ellipsis stands for a \SpecialChar TeX
+-measure which needs to be entered as a lower
or upper index.
Whereas in
\family typewriter
\family typewriter
1pc
\family default
- downwards, this cannot directly be done in LyX.
+ downwards, this cannot directly be done in \SpecialChar LyX
+.
It is necessary, to enclose the measure in a pair of braces, such as e.
\begin_inset space \thinspace{}
\end_inset
\end_layout
\begin_layout Standard
-The LaTeX command
+The \SpecialChar LaTeX
+ command
\family typewriter
\backslash
entrymodifiers={
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
}
\end_layout
\begin_layout Section
-Using LyX's math editor
+Using \SpecialChar LyX
+'s math editor
\begin_inset CommandInset label
LatexCommand label
name "sec:math-editor"
\family sans
Ctrl-M
\family default
-, one may construct and modify the whole xypic-diagram inside LyX's math
- editor.
+, one may construct and modify the whole xypic-diagram inside \SpecialChar LyX
+'s math editor.
We describe the editing steps for a figure just like the one above.
\end_layout
\end_layout
\begin_layout Standard
-Recall that in LyX's math-editor any pair of braces
+Recall that in \SpecialChar LyX
+'s math-editor any pair of braces
\family typewriter
{
\family default
\family typewriter
@{
\family default
- \SpecialChar \ldots{}
+ \SpecialChar ldots
\family typewriter
}
\backslash
{
\family default
- and let LyX provide the closing brace and the box into which to enter the
+ and let \SpecialChar LyX
+ provide the closing brace and the box into which to enter the
description of the arrow.
\end_layout
At any time, further rows or columns can be entered or deleted using commands
available from
\family sans
-Edit\SpecialChar \menuseparator
+Edit\SpecialChar menuseparator
Math,
\family default
resp.
A more direct way uses the icons in the math toolbar once it has been activated
via
\family sans
-View\SpecialChar \menuseparator
+View\SpecialChar menuseparator
Toolbars.
\end_layout
\begin_layout Standard
Next, label the arrows by attaching a label text as upper or lower indices
to the end of the arrow's path.
- As always in LyX's math editor, an underscore
+ As always in \SpecialChar LyX
+'s math editor, an underscore
\family typewriter
_
\family default
^
\family default
followed by a space opens a box for an upper index.
- You can enter any LaTeX-code as a label.
+ You can enter any \SpecialChar LaTeX
+-code as a label.
\end_layout
\begin_layout Subsection
\family typewriter
@{
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
}
\family typewriter
@<
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
>,
\family typewriter
@(
\family default
-\SpecialChar \ldots{}
-,\SpecialChar \ldots{}
+\SpecialChar ldots
+,\SpecialChar ldots
) or
\family typewriter
@/
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
/
\backslash
{
\family default
- with the arrow description entered inside the LyX-supplied box.
+ with the arrow description entered inside the \SpecialChar LyX
+-supplied box.
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.
\family typewriter
@<
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
>
\family typewriter
@(
\family default
-\SpecialChar \ldots{}
-,\SpecialChar \ldots{}
+\SpecialChar ldots
+,\SpecialChar ldots
\family typewriter
)
\family typewriter
@/
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
/
\emph on
measure
\emph default
- is any valid TeX-measure that should be entered as upper or lower index
- to the first slash /.
+ is any valid \SpecialChar TeX
+-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.
\end_layout
\family sans
Ctrl+Z
\family default
-, or try to translate the LyX-file into
+, or try to translate the \SpecialChar LyX
+-file into
\family sans
DVI
\family default
\family default
or
\family sans
-View\SpecialChar \menuseparator
+View\SpecialChar menuseparator
DVI
\family default
.
\end_layout
\begin_layout Standard
-Certain things do not work correctly inside LyX.
+Certain things do not work correctly inside \SpecialChar LyX
+.
The ones that we (used to) miss most are the horizontal and vertical scaling
of diagrams, and the correct positioning of arrows.
There are some workarounds that we are explaining here.
\backslash
xymatrix@R=1pc{
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
}
\backslash
xymatrix@C=
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
{
\family default
-\SpecialChar \ldots{}
+\SpecialChar ldots
\family typewriter
}
\end_inset
into a formula to get the desired matrix because the @-character is interpreted
- by LyX as ending the
+ by \SpecialChar LyX
+ as ending the
\family typewriter
\backslash
.
So one can add the following macro to the preamble (
\family sans
-Layout\SpecialChar \menuseparator
-Document\SpecialChar \menuseparator
+Layout\SpecialChar menuseparator
+Document\SpecialChar menuseparator
Preamble
\family default
):
+\begin_inset Separator parbreak
+\end_inset
+
+
\end_layout
\begin_deeper
\family default
or both.
Don't forget the backslashes and remember, that the closing brace is automatica
-lly supplied by LyX.
+lly supplied by \SpecialChar LyX
+.
Inside the braces enter the dimensions.
\begin_inset Newline newline
\end_inset
\backslash
phi
\family default
-, does not work from inside LyX.
+, does not work from inside \SpecialChar LyX
+.
Instead, one has to replace the hat-symbol ^, resp.
the underscore _ , by the macros
\family typewriter
\family typewriter
inset_preview.lyx
\family default
- example shipped with LyX, which demonstrates how to use more advanced
+ example shipped with \SpecialChar LyX
+, which demonstrates how to use more advanced
\begin_inset ERT
status collapsed
-commands via
\family typewriter
-ERT
+\SpecialChar TeX
+
+\begin_inset space ~
+\end_inset
+
+Code
\family default
and
\family typewriter
\begin_layout Plain Layout
-http://mirrors.ctan.org/macros/generic/diagrams/xypic/xy/doc/xyguide.pdf
+https://www.ctan.org/tex-archive/macros/generic/diagrams/xypic/doc/xyguide.pdf
\end_layout
\end_inset
\begin_layout Plain Layout
-http://mirrors.ctan.org/macros/generic/diagrams/xypic/xy/doc/xyrefer.pdf
+https://www.ctan.org/tex-archive/macros/generic/diagrams/xypic/doc/xyrefer.pdf
\end_layout
\end_inset
\end_inset
-
-Homepage of
-\lang english
-AUCTeX:
+Homepage of AUC\SpecialChar TeX
+:
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
-http://www.math.columbia.edu/~lauda/xy/
+https://www.ctan.org/tex-archive/macros/generic/diagrams/xypic/doc/xyguide.pdf
\end_layout
\end_inset