-#LyX 1.6.0 created this file. For more info see http://www.lyx.org/
+#LyX 1.6.3svn created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
% the documentation team
% email: lyx-docs@lists.lyx.org
-
% if pdflatex is used
\usepackage{ifpdf}
\ifpdf
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
+
\graphics default
\paperfontsize 12
\spacing single
\bullet 3 2 7 -1
\tracking_changes false
\output_changes false
-\author ""
-\author ""
+\author ""
+\author ""
\end_header
\begin_body
\family sans
-Version 1.6.0
+Version 2.0.x
\end_layout
\begin_layout Standard
This mode is invoked with the the shortcut
\begin_inset Info
type "shortcut"
-arg "math-mode"
+arg "font-default"
\end_inset
or by the insertion of the command
\series bold
\backslash
-cfrac{A
-\begin_inset Formula $\to$
-\end_inset
+cfrac
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
\backslash
-{B+
+spce
+\end_layout
+
+\end_inset
+
+A
+\begin_inset Formula $\downarrow$
+\end_inset
+
+B+
\backslash
-cfrac{C+
+cfrac
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
\backslash
-cfrac{E
-\begin_inset Formula $\to$
+spce
+\end_layout
+
\end_inset
+C+
+\backslash
+cfrac
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
\backslash
-{F
-\begin_inset Formula $\to\to$
+spce
+\end_layout
+
\end_inset
+E
+\begin_inset Formula $\downarrow$
+\end_inset
-\backslash
-{D
+F
+\begin_inset Formula $\downarrow$
+\end_inset
+
+D
\end_layout
\begin_layout Standard
\series default
sets the fraction always in the size of a displayed formula, also when
it is part of another fraction.
+\end_layout
+
+\begin_layout Standard
+It is possible to specify the alignment of the numerator.
+ The command
+\series bold
+
+\backslash
+cfracleft
+\series default
+ is used to left align it, the command
+\series bold
+
+\backslash
+cfracright
+\series default
+ to right-align it.
\series bold
\backslash
cfrac
\series default
- has the following command scheme:
+ centers the numerator.
+ These fractions demonstrate the different alignments:
\end_layout
\begin_layout Standard
+\begin_inset Formula $\cfrac[l]{A}{B+C}$
+\end_inset
+
+,
+\begin_inset Formula $\cfrac{A}{B+C}$
+\end_inset
+
+,
+\begin_inset Formula $\cfrac[r]{A}{B+C}$
+\end_inset
-\series bold
-\backslash
-cfrac[numerator position]{numerator}{denominator}
\end_layout
\begin_layout Standard
-The numerator position can be
-\emph on
-l
-\emph default
- ,
-\emph on
-c
-\emph default
-, or
-\emph on
-r
-\emph default
- .
- l or r aligns the numerator to the left or right, resp.
-\begin_inset space ~
-\end_inset
+\begin_inset Note Greyedout
+status open
-with the fraction stroke.
- When
-\emph on
-c
-\emph default
- or no position is given, the numerator appears centered.
- These fractions demonstrate the different alignments:
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
+\series bold
+Note:
+\series default
+
+\series bold
+\backslash
+cfracleft
+\series default
+ and
\series bold
-\begin_inset Formula $\cfrac[l]{A}{B+C}$
-\end_inset
+\backslash
+cfracright
+\series default
+ are no real LaTeX commands but represent the command
+\series bold
-,
-\begin_inset Formula $\cfrac{A}{B+C}$
-\end_inset
+\backslash
+cfrac[alignment]{numerator}{denominator}
+\series default
+ .
+ Therefore you cannot use them in TeX code.
+\end_layout
-,
-\begin_inset Formula $\cfrac[r]{A}{B+C}$
\end_inset
\end_inset
-\begin_inset Newline newline
-\end_inset
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
-Note that
+\series bold
+Note:
+\series default
+
\series bold
\backslash
\backslash
unitfrac[number]{numerator}{denominator}
\series default
-, therefore you cannot use it in TeX code.
+ .
+ Therefore you cannot use it in TeX code.
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout Standard
\end_inset
).
- A blue
+ A
\begin_inset Quotes eld
\end_inset
-\series bold
\color blue
\begin_inset ERT
\end_inset
-\series default
\color inherit
\begin_inset Quotes erd
\end_layout
\begin_layout Standard
-Space with a defined length can be inserted in LyX with the command
-\begin_inset Newline newline
-\end_inset
-
-
+Space with a defined length can be inserted with the command
\series bold
\backslash
-hspace{length}
+hspace
\series default
\begin_inset Index
\end_inset
.
- For the length all units listed in
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "tab:Available-units"
+ Then a long
+\begin_inset Quotes eld
+\end_inset
+
+
+\color blue
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+spce
+\end_layout
+
+\end_inset
+
+\color inherit
+
+\begin_inset Quotes erd
\end_inset
- are allowed, except of the unit
+ appears.
+ The length can be specified by left-clicking on the
\begin_inset Quotes eld
\end_inset
-mu
+
+\color blue
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+spce
+\end_layout
+
+\end_inset
+
+
+\color inherit
+
\begin_inset Quotes erd
\end_inset
\begin_inset Text
\begin_layout Plain Layout
-Command
+Command (
+\backslash
+hspace length)
\end_layout
\end_inset
\begin_layout Plain Layout
A=B
\backslash
-hspace{3cm
+hspace
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+spce
+\end_layout
+
+\end_inset
+
+
\begin_inset Formula $\to$
\end_inset
A
\backslash
-not=C
+not=C (3
+\begin_inset space \thinspace{}
+\end_inset
+
+cm)
\end_layout
\end_inset
\begin_layout Plain Layout
A
\backslash
-hspace{-1mm
+hspace
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+spce
+\end_layout
+
+\end_inset
+
+
\begin_inset Formula $\to$
\end_inset
A
\backslash
-not=A
+not=A (-1
+\begin_inset space \thinspace{}
+\end_inset
+
+mm)
\end_layout
\end_inset
Space
\family default
-, what is not possible in formulas:
+:
\end_layout
\begin_layout Standard
\begin_layout Plain Layout
-\backslash
-sum
-\begin_inset Index
-status collapsed
-
-\begin_layout Plain Layout
-Commands ! S !
-\backslash
-sum
-\end_layout
-
-\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
-\begin_inset Formula $\sum$
-\end_inset
-
-
-\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
-
\backslash
int
\begin_inset Index
\begin_layout Plain Layout
\backslash
-intop
+oint
\end_layout
\end_inset
\begin_inset Text
\begin_layout Plain Layout
-\begin_inset Formula $\intop$
+\begin_inset Formula $\oint$
\end_inset
\begin_layout Plain Layout
\backslash
-oint
+ointctrclockwise
\end_layout
\end_inset
\begin_inset Text
\begin_layout Plain Layout
-\begin_inset Formula $\oint$
+\begin_inset Formula $\ointctrclockwise$
\end_inset
\begin_layout Plain Layout
\backslash
-ointop
+ointclockwise
\end_layout
\end_inset
\begin_inset Text
\begin_layout Plain Layout
-\begin_inset Formula $\ointop$
+\begin_inset Formula $\ointclockwise$
\end_inset
\begin_layout Plain Layout
\backslash
-ointctrclockwise
+sqint
\end_layout
\end_inset
\begin_inset Text
\begin_layout Plain Layout
-\begin_inset Formula $\ointctrclockwise$
+\begin_inset Formula $\sqint$
\end_inset
\begin_layout Plain Layout
\backslash
-ointclockwise
+fint
\end_layout
\end_inset
\begin_inset Text
\begin_layout Plain Layout
-\begin_inset Formula $\ointclockwise$
+
+\begin_inset Formula $\fint$
\end_inset
\begin_layout Plain Layout
\backslash
-sqint
+landupint
\end_layout
\end_inset
\begin_inset Text
\begin_layout Plain Layout
-\begin_inset Formula $\sqint$
+
+\begin_inset Formula $\landupint$
+\end_inset
+
+
+\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
+
+\backslash
+landdownint
+\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
+
+\begin_inset Formula $\landdownint$
\end_inset
\begin_inset Tabular
-<lyxtabular version="3" rows="10" columns="2">
+<lyxtabular version="3" rows="11" columns="2">
<features>
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
\begin_layout Plain Layout
+\backslash
+sum
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+Commands ! S !
+\backslash
+sum
+\end_layout
+
+\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
+\begin_inset Formula $\sum$
+\end_inset
+
+
+\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
+
\backslash
prod
\begin_inset Index
\end_layout
\begin_layout Standard
-The operators
+For all integral operators there is a second version available, ending on
+
+\series bold
+op
+\series default
+:
\series bold
\backslash
intop
\series default
- and
+,
\series bold
\backslash
ointop
\series default
- are different from
+ etc..
+ These operators are different from
\series bold
\backslash
int
\series default
- and
-\series bold
-
-\backslash
-oint
-\series default
-, resp.
-\begin_inset space ~
+ etc.
+\begin_inset space \space{}
\end_inset
in the style the operator limits are displayed, see
\begin_layout Standard
Limits of inline formulas are set right beside the operator.
Limits in displayed formulas are set above or below the operator, except
- of integral limits.
+ for integral limits.
\end_layout
\begin_layout Standard
\end_inset
-For integrals, except of
+For integrals, except those ending with
+\series bold
+op
+\series default
+ like
\series bold
\backslash
intop
\series default
- and
+,
\series bold
\backslash
ointop
\series default
-, the limits are by default set beside the operator.
+ etc., the limits are by default set beside the operator.
But for multiple integrals the limits are often set below the operator.
In the following example the limits type was therefore set to
\series bold
\series default
\series bold
-m
+M
\backslash
tiny
\begin_inset ERT
A
\backslash
,
-\begin_inset Formula $\underbrace{\textrm{sgn}}_{\textrm{Alt-m}\,\textrm{m}}$
+\begin_inset Formula $\underbrace{\textrm{sgn}}_{\textrm{Alt+M}\,\textrm{M}}$
\end_inset
(x)+B
status collapsed
\begin_layout Plain Layout
-
-\series bold
-
-\backslash
-hspace
-\series default
- and
+The space and
\series bold
\backslash
status collapsed
\begin_layout Plain Layout
+The space of 0
+\begin_inset space \thinspace{}
+\end_inset
-\series bold
-
-\backslash
-hspace{0mm}
-\series default
- is used for separation, because otherwise the output will be ¡ and ¿ respective
-ly.
+mm is used for separation, because otherwise the output will be ¡ and ¿
+ respectively.
\end_layout
\end_inset
When one side of the equation is much shorther than the line width, this
one is chosen for the left side and the right side is typeset over two
lines:
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
-\end_inset
-
-
\begin_inset Formula \begin{eqnarray}
H & = & W_{SB}+W_{mv}+W_{D}-\frac{\hbar^{2}}{2m_{0}}\Delta-\frac{\hbar^{2}}{2m_{1}}\Delta_{1}-\frac{\hbar^{2}}{2m_{2}}\Delta_{2}-\frac{e^{2}}{4\pi\varepsilon_{0}|\mathbf{r}-\mathbf{R}_{1}|}\nonumber \\
- & & -\hspace{3pt}\frac{e^{2}}{4\pi\varepsilon_{0}|\mathbf{r}-\mathbf{R}_{2}|}+\frac{e^{2}}{4\pi\varepsilon_{0}|\mathbf{R}_{1}-\mathbf{R}_{2}|}\label{eq:kurzlang}\end{eqnarray}
+ & & -\hspace{3pt}\frac{e^{2}}{4\pi\varepsilon_{0}|\mathbf{r}-\mathbf{R}_{2}|}+\frac{e^{2}}{4\pi\varepsilon_{0}|\mathbf{R}_{1}-\mathbf{R}_{2}|}\label{eq:shortlong}\end{eqnarray}
\end_inset
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-smallskip
-\end_layout
-
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
The minus sign at the beginning of the second line does normally not appear
as operator because it is the first character of the line.
Thus it would not be surrounded by space and could not be distinguished
from the fraction bar.
- To avoid this, space was inserted behind the minus sign with the command
-
+ To avoid this, 3
+\begin_inset space \thinspace{}
+\end_inset
+
+pt space was inserted behind the minus sign with the command
\series bold
\backslash
-hspace{3pt}
+hspace
\series default
-
+.
\begin_inset Foot
status collapsed
\end_inset
-.
+
\end_layout
\begin_layout Itemize
is used.
It is inserted to the first column of the first line and effects that all
further insertions overwrite the following columns:
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
-\end_inset
-
-
\begin_inset Formula \begin{eqnarray}
\lefteqn{4x^{2}\left(B^{2}+x_{0}^{2}\right)+4x_{0}x\left(D-B^{2}\right)+B^{2}\left(B^{2}-2r_{g}^{2}+2x_{0}^{2}-2r_{k}^{2}\right)+D^{2}}\nonumber \\
& & -\hspace{3pt}B^{2}-2B\sqrt{r_{g}^{2}-x^{2}+2x_{0}x-x_{0}^{2}}+r_{g}^{2}-x^{2}+2x_{0}x-x_{0}^{2}\nonumber \\
\end_inset
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-smallskip
-\end_layout
-
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
After the insertion of
\series bold
, the cursor is in a purple box that is a bit shifted to the left from the
blue one.
In this the formula is inserted.
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
-\end_inset
-
-
\begin_inset Newline newline
\end_inset
The content of the further lines is inserted to the second or another formula
column.
The greater the column number where it was inserted, the larger the indentation.
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
As example formula
\begin_inset CommandInset ref
LatexCommand eqref
-reference "eq:kurzlang"
+reference "eq:shortlong"
\end_inset
\end_layout
\begin_layout Standard
-Except of inline formulas, all formulas can be numbered with two different
+Except for inline formulas, all formulas can be numbered with two different
styles, see
\begin_inset CommandInset ref
LatexCommand ref
\backslash
roman{equation}
\series default
-
+.
\begin_inset Foot
status collapsed
that is described in
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:User-defined-Commands"
+reference "sub:The-Command-newcommand"
\end_inset
\end_inset
-.
\series bold
equation
\begin_layout Section
User-defined Commands
-\begin_inset CommandInset label
-LatexCommand label
-name "sec:User-defined-Commands"
-
-\end_inset
-
-
\begin_inset Index
status collapsed
\end_layout
\begin_layout Standard
-Many LaTeX-commands are too long to be used frequently.
- But it is possible to define with the command
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Plain Layout
+
\series bold
+Note:
+\series default
+ The names of user-defined commands and macros may only consist of Latin
+ letters.
+\end_layout
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+The Command
\backslash
newcommand
-\series default
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:The-Command-newcommand"
+
+\end_inset
+
+
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+User-defined commands !
+\backslash
+newcommand
+\end_layout
+
+\end_inset
+
\begin_inset Index
status collapsed
\end_inset
+
+\end_layout
+
+\begin_layout Standard
+Many LaTeX-commands are too long to be used frequently.
+ But it is possible to define with the command
+\series bold
+
+\backslash
+newcommand
+\series default
new shorter commands.
\end_layout
\end_inset
-\end_layout
-
-\begin_layout Standard
-\begin_inset Note Greyedout
-status open
-
-\begin_layout Plain Layout
-
-\series bold
-Note:
-\series default
- The names of user-defined commands may only consist of Latin letters.
-\end_layout
-
-\end_inset
-
-
\end_layout
\begin_layout Standard
Longrightarrow
\series default
, the LaTeX-preamble line is:
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
-\series bold
-
\begin_inset Newline newline
\end_inset
+\series bold
+
\backslash
newcommand{
\backslash
\series default
, the argument (that should be underlined) must be taken into account.
For this the preamble line is:
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
-\series bold
-
\begin_inset Newline newline
\end_inset
+\series bold
+
\backslash
newcommand{
\backslash
underline{#1}}
\series default
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
-\series bold
-
\begin_inset Newline newline
\end_inset
-
-\series default
The character
\series bold
#
fb
\series default
:
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
-\series bold
-
\begin_inset Newline newline
\end_inset
+\series bold
+
\backslash
newcommand{
\backslash
framebox#1#2{$#3$}}
\series default
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
-\series bold
-
\begin_inset Newline newline
\end_inset
-
-\series default
The two Dollar signs creates the extra formula needed for
\series bold
\series default
where the color for the box needn't to be specified, the argument for the
color is defined optional:
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
-\series bold
-
\begin_inset Newline newline
\end_inset
+\series bold
+
\backslash
newcommand{
\backslash
fcolorbox{#2}{#1}{$#3$}}
\series default
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-medskip
-\end_layout
-
+\begin_inset VSpace medskip
\end_inset
\end_inset
+\end_layout
+
+\begin_layout Subsection
+Math Macros
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+User-defined commands! Math macros
+\end_layout
+
+\end_inset
+
+
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+Macros
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+User-defined commands are especially convenient for complex expressions.
+ When you are for example dealing in a document with quadratic equations,
+ the same solution type occurs several times.
+ The general form of a quadratic equation is
+\begin_inset Formula \[
+0=\lambda^{2}+p\lambda+q\]
+
+\end_inset
+
+The general form of the solution is
+\begin_inset Formula \[
+\lambda_{1,2}=-\frac{p}{2}\pm\sqrt{\frac{p²}{4}-q}\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+To define a command for the solution formula where only the three parameters
+
+\begin_inset Formula $\lambda$
+\end_inset
+
+,
+\begin_inset Formula $p$
+\end_inset
+
+, and
+\begin_inset Formula $q$
+\end_inset
+
+ need to be specified and the index of
+\begin_inset Formula $\lambda$
+\end_inset
+
+ can be given optionally, the LaTeX-preamble line is
+\begin_inset Newline newline
+\end_inset
+
+
+\series bold
+
+\backslash
+newcommand{
+\backslash
+qG}[4][1,
+\backslash
+,2]{#2_{#1}=-
+\backslash
+frac{#3}{2}
+\backslash
+pm
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+hphantom{
+\end_layout
+
+\end_inset
+
+
+\backslash
+newcommand
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\backslash
+sqrt{
+\backslash
+frac{#3^{2}}{4}-#4}}
+\end_layout
+
+\begin_layout Standard
+To create with this the solution formula, the command
+\begin_inset Newline newline
+\end_inset
+
+
+\series bold
+
+\backslash
+qG{
+\backslash
+lambda
+\begin_inset Formula $\to$
+\end_inset
+
+
+\backslash
+{p
+\begin_inset Formula $\to$
+\end_inset
+
+
+\backslash
+{q
+\series default
+ is inserted to a formula
+\series bold
+.
+\end_layout
+
+\begin_layout Standard
+The definition of the new command is unintuitive because one has to know
+ the schemes of all used LaTeX commands, e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+that a fraction is inserted in LaTeX as
+\series bold
+
+\backslash
+frac{numerator}{denominator}
+\series default
+.
+ Furthermore one can easily forget a brace in the definition and cannot
+ see in LyX what the new command is doing.
+ To avoid these problems LyX offers the possibility to use math macros instead
+ of the command
+\series bold
+
+\backslash
+newcommand
+\series default
+.
+\end_layout
+
+\begin_layout Standard
+A math macro is created by using the menu
+\family sans
+Insert\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\family default
+ or the toolbar button
+\begin_inset Graphics
+ filename ../images/math-macro_newmacroname_newcommand.png
+ scale 85
+
+\end_inset
+
+.
+ The math macro toolbar appears together with the following box where the
+ macro is defined:
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset space \hspace*{\fill}
+\end_inset
+
+
+\begin_inset Graphics
+ filename clipart/macrobox.png
+
+\end_inset
+
+
+\begin_inset space \hspace*{\fill}
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset FormulaMacro
+\newcommand{\qG}[4][1,\,2]{#2_{#1}=-\frac{#3}{2}\pm\sqrt{\frac{#3^{2}}{4}-#4}}
+\end_inset
+
+
+\backslash
+newmacroname is the default name of the macro that should be changed to
+ something sensible.
+ The wanted formula is inserted in the first blue box.
+ An argument placeholder is inserted with the command
+\series bold
+
+\backslash
+#argumentnumber
+\series default
+, e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g
+\begin_inset space \space{}
+\end_inset
+
+
+\series bold
+
+\backslash
+#1
+\series default
+ or by using the macro toolbar button
+\begin_inset Graphics
+ filename ../images/math-macro-add-param.png
+ scale 85
+
+\end_inset
+
+.
+ Argument placeholders are displayed red.
+ Maximum 9 arguments are possible.
+ Optional arguments are created with the toolbar button
+\begin_inset Graphics
+ filename ../images/math-macro-add-optional-param.png
+ scale 85
+
+\end_inset
+
+.
+ The first non-optional argument can be transformed to an optional one with
+ the toolbar button
+\begin_inset Graphics
+ filename ../images/math-macro-make-optional.png
+ scale 85
+
+\end_inset
+
+.
+ In the second blue box the appearance of the macro in LyX can be defined.
+ Normally you want to see it as it is defined, so the box is kept empty.
+ But when you have created a macro that needs lot of space on the screen,
+ you can insert in the box for example
+\begin_inset Newline newline
+\end_inset
+
+
+\series bold
+qG:
+\backslash
+#1
+\series default
+
+\series bold
+,
+\series default
+
+\series bold
+
+\backslash
+#2
+\series default
+
+\series bold
+,
+\series default
+
+\series bold
+
+\backslash
+#3,
+\backslash
+#4
+\begin_inset Newline newline
+\end_inset
+
+
+\series default
+For the macro only the arguments with the macro name in front of them will
+ then be displayed in LyX, leading to a better overview.
+ The formula appears in the output as defined in the first box.
+\begin_inset Newline newline
+\end_inset
+
+The appearance of macros in formulas can furthermore be changed for single
+ macros by setting the cursor in the macro and using the menu
+\family sans
+View\SpecialChar \menuseparator
+(Un)fold
+\begin_inset space ~
+\end_inset
+
+Math
+\begin_inset space ~
+\end_inset
+
+Macro
+\family default
+.
+\end_layout
+
+\begin_layout Standard
+To use a macro, the macro name is inserted as command to a formula, in our
+ case
+\series bold
+
+\backslash
+qG
+\series default
+.
+ Our macro looks in LyX like this:
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset space \hspace*{\fill}
+\end_inset
+
+
+\begin_inset Graphics
+ filename clipart/macrouse.png
+
+\end_inset
+
+
+\begin_inset space \hspace*{\fill}
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Here is our macro example with the arguments
+\begin_inset Formula $x$
+\end_inset
+
+,
+\begin_inset Formula $\ln(x)$
+\end_inset
+
+, and
+\begin_inset Formula $B$
+\end_inset
+
+:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+\qG x{\ln(x)}B\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+A math macro is transformed internally to a
+\series bold
+
+\backslash
+newcommand
+\series default
+ command when exporting the document.
+ The created
+\series bold
+
+\backslash
+newcommand
+\series default
+ command is not placed in the LaTeX-preamble, therefore macros can only
+ be used in formulas that are in the document below the macro definition
+ box.
+\end_layout
+
+\begin_layout Standard
+Math macros can also be directly be created from a
+\series bold
+
+\backslash
+newcommand
+\series default
+ command.
+ When writing for example the command
+\series bold
+
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+newcommand{
+\backslash
+larrow}[2]{
+\backslash
+xleftarrow[#2]{#1}}
+\begin_inset Newline newline
+\end_inset
+
+
+\series default
+in LyX as normal text, highlighting it completely and using then the shortcut
+
+\family sans
+Ctrl+M
+\family default
+, the command will be transformed to a math macro.
+ Using this method you need to be careful that the
+\series bold
+
+\backslash
+newcommand
+\series default
+ command is typed correctly, otherwise you get a faulty macro leading to
+ LaTeX errors.
+\end_layout
+
+\begin_layout Standard
+Math macros currently yet have the problem that further formulas in macro
+ definitions are handled wrongly.
+ Therefore the example
+\series bold
+
+\backslash
+fb
+\series default
+ from
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:The-Command-newcommand"
+
+\end_inset
+
+ cannot be created as macro.
+\end_layout
+
+\begin_layout Standard
+When the cursor is in a macro definition box, you will see the macro toolbar
+ in LyX:
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace defskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Graphics
+ filename clipart/MacroToolbar.png
+
+\end_inset
+
+
+\begin_inset Index
+status collapsed
+
+\begin_layout Plain Layout
+Macros ! Toolbar
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace defskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The macro toolbar contains from left to right the following buttons:
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace defskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="9" columns="2">
+<features islongtable="true">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="85col%">
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-remove-param.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Remove Last Argument
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-add-param.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Append Argument
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-make-optional.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Make First Non-Optional into
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+hphantom{
+\end_layout
+
+\end_inset
+
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+Optional Argument
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-make-nonoptional.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Make Last Optional into
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+hphantom{
+\end_layout
+
+\end_inset
+
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+Non-Optional Argument
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-remove-optional-param.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Remove Optional Argument
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-add-optional-param.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Insert Optional Argument
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-remove-greedy-param.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Remove Last Argument
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+hphantom{
+\end_layout
+
+\end_inset
+
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+Spitting Out To The Right
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-append-greedy-param.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Append Argument
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+hphantom{
+\end_layout
+
+\end_inset
+
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+Eating From The Right
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row interlinespace="2.5mm">
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+ filename ../images/math-macro-add-greedy-optional-param.png
+ BoundingBox 0bp 5bp 20bp 25bp
+ rotateOrigin center
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\family sans
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+Append Optional Argument
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+
+\backslash
+hphantom{
+\end_layout
+
+\end_inset
+
+Edit\SpecialChar \menuseparator
+Math\SpecialChar \menuseparator
+Macro
+\begin_inset space ~
+\end_inset
+
+Definition\SpecialChar \menuseparator
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+Eating From The Right
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Newpage newpage
+\end_inset
+
+
\end_layout
\begin_layout Section
In contrary to amscd diagrams, xymatrices supports diagonal and curved arrows,
and much more.
All possibilities to create commutative diagrams and decorations are explained
- in detail in this manual:
-\begin_inset CommandInset href
-LatexCommand href
-target "http://wiki.lyx.org/LyX/XY-pic#xy-manual"
+ in detail in the
+\emph on
+XY-pic manual
+\emph default
+ that you find in the menu
+\family sans
+Help\SpecialChar \menuseparator
+Specific
+\begin_inset space ~
+\end_inset
+Manuals\SpecialChar \menuseparator
+XY-pic
+\begin_inset space ~
\end_inset
+Manual
+\family default
.
\end_layout
status collapsed
\begin_layout Plain Layout
-
-\series bold
-
-\backslash
-hspace
-\series default
- and
+The space and
\series bold
\backslash
\begin_inset Formula \begin{equation}
-S(t)=S_{0}(t)\int_{-\infty}^{\infty}P(\phi,t)\mathrm{e}^{\mathrm{i}\phi}\,\mathrm{d}\phi\label{eq:fouriertrafo}\end{equation}
+S(t)=S_{0}(t)\int_{-\infty}^{\infty}P(\phi,t)\mathrm{e}^{\mathrm{i}\phi}\,\mathrm{d}\phi\end{equation}
\end_inset