LaTeX workshop - Displays in more detail

Last edit

Changed:

< //page in preparation//

to

> Let us recall that the {{{equation}}} (or {{{equation*}}}) environment is used for typesetting a single equation in a separate line with an automatically generated number (the latter one omits the number of the formula).
> For equations that do not fit on a single line use the environments {{{align}}} ({{{align*}}}) or {{{multline}}} ({{{multline*}}}). Since the names of the commands speak for themselves, we shall pass to the following example:
> <LaTeX-source>
> \documentclass{article}
> \usepackage{amsmath}
> \begin{document}
> Using H\"older inequality we obtain
> \begin{align}
> \|f + g\|_2^2 & = \int |f + g|^2 \textup d\mu \leq \int (|f| + |g|)|f + g| \textup d\mu \\
> & = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \\
> & \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}\\
> & = \bigl(\|f\|_2 + \|g\|_2 \bigr)\frac{\|f + g\|_2^2}{\|f + g\|_2}.
> \end{align}
> \end{document}
> </LaTeX-source>
> The command which allows us to omit a number in a line is {{{\notag}}} (written at the end of the line, but before the "next line" command {{{\\}}}):
> <LaTeX-source>
> \documentclass{article}
> \usepackage{amsmath}
> \begin{document}
> Using H\"older inequality we obtain
> \begin{align}
> \|f + g\|_2^2 & = \int |f + g|^2 \textup d\mu \leq \int (|f| + |g|)|f + g| \textup d\mu \\
> & = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \notag \\
> & \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}\\
> & = \bigl(\|f\|_2 + \|g\|_2 \bigr)\frac{\|f + g\|_2^2}{\|f + g\|_2}. \notag
> \end{align}
> \end{document}
> </LaTeX-source>
> Note that when you use {{{align}}} environment, each line gets a number. If you would like the whole formula to be numbered as a one equation, you have to use {{{split}}} environment. (Remember that {{{split}}} is intended to be used only inside other "displayed equation" structures.)
> <LaTeX-source>
> \documentclass{article}
> \usepackage{amsmath}
> \begin{document}
> Using H\"older inequality we obtain
> \begin{align}
> \begin{split}
> \|f + g\|_2^2 & = \int |f + g|^2 \textup d\mu \leq \int (|f| + |g|)|f + g| \textup d\mu \\
> & = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \\
> & \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}\\
> & = \bigl(\|f\|_2 + \|g\|_2 \bigr)\frac{\|f + g\|_2^2}{\|f + g\|_2}.
> \end{split}
> \end{align}
> \end{document}
> </LaTeX-source>
> The second environment we are going to talk about is {{{multline}}}. The first line of a {{{multline}}} will be at the left margin and the last line at the right margin. Any additional lines in between will be centered within the display width.
> <LaTeX-source>
> \documentclass{article}
> \usepackage{amsmath}
> \begin{document}
> Using H\"older inequality we obtain
> \begin{multline}
> \|f + g\|_2^2 = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \\
> \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}
> \end{multline}
> from which follows our assertion.
> \end{document}
> </LaTeX-source>
> Since {{{multline}}} produces only one number (and thus none of the invidual lines should be marked with {{{\notag}}}), we cannot use the {{{split}}} environment inside it.


Let us recall that the equation (or equation*) environment is used for typesetting a single equation in a separate line with an automatically generated number (the latter one omits the number of the formula).

For equations that do not fit on a single line use the environments align (align*) or multline (multline*). Since the names of the commands speak for themselves, we shall pass to the following example:

\documentclass{article}

\usepackage{amsmath}

\begin{document}
Using H\"older inequality we obtain
\begin{align}   
 \|f + g\|_2^2 & = \int |f + g|^2 \textup d\mu \leq \int (|f| + |g|)|f + g| \textup d\mu \\
               & = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \\
               & \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}\\
               & = \bigl(\|f\|_2 + \|g\|_2 \bigr)\frac{\|f + g\|_2^2}{\|f + g\|_2}. 
\end{align} 
\end{document}

The command which allows us to omit a number in a line is \notag (written at the end of the line, but before the “next line” command \\):

\documentclass{article}

\usepackage{amsmath}

\begin{document}
Using H\"older inequality we obtain
\begin{align}   
 \|f + g\|_2^2 & = \int |f + g|^2 \textup d\mu \leq \int (|f| + |g|)|f + g| \textup d\mu \\
               & = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \notag \\ 
               & \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}\\
               & = \bigl(\|f\|_2 + \|g\|_2 \bigr)\frac{\|f + g\|_2^2}{\|f + g\|_2}. \notag 
\end{align} 
\end{document}

Note that when you use align environment, each line gets a number. If you would like the whole formula to be numbered as a one equation, you have to use split environment. (Remember that split is intended to be used only inside other “displayed equation” structures.)

\documentclass{article}

\usepackage{amsmath}

\begin{document}
Using H\"older inequality we obtain
\begin{align}
\begin{split}   
 \|f + g\|_2^2 & = \int |f + g|^2 \textup d\mu \leq \int (|f| + |g|)|f + g| \textup d\mu \\
               & = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \\ 
               & \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}\\
               & = \bigl(\|f\|_2 + \|g\|_2 \bigr)\frac{\|f + g\|_2^2}{\|f + g\|_2}.
\end{split}
\end{align} 
\end{document}

The second environment we are going to talk about is multline. The first line of a multline will be at the left margin and the last line at the right margin. Any additional lines in between will be centered within the display width.

\documentclass{article}

\usepackage{amsmath}

\begin{document}
Using H\"older inequality we obtain
\begin{multline}   
 \|f + g\|_2^2 = \int |f||f + g| \textup d\mu +\int |g||f + g| \textup d\mu \\
               \leq \biggl[ \biggl( \int |f|^2 \textup d\mu \biggr)^{1/2} + \biggl(\int |g|^2 \textup d\mu \biggr)^{1/2} \biggr] \biggl(\int |f + g|^2 \textup d\mu \biggr)^{1/2}
\end{multline}
from which follows our assertion.
\end{document}

Since multline produces only one number (and thus none of the invidual lines should be marked with \notag), we cannot use the split environment inside it.