[Tex/LaTex] Equations and defining equation variables

alignequationsnumberingspacing

I have a main equation that should be numbered and now I want to define the variables of the equations which may contain another set of equations. For example please have a look;

code:

\begin{align}
\label{eq:2.1}
&\frac{J_1(a k s)}{\sqrt{\pi } s}
\end{align}
\begin{align*}
\text{where} ~& \text{\textsl{a} is lens radius}\\
& \textsl{k}=\frac{2 \pi }{\lambda }\\
& \textsl{s}=\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
\end{align*}

Result:

Result

As we can see there is more than 2 line spacing (white space ) between the Eqn 2.1 and the variable definitions … is there any other efficient way to define variables of equations without numbering them … Or sub equation them as 2.1.1 , 2.1.2 etc …

Best Answer

Option 1:

enter image description here

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}

\begin{document}
\begin{gather}\label{eq:2.1}
\frac{J_1(a k s)}{\sqrt{\pi } s}\\
\intertext{where $a$ is lens radius}
\begin{aligned}
k &=\frac{2 \pi }{\lambda }\\
s &=\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
\end{aligned}\notag
\end{gather}
\end{document}

Option 2:

enter image description here

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}

\begin{document}
\begin{gather}\label{eq:2.1}
\frac{J_1(a k s)}{\sqrt{\pi } s}\\
\begin{aligned}
\text{where } &a \text{ is lens radius}\\
&k =\frac{2 \pi }{\lambda }\\
&s =\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
\end{aligned}\notag
\end{gather}
\end{document}

Option 3:

enter image description here

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}

\begin{document}
\begin{gather}\label{eq:2.1}
\frac{J_1(a k s)}{\sqrt{\pi } s}\\
\intertext{where}
\begin{aligned}
&a \text{ is lens radius}\\
&k =\frac{2 \pi }{\lambda }\\
&s =\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
\end{aligned}\notag
\end{gather}
\end{document}

Option 4:

Using \shortintertext (Peter Grill's idea):

enter image description here

\documentclass[preview,border=12pt]{standalone}
\usepackage{mathtools}

\begin{document}

\begin{gather}\label{eq:2.1}
\frac{J_1(a k s)}{\sqrt{\pi } s}\\
\shortintertext{where}
\begin{aligned}
&a \text{ is lens radius}\\
&k =\frac{2 \pi }{\lambda }\\
&s =\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
\end{aligned}\notag
\end{gather}

\end{document}

The difference between \intertext and \shortintertext:

enter image description here