# [Tex/LaTex] How to write a perfect equation parameters description

equationslists

Equation's symbols or parameters description are shown below, however, the = and the details of parameter are not aligned. I want to make a parameters list for a equation like this, in which symbols, = and detail information are aligned in terms of vertical position.

where
...
P   =   notional permeability factor
N   =   number of waves
Sd  =   damage level
...


A tabular environment will produce more spacing before and after text. So how to make the = vertical aligned?

The codes is provided:

\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:

$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 (2)

$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


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}[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}[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} 