diff options
Diffstat (limited to 'Master/texmf-doc/doc/english/mathmode/Mathmode.tex')
-rw-r--r-- | Master/texmf-doc/doc/english/mathmode/Mathmode.tex | 206 |
1 files changed, 188 insertions, 18 deletions
diff --git a/Master/texmf-doc/doc/english/mathmode/Mathmode.tex b/Master/texmf-doc/doc/english/mathmode/Mathmode.tex index 676c57619b5..252cde0fd91 100644 --- a/Master/texmf-doc/doc/english/mathmode/Mathmode.tex +++ b/Master/texmf-doc/doc/english/mathmode/Mathmode.tex @@ -13,7 +13,7 @@ %% DESCRIPTION: %% `Mathmode' is a document how the math mode works inside LaTeX %% -\def\MathmodeVersion{2.16} +\def\MathmodeVersion{2.18} %\ifvtex\title{\logo Math mode - v.\MathmodeVersion}\else \ifpdf\title{Math mode - v.\MathmodeVersion}\else \title{\logo Math mode - v.\MathmodeVersion}\fi%\fi @@ -25,12 +25,13 @@ Zongbao Fang; Azzam Hassam; Martin Hensel; Morten H\o{}gholm; M. Kalidoss; Dan Lasley; - Angus Leeming; Tim Love; + Angus Leeming; Tim Love; Dan Luecking; Hendrik Maryns; Heinz Mezera; David Neuway; Joachim Punter; Carl Riehm; Will Robertson; Christoph Rumsm\"uller; - Jos\'e{} Carlos Santos; Rainer Schöpf; Jens Schwaiger; Uwe Siart; Martin Sievers; Heiko Stamer; Uwe St\"ohr; + Jos\'e{} Carlos Santos; Arnaud Schmittbuhl; + Rainer Schöpf; Jens Schwaiger; Uwe Siart; Martin Sievers; Heiko Stamer; Uwe St\"ohr; Carsten Thiel; David Weenink; Zou Yuan-Chuan; @@ -61,9 +62,10 @@ facts in this paper. An advanced german version of this paper is available as a \vspace{3cm} \noindent Please report typos or any other comments to this documentation to \href{mailto:voss@perce.de}{voss@perce.de}. -\noindent This document was written with the \LaTeX{} editor \verb+Kile 1.8+ \verb+(Qt 3.3+ \verb+KDE 3.4)+ -\href{http://sourceforge.net/projects/kile/}{http://sourceforge.net/projects/kile/} and the PDF output -was built with the Linux version of \texttt{V\TeX/Free}, Version 8.46 +\noindent This document was written with the \LaTeX{} editor \verb+Kile 1.8+ +\verb+(Qt 3.3+ \verb+KDE 3.4)+ +\href{http://sourceforge.net/projects/kile/}{http://sourceforge.net/projects/kile/} +and the PDF output was built with the Linux version of \texttt{V\TeX/Free}, Version 8.46 (\href{http://www.micropress-inc.com/linux/}{http://www.micropress-inc.com/linux/}) This file can be redistributed and/or modified under the terms @@ -2869,8 +2871,8 @@ math. \section{\texttt{align} environments} There are four different align environments, described in the following -subsections. Their behaviour is shown in table \ref{cap:align}. The -code for all align environments was: +subsections. Their behaviour is shown in table \ref{cap:align}. The symbolic +code for all align environments is: \begin{lstlisting} \begin{<name>} @@ -2880,8 +2882,10 @@ code for all align environments was: \end{lstlisting} \begin{table}[htb] +\caption{Comparison between the different align environments +with the same code, where the first three can have an equation number}\label{cap:align} \begin{align*} -\framebox[0.125\columnwidth]{align} &= \framebox[0.125\columnwidth]{x} & \framebox[0.125\columnwidth]{x}&= & \framebox[0.125\columnwidth]{x}\\ +\framebox[0.125\columnwidth]{align} &= \framebox[0.125\columnwidth]{x} & \framebox[0.125\columnwidth]{x}&= \framebox[0.125\columnwidth]{x}\\ \framebox[0.125\columnwidth]{align}&= \framebox[0.1\columnwidth]{x} & \framebox[0.1\columnwidth]{x} &= \framebox[0.1\columnwidth]{x} \end{align*} @@ -2905,8 +2909,6 @@ code for all align environments was: \framebox[0.125\columnwidth]{xxalignat} &= \framebox[0.1\columnwidth]{x} & \framebox[0.1\columnwidth]{x} &= \framebox[0.1\columnwidth]{x} \end{xxalignat} -\caption{Comparison between the different align environments -with the same code, where the first three can have an equation number}\label{cap:align} \end{table} In difference to the \verb+eqnarray+ environment from standard \LaTeX{} @@ -3203,14 +3205,18 @@ The same code looks like: \end{equation} \end{lstlisting} -The \verb|aligned| environment is similar to the \verb|array|\index{array} environment, there exists no -starred version and it has only one equation number and has to be part of another math environment, which should be \verb|equation| environment. The advantage of \verb|aligned| is the much +The \verb|aligned| environment is similar to the \verb|array|\index{array} +environment, there exists no +starred version and it has only one equation number and has to be part of +another math environment, which should be \verb|equation| environment. +The advantage of \verb|aligned| is the much better horizontal and vertical spacing. %%% ----- Martin ----- \subsection{Problems} When using one of the \verb+align+ environments, there should be no \verb+\\+ at the -end of the last line, otherwise you'll get another equation number for this ``empty{}'' line: %%% ----- Martin ----- +end of the last line, otherwise you'll get another equation number for this +``empty{}'' line: %%% ----- Martin ----- \begin{showexample}[width=0.65\linewidth] \begin{align} @@ -3252,6 +3258,136 @@ exists. Look at section \vref{split} for an example. \end{itemize} +\subsection{\texttt{gathered} environment} +\marginpar{\CMD{begin\{gathered\}[c]\\...\\\CMD{end\{gathered\}}}} + +The \verb+gathered+ environment is like the \verb+aligned+ or \verb+alignedat+ +\index{gathered}\index{aligned}\index{alignedat} +environment. They use only so much horizontal space as the widest line needs. +In difference to the \verb+gather+ environment it must be itself inside the +math mode. +% +\begin{align} +\rule{2cm}{1pt} +\begin{gathered} +\quad i_{11}=0.25\\ +\quad i_{21}=\frac{1}{3}i_{11}\\ +\quad i_{31}=0.33i_{22} +\end{gathered} +\rule{2cm}{1pt} +\end{align} + +% +\begin{lstlisting} +\begin{align} +\rule{2cm}{1pt} +\begin{gathered} +\quad i_{11}=0.25\\ +\quad i_{21}=\frac{1}{3}i_{11}\\ +\quad i_{31}=0.33i_{22} +\end{gathered} +\rule{2cm}{1pt} +\end{align} +\end{lstlisting} +% + +The optional argument can be used for setting the vertical alignment which is +by default c (centered). It can also be t for top or b for bottom. + +\begin{align} +\rule{1cm}{1pt} +\begin{gathered}[t] +\quad A=a\\ +\quad B=b\\ +\quad C=c +\end{gathered} +% +\begin{gathered}[c] +\quad A=a\\ +\quad B=b\\ +\quad C=c +\end{gathered} +% +\begin{gathered}[b] +\quad A=a\\ +\quad B=b\\ +\quad C=c +\end{gathered} +\ \rule{1cm}{1pt} +\end{align} + +\begin{lstlisting} +\begin{align} +\rule{1cm}{1pt} +\begin{gathered}[t] +\quad A=a\\ +\quad B=b\\ +\quad C=c +\end{gathered} +% +\begin{gathered}[c] +\quad A=a\\ +\quad B=b\\ +\quad C=c +\end{gathered} +% +\begin{gathered}[b] +\quad A=a\\ +\quad B=b\\ +\quad C=c +\end{gathered} +\ \rule{1cm}{1pt} +\end{align} +\end{lstlisting} + + +When using a square bracket as first character inside the environment, then +everything is ignored by \AmS until a following closing bracket, because \AmS takes this +as an optional argument: +% +\begin{align} +\begin{gathered} +[A]\quad A=a\\ +[B]\quad B=b\\ +[C]\quad C=c +\end{gathered} +\end{align} +% +\begin{lstlisting} +\begin{align} +\begin{gathered} +[A]\quad A=a\\ +[B]\quad B=b\\ +[C]\quad C=c +\end{gathered} +\end{align} +\end{lstlisting} +% +The \verb+[A]+ is completely ignored, which can be avoided by using the +optional argument \verb+[c]+ or at least an empty one directly +after the \verb+\begin{gather}+. Another possibility is using the package \verb+empheq+, +which fixes this behaviour by default. +% +\begin{align} +\begin{gathered}[] +[A]\quad A=a\\ +[B]\quad B=b\\ +[C]\quad C=c +\end{gathered} +\end{align} +% +\begin{lstlisting} +\begin{align} +\begin{gathered}[] +[A]\quad A=a\\ +[B]\quad B=b\\ +[C]\quad C=c +\end{gathered} +\end{align} +\end{lstlisting} +% + + \subsection{\texttt{multline} environment} \marginpar{\CMD{begin\{multline\}\\...\\\CMD{end\{multline\}}}} This is also like a multi line% @@ -5220,14 +5356,15 @@ The following sections are not a replacement for the package documentation! \href{http://www.dante.de/CTAN//help/Catalogue/entries/icomma.html}{icomma}& \href{http://www.dante.de/CTAN//help/Catalogue/entries/leftidx.html}{leftidx}& \href{http://www.dante.de/CTAN//help/Catalogue/entries/mathdots.html}{mathdots}& -\href{http://www.dante.de/CTAN//help/Catalogue/entries/mathematica.html}{mathematica}\\ +\href{http://www.dante.de/CTAN//help/Catalogue/entries/mathtools.html}{mathtools}\\ +\href{http://www.dante.de/CTAN//help/Catalogue/entries/mathematica.html}{mathematica}& \href{http://www.dante.de/CTAN//help/Catalogue/entries/mil3.html}{mil3}& \href{http://www.dante.de/CTAN//help/Catalogue/entries/mtbe.html}{mtbe}& -\href{http://www.dante.de/CTAN//help/Catalogue/entries/nath.html}{Nath}& -\href{http://www.dante.de/CTAN//help/Catalogue/entries/numprint.html}{numprint}\\ +\href{http://www.dante.de/CTAN//help/Catalogue/entries/nath.html}{Nath}\\ +\href{http://www.dante.de/CTAN//help/Catalogue/entries/numprint.html}{numprint}& \href{http://www.dante.de/CTAN//help/Catalogue/entries/random.html}{random}& \href{http://www.dante.de/CTAN//help/Catalogue/entries/romannum.html}{romannum}& -\href{http://www.dante.de/CTAN//help/Catalogue/entries/texaide.html}{TeXaide}& +\href{http://www.dante.de/CTAN//help/Catalogue/entries/texaide.html}{TeXaide} \end{tabular} \end{center} @@ -5688,6 +5825,39 @@ installation, all symbols get the right size. \sum_{i=1}^{n}f\left(\cos\left(\frac{2i-1}{2n}\right)\right)\] \end{minipage}% +\section{\texttt{mathtools}}\label{sec:mathtools} +This package comes with a lot of additional features for setting math code. +Sometimes it is useful when only such equations are numbered which are +referenced in the text. This is possible with the switch \verb+\showonlyrefs+. + +Matrices are set by default with a centered horizontal alignment, which is +often not the best way. \verb+mathtools+ provides a starred version of +the matrix environments which allow an optional argument for the horizontal +alignment: + +\[ +\begin{pmatrix*}[r] + 1 & -1 & 0 \\ + -1 & 1 & -1 \\ + 1 & -1 & 0 \\ +-11 & 11 &-11 \\ +\end{pmatrix*} +\] + +\begin{lstlisting} +\[ +\begin{pmatrix*}[r] + 1 & -1 & 0 \\ + -1 & 1 & -1 \\ + 1 & -1 & 0 \\ +-11 & 11 &-11 \\ +\end{pmatrix*} +\] +\end{lstlisting} + +\verb+mathtools+ also provides a also some more environments for setting equations. + + \section{\texttt{relsize}}\label{sec:relsize} Often consecutives math operators are used, like two sum symbols, e.g.: \[ \sum\sum_{i=1}^n i^2 \] |