# Equations and defining equation variables

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:

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 ...

## Option 1:

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

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

\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}
&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):

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

• yeah the same issue, what if we want the text : a is lens radius and the other two variables K and S to be aligned one below the other. So that it looks neat and all the variables aligned one below the other in uniformity. – Rene Duchamp Apr 25 '13 at 18:46
• This also looks very helpful ... thanks a lot again ... – Rene Duchamp Apr 25 '13 at 18:57
• There is also \shortintertext from the mathtools package which has less vertical spacing, an example of which is in How to subtract two equations?. – Peter Grill Apr 25 '13 at 19:08

As detailed in align vs equation there are some occasions when the equation environment is more appropriate

I have moved your \text{...} into text mode in between the equation and align environment.

% arara: pdflatex
% !arara: indent: {overwrite: true, trace: true}
\documentclass{article}
\usepackage{amsmath}
\begin{document}

$$\label{eq:2.1} \frac{J_1(a k s)}{\sqrt{\pi } s}$$
where $a$ is lens radius
\begin{align*}
& 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{align*}


or else (following the comment)

where
\begin{align*}
& 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{align*}

\end{document}

• That looks nice, but what if we want the text : a is lens radius and the other two variables K and S to be aligned one below the other. – Rene Duchamp Apr 25 '13 at 18:44
• @abhilashsukumari see the update :) – cmhughes Apr 25 '13 at 18:52