1

I have typed several equations after each other. Now I want to add text to these equations to explain them. However, when I do this a random huge white space shows between the equations. I have attached a picture of what is happening. Does anybody know how to fix this.

Update: Reduced code is added. As can be seen (when compiled) this white space is random, as it is appearing now before the last equation (with some code removed).

\documentclass[a4paper,12pt]{article}

\addtolength{\oddsidemargin}{-1.cm}
\addtolength{\textwidth}{2cm}
\addtolength{\topmargin}{-2cm}
\addtolength{\textheight}{3.5cm}

\usepackage{array}              % Additional tables features
\usepackage{cite}               % To cite bibliography
\usepackage{graphicx}           % Insert figures
\usepackage{chngcntr}           % Avoiding counter reset per chapter
\usepackage[toc,page]{appendix} % To use appendix
\usepackage{hhline}             % For \hhline
\usepackage{hyperref}           % For \url{}
\usepackage{amsmath}            % Equations
\usepackage{floatrow}           % Caption of Table top and figure placements
\usepackage{bm}
\usepackage{listings,multicol}


\newcommand\tab[1][1cm]{\hspace*{#1}}
\graphicspath{ {images/} }              % Location of figures
\floatsetup[table]{capposition=top}     % Caption of Table top
\setlength{\abovedisplayshortskip}{-1pt}% Equation spacing  
\setlength{\belowdisplayshortskip}{0pt} % Equation spacing  

\begin{document}

\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\renewcommand{\thesection}{\arabic{section}}    % fix section numbering
\setlength{\belowdisplayskip}{3cm}

% Table of Contents
\cleardoublepage
\pagenumbering{gobble}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}

\section{Question 1}
\subsection{a)}
The far-field phasor-domain magnetic field pattern of the antenna is given in Eq. \ref{eq:h}.

\begin{equation}
\bm{\tilde{H}} = (\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r})(\frac{cos(\frac{\beta L}{2}cos\theta)-cos(\frac{\beta L}{2})}{sin\theta})\bm{\hat{\phi}}
\label{eq:h}
\end{equation}

\begin{equation}
\bm{\hat{r}} \times \bm{\hat{\phi}} = -\bm{\hat{\theta}}
\label{eq:r}
\end{equation}

The derived far-field electric field is shown in Eq. \ref{eq:e}.

\begin{equation}
\begin{split}
\bm{\tilde{E}} & = -\eta_0\bm{\hat{r}}\times \bm{\tilde{H}} \\
& = \eta_0(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r})(\frac{cos(\frac{\beta L}{2}cos\theta)-cos(\frac{\beta L}{2})}{sin\theta})\bm{\hat{\theta}}
\label{eq:e}
\end{split}
\end{equation}

\subsection{b)}
The time-averaged power density radiated in the far-field is derived in Eq. \ref{eq:p}.

\begin{equation}
\begin{split}
\bm{P_{av}} & = 0.5Re\{\bm{\tilde{E}} \times \bm{\tilde{H^*}}\} \\
& = 0.5Re\{-\eta_0\bm{\hat{r}}(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r})^2(\frac{cos(\frac{\beta L}{2}cos\theta)-cos(\frac{\beta L}{2})}{sin\theta})^2\} \\
& = \frac{15I_0^2}{\pi r^2}(\frac{cos(\frac{\beta L}{2}cos\theta)-cos(\frac{\beta L}{2})}{sin\theta})^2\bm{\hat{r}}
\label{eq:p}
\end{split}
\end{equation}

\begin{equation}
\text{where } \eta_0 = \sqrt{\frac{\mu_0}{\varepsilon_0}} \cong 120\pi \text{ (free space)}
\end{equation}


\end{document}
  • 1
    Welcome to TeX SX! Could you post a full compilable code, so we can test what's happening? – Bernard May 4 '17 at 12:44
  • I did not add the code, because it is rather long and has many dependencies on files and images. I'll try to mimize this and add it. – Matthias May 4 '17 at 12:49
  • 1
    Never leave a blank line before any displayed equation (equation, align etc) the spacing will be completely wrong with a spurious white one-line paragraph before the display – David Carlisle May 4 '17 at 12:59
  • Also better to use the geometry package to change the layout, there are many parameters that needs to dance together, adjusting some may require readjusting others, geometry does this automatically. – daleif May 4 '17 at 13:01
  • 1
    Hehe, what is that change to \belowdisplayskip doing there? – daleif May 4 '17 at 13:04
1

enter image description here

There should never be a blank line before a displayed equation, or two succesive displays, however the main cause of the weird spacing was your settings of the space around equations which varied between excessively large (3cm) and negative (-1pt).

Also \cos and \sin not cos and sin.

\documentclass[a4paper,12pt]{article}

\addtolength{\oddsidemargin}{-1.cm}
\addtolength{\textwidth}{2cm}
\addtolength{\topmargin}{-2cm}
\addtolength{\textheight}{3.5cm}

\usepackage{array}              % Additional tables features
\usepackage{cite}               % To cite bibliography
\usepackage{graphicx}           % Insert figures
\usepackage{chngcntr}           % Avoiding counter reset per chapter
\usepackage[toc,page]{appendix} % To use appendix
\usepackage{hhline}             % For \hhline
\usepackage{hyperref}           % For \url{}
\usepackage{amsmath}            % Equations
\usepackage{floatrow}           % Caption of Table top and figure placements
\usepackage{bm}
\usepackage{listings,multicol}


\newcommand\tab[1][1cm]{\hspace*{#1}}
\graphicspath{ {images/} }              % Location of figures
\floatsetup[table]{capposition=top}     % Caption of Table top
%NO!! \setlength{\abovedisplayshortskip}{-1pt}% Equation spacing  
%NO!!\setlength{\belowdisplayshortskip}{0pt} % Equation spacing  

\begin{document}

\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\renewcommand{\thesection}{\arabic{section}}    % fix section numbering
% ?????\setlength{\belowdisplayskip}{3cm}

% Table of Contents
\cleardoublepage
\pagenumbering{gobble}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}

\section{Question 1}
\subsection{a)}
The far-field phasor-domain magnetic field pattern of the antenna is given in Eq. \ref{eq:h}.
\begin{gather}
\bm{\tilde{H}} = (\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r})(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta})\bm{\hat{\phi}}
\label{eq:h}\\
\bm{\hat{r}} \times \bm{\hat{\phi}} = -\bm{\hat{\theta}}
\label{eq:r}
\end{gather}

The derived far-field electric field is shown in Eq. \ref{eq:e}.
\begin{equation}
\begin{split}
\bm{\tilde{E}} & = -\eta_0\bm{\hat{r}}\times \bm{\tilde{H}} \\
& = \eta_0(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r})(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta})\bm{\hat{\theta}}
\label{eq:e}
\end{split}
\end{equation}

\subsection{b)}
The time-averaged power density radiated in the far-field is derived in Eq. \ref{eq:p}.
\begin{gather}
\begin{split}
\bm{P_{av}} & = 0.5Re\{\bm{\tilde{E}} \times \bm{\tilde{H^*}}\} \\
& = 0.5Re\{-\eta_0\bm{\hat{r}}(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r})^2(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta})^2\} \\
& = \frac{15I_0^2}{\pi r^2}(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta})^2\bm{\hat{r}}
\label{eq:p}
\end{split}\\
\text{where } \eta_0 = \sqrt{\frac{\mu_0}{\varepsilon_0}} \cong 120\pi \text{ (free space)}
\end{gather}


\end{document}
1

Here is another variant. The white space was a consequence of the redefinition of \belowdisplayskip (3cm!).

You should not have a series of consecutive equation environments. For such cases, you should use align or gather. Also note the usual functions require a backslash to be properly typeset since they're maths operators. I defined Re as an operator (\Rre, as \Re is already defined) to have a correct interletter spacing, otherwise, it is typed as the producr of the two variables R and e.

\documentclass[a4paper,12pt]{article}

\addtolength{\oddsidemargin}{-1.cm}
\addtolength{\textwidth}{2cm}
\addtolength{\topmargin}{-2cm}
\addtolength{\textheight}{3.5cm}

\usepackage{array} % Additional tables features
\usepackage{cite} % To cite bibliography
\usepackage{graphicx} % Insert figures
\usepackage{chngcntr} % Avoiding counter reset per chapter
\usepackage[toc,page]{appendix} % To use appendix
\usepackage{hhline} % For \hhline
\usepackage{amsmath} % Equations
\usepackage{floatrow} % Caption of Table top and figure placements
\usepackage{bm}
\usepackage{listings,multicol}

\usepackage{hyperref} % For \url{}

\newcommand\tab[1][1cm]{\hspace*{#1}}
\graphicspath{ {images/} } % Location of figures
\floatsetup[table]{capposition=top} % Caption of Table top
\setlength{\abovedisplayshortskip}{-1pt}% Equation spacing
\setlength{\belowdisplayshortskip}{0pt} % Equation spacing
\DeclareMathOperator{\Rre}{Re}

\begin{document}

\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\renewcommand{\thesection}{\arabic{section}} % fix section numbering
%\setlength{\belowdisplayskip}{3cm}

% Table of Contents
\cleardoublepage
\pagenumbering{gobble}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}

\section{Question 1}
\subsection{a)}
The far-field phasor-domain magnetic field pattern of the antenna is given in Eq. \ref{eq:h}.
\begin{gather}
\bm{\tilde{H}} =\biggl (\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r}\biggr)\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)\bm{\hat{\phi}}
\label{eq:h}\\
\bm{\hat{r}} \times \bm{\hat{\phi}} = -\bm{\hat{\theta}}
\label{eq:r}\\
\intertext{The derived far-field electric field is shown in Eq. \ref{eq:e}.}
\begin{aligned}
\bm{\tilde{E}} & = -\eta_0\bm{\hat{r}}\times \bm{\tilde{H}} \\
& = \eta_0\biggl(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r}\biggr)\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)\bm{\hat{\theta}}
\label{eq:e}
\end{aligned}
\end{gather}

\subsection{b)}
The time-averaged power density radiated in the far-field is derived in Eq. \ref{eq:p}.
\begin{align}
 & \begin{aligned}
\bm{P_\mathrm{av}} & = 0.5\Rre\bigl\{\bm{\tilde{E}} \times \bm{\tilde{H^*}}\bigr\} \\
& = 0.5 \Rre\biggl\{-\eta_0\bm{\hat{r}}\biggl(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r}\biggr)^{\!\!2}\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)^{\!\!2}\biggr\} \\
& = \frac{15I_0^2}{\pi r^2}\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)^{\!\!2}\bm{\hat{r}}
\label{eq:p}
\end{aligned}\\
 &\rlap{where $ \eta_0 = \sqrt{\dfrac{\mu_0}{\varepsilon_0}} \cong 120\pi $ (free space)}\notag
\end{align}

\end{document} 

enter image description here

  • you've still a blank line before gather – David Carlisle May 4 '17 at 13:48
  • Oh! yes. Thanks for pointing it! 'Tis fixed now. – Bernard May 4 '17 at 14:07
0

You have the following (too many) settings for spacing around equations:

\setlength{\abovedisplayshortskip}{-1pt}% Equation spacing  
\setlength{\belowdisplayshortskip}{0pt} % Equation spacing
\setlength{\belowdisplayskip}{3cm}

the last of which is responsible for that too much space after the equation. I also fixed some issues like size of parentheses using \bigl, \biggl, ..., \bigr, \biggr and sin, cos, and Re

\documentclass[a4paper,12pt]{article}

\addtolength{\oddsidemargin}{-1.cm}
\addtolength{\textwidth}{2cm}
\addtolength{\topmargin}{-2cm}
\addtolength{\textheight}{3.5cm}

\usepackage{array}              % Additional tables features
\usepackage{cite}               % To cite bibliography
\usepackage{graphicx}           % Insert figures
\usepackage{chngcntr}           % Avoiding counter reset per chapter
\usepackage[toc,page]{appendix} % To use appendix
\usepackage{hhline}             % For \hhline
\usepackage{hyperref}           % For \url{}
\usepackage{amsmath}            % Equations
\usepackage{floatrow}           % Caption of Table top and figure placements
\usepackage{bm}
\usepackage{listings,multicol}

\newcommand\tab[1][1cm]{\hspace*{#1}}
\graphicspath{ {images/} }              % Location of figures
\floatsetup[table]{capposition=top}     % Caption of Table top
%\setlength{\abovedisplayshortskip}{-1pt}% Equation spacing  
%\setlength{\belowdisplayshortskip}{0pt} % Equation spacing  

\begin{document}

\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\renewcommand{\thesection}{\arabic{section}}    % fix section numbering
%\setlength{\belowdisplayskip}{3cm}

% Table of Contents
\cleardoublepage
\pagenumbering{gobble}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}

\section{Question 1}
\subsection{a)}
The far-field phasor-domain magnetic field pattern of the antenna is given in Eq. \ref{eq:h}.

\begin{equation}
\bm{\tilde{H}} = \biggl(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r}\biggr)\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)\bm{\hat{\phi}}
\label{eq:h}
\end{equation}
%
\begin{equation}
\bm{\hat{r}} \times \bm{\hat{\phi}} = -\bm{\hat{\theta}}
\label{eq:r}
\end{equation}
%
The derived far-field electric field is shown in Eq. \ref{eq:e}.
%
\begin{equation}
\begin{split}
\bm{\tilde{E}} & = -\eta_0\bm{\hat{r}}\times \bm{\tilde{H}} \\
& = \eta_0\biggl(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r}\biggr)\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)\bm{\hat{\theta}}
\label{eq:e}
\end{split}
\end{equation}

\subsection{b)}
The time-averaged power density radiated in the far-field is derived in Eq. \ref{eq:p}.
%
\begin{equation}
\begin{split}
\bm{P_{av}} & = 0.5\,\mathrm{Re}\bigl\{\bm{\tilde{E}} \times \bm{\tilde{H^*}}\bigr\} \\
& = 0.5\,\mathrm{Re}\biggl\{-\eta_0\bm{\hat{r}}\biggl(\frac{jI_0}{2\pi}\frac{e^{-j\beta r}}{r}\biggr)^2\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)^2\biggr\} \\
& = \frac{15I_0^2}{\pi r^2}\biggl(\frac{\cos(\frac{\beta L}{2}\cos\theta)-\cos(\frac{\beta L}{2})}{\sin\theta}\biggr)^2\bm{\hat{r}}
\label{eq:p}
\end{split}
\end{equation}
%
where $\eta_0 = \sqrt{\frac{\mu_0}{\varepsilon_0}} \cong 120\pi$ \text{ (free space)}

\end{document}

[1]: https://i.stack.imgur.com/oftBp.png

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.