How to write a perfect equation parameters description?
Define your own environment for this; here I realize it as a two column alignment; the first column is typeset in math mode, the second one in text mode; the =
is added automatically, with the correct spacing.
\documentclass{article}
\usepackage{array}
\newenvironment{conditions}
{\par\vspace{\abovedisplayskip}\noindent\begin{tabular}{>{$}l<{$} @{${}={}$} l}}
{\end{tabular}\par\vspace{\belowdisplayskip}}
\begin{document}
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
where:
\begin{conditions}
P & notional permeability factor \\
N & number of waves \\
S_{d} & damage level
\end{conditions}
\end{document}
If your conditions are overlong, then you can use a different environment, that I call conditions*
, based on tabularx
:
\documentclass{article}
\usepackage{tabularx}
\newenvironment{conditions*}
{\par\vspace{\abovedisplayskip}\noindent
\tabularx{\columnwidth}{>{$}l<{$} @{${}={}$} >{\raggedright\arraybackslash}X}}
{\endtabularx\par\vspace{\belowdisplayskip}}
\begin{document}
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
where:
\begin{conditions*}
P & notional permeability factor and something
longer that needs to be taken at the next line\\
N & number of waves \\
S_{d} & damage level
\end{conditions*}
\end{document}
Variant for variable symbols
If different symbols are needed instead of =
in each line, here's how.
\documentclass{article}
\usepackage{array,tabularx}
\newenvironment{conditions}
{\par\vspace{\abovedisplayskip}\noindent
\begin{tabular}{>{$}l<{$} @{} >{${}}c<{{}$} @{} l}}
{\end{tabular}\par\vspace{\belowdisplayskip}}
\newenvironment{conditions*}
{\par\vspace{\abovedisplayskip}\noindent
\tabularx{\columnwidth}{>{$}l<{$} @{}>{${}}c<{{}$}@{} >{\raggedright\arraybackslash}X}}
{\endtabularx\par\vspace{\belowdisplayskip}}
\begin{document}
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
where:
\begin{conditions}
P & = & notional permeability factor \\
N & \sim & number of waves \\
S_{d} & \propto & damage level
\end{conditions}
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
where:
\begin{conditions*}
P & = & notional permeability factor and something
longer that needs to be taken at the next line\\
N & \sim & number of waves \\
S_{d} & \propto & damage level
\end{conditions*}
\end{document}
In order to have no break after “where:”, here's a variant of the first solution:
\documentclass{article}
\usepackage{array}
\newenvironment{conditions}[1][where:]
{#1 \begin{tabular}[t]{>{$}l<{$} @{${}={}$} l}}
{\end{tabular}\\[\belowdisplayskip]}
\begin{document}
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
\begin{conditions}
P & notional permeability factor \\
N & number of waves \\
S_{d} & damage level
\end{conditions}
Some text after the equation.
\end{document}
The conditions
environment has an optional argument for changing the fixed where:
; so, for instance, \begin{conditions}[with:]
will use “with:”.
A different version that allows for longer descriptions that needs to be wrapped across lines:
\documentclass{article}
\usepackage{array,tabularx,calc}
\newlength{\conditionwd}
\newenvironment{conditions}[1][where:]
{%
#1\tabularx{\textwidth-\widthof{#1}}[t]{
>{$}l<{$} @{${}={}$} X@{}
}%
}
{\endtabularx\\[\belowdisplayskip]}
\begin{document}
An equation just to start
\begin{equation}
P+N=S_{d}
\end{equation}
\begin{conditions}
P & notional permeability factor with some more text
so this ends up to break across lines blah blah
blah blah\\
N & number of waves \\
S_{d} & damage level
\end{conditions}
Some text after the equation.
\end{document}
As daleif suggested you could use the align* environment. You get the alignment just like in tables with '&'. Here is an example:
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{align*}
H_s &= \text{significant wave height, equal to the average of the highest 1/3 of
the waves}\\
\Delta &= \text{relative buoyant density, equal to }\rho_r\text{ / }\rho_w -
1\text{, where }\rho_w\text{ is the water density}\\
D_{n50} &= \text{nominal diameter defined in Equation \eqref{eq:dn50g50}}\\
P &= \text{notional permeability factor}\\
S_d &= \text{damage level}\\
N &= \text{number of waves}\\
\xi_m &= \text{breaker parameter based on mean wave period }T_m\\
\alpha &= \text{slope angle}
\end{align*}
\end{document}
This should work for you. This is the output:
If you don't want all equations to be aligned left, you can use the flalign* environment, like suggested here.
Another option is to use the tabbing
environmnent:
\begin{equation}
\frac{H_s}{\Delta D_{n50} } = 1.0~ P^{0.13}~ \left( \frac{S_d}{N} \right)^{0.2} \xi_m^P~ \sqrt{\cot \alpha}
\end{equation}
where:
\begin{tabbing}
\phantom{$D_{n50}\ $}\= \kill
$H_s$\> = significant wave height, equal to the average of the highest 1/3 of the waves\\
$\Delta$\> = relative buoyant density, equal to $\rho_r / \rho_w - 1$, where $\rho_w$ is the water density\\
$D_{n50}$\> = nominal diameter defined in Equation \eqref{eq:dn50g50}\\
$P$\> = notional permeability factor\\
$S_d$\> = damage level\\
$N$\> = number of waves\\
$\xi_m$\> = breaker parameter based on mean wave period $T_m$\\
$\alpha$\> = slope angle\\
\end{tabbing}
The first line in the tabbing environment will set the spacing (i.e. tabstop). The \kill
command suppresses the line it precedes, otherwise you would have an extra space between 'where:' and the first definition.
Alternatively, instead of \phantom{$D_{n50}\ $}
(the longest item on your list), you can use a fixed width: \hspace{3cm}
.