# inconsistent Vertical Spacing between equation and text [duplicate]

I have some problems in spacing. I just want to put equations in the text. What I found is that the vertical spacing between the equation and text is not consistent. Some is large and some is small. Both spacings above and below equation are not consistent. How do I get consistent spacing in the entire thesis? I can adjust spacing using \vspace{\baselineskip}. But I am not sure the spacing is exactly the same or not. It doesnt seems good solution. Here is my code.

\documentclass[twoside]{utmthesis}
%According to the new manual, should not mixed single-side with two-side
printing
\usepackage{graphicx}
\usepackage{url}
%\usepackage[pages=some]{background}
\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage{verbatim}
\usepackage{textcomp}
\usepackage{mhchem}
\usepackage{amsmath}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{mwe}
\usepackage{xr}
\usepackage{siunitx}
\usepackage{float}
\usepackage{subfig}
\newsavebox{\bigleftbox}
\usepackage{tikz}
\usepackage{nameref}
%\usepackage[printonlyused]{acronym}
\usepackage{romannum}
\usetikzlibrary{shapes.geometric, arrows}
\usepackage{natbib}
\let\cite\citep
\bibliographystyle{utmthesis-authordate}

\begin{document}
\subsection{1D numerical modeling of the SI-engine}
\vspace{\baselineskip}
The numerical models and related equations applied in the 1D engine
simulation are presented and briefly discussed.
\subsubsection{Pipe}
\vspace{\baselineskip}
In one-dimension modeling of flow through the pipes, working fluid is
assumed that it is flowing in one-direction, instead of three direction (X,
Y, and Z). It seems plausible, as most fluid particles are moving mostly in
longitudinal direction rather than radial direction of the pipe. A one-
dimensional pipe flow is described by Euler equation which is given in
conservation form below.

$$\label{Euler} \frac{\partial \mathbf{U}}{\partial t} + \frac{\partial \mathbf{F(U)}} {\partial x}= \mathbf{S(U)}$$

$\textbf{U}$ and $\textbf{F}$ represent state vector and flux vector,
respectively which are represented as follows.

$$\mathbf{U}= \begin{pmatrix} \rho \\ \rho \cdot u \\ \rho \cdot \bar{C_v} \cdot T + \frac{1}{2} \cdot \rho \cdot u^2 \\ \rho \cdot w_j \end{pmatrix}\,\,\, , \,\,\, \mathbf{F}= \begin{pmatrix} \rho \cdot u \\ \rho \cdot u^2 + p \\ \rho \cdot (E+p) \\ \rho \cdot u \cdot w_j \end{pmatrix}$$

With total energy, $E$ is given as below.

$$\label{E} \begin{split} E=\rho \cdot \bar{C_v} \cdot T + \frac{1}{2} \cdot \rho \cdot u^2 \end{split}$$

The source term, $\textbf{S}$ is divided into two different sub-source
terms.

$$\label{S} \mathbf{S(U)}= \mathbf{S_A(F(U))} + \mathbf{S_R(U)}$$

$\mathbf{S_A}$ is the source term caused by axial changes in the pipe cross
section.

$$\label{Sa} \mathbf{S_A(F(U))}= - \frac{1}{A} \cdot \frac{dA}{dx} \cdot \left(F + \begin{pmatrix} 0 \\ -p \\ 0 \\ 0 \end{pmatrix} \right)$$

$\mathbf{S_R}$ is the source term taking into account homogeneous chemical
reaction, friction, heat and mass transfer between gas and solid phase.

$$\label{Sr} \mathbf{S_R(F(U))}= \begin{pmatrix} 0 \\ -\frac{F_R}{V} \\ \frac{q_w}{V} \\ M W_j \cdot \left(\sum\limits_{i}^{R_{hom}} \nu_{i.j} \cdot \dot{r_i}\right)\end{pmatrix}$$

\bibliography{reference}
\end{document}


• Welcome to TeX-SE! Why do you have empty lines before and after the equation environments? – user121799 Mar 31 '19 at 4:56
• That's university format. I need certain spacing before and after equation. I am using the format that university made. The problem is that spacing is not consistent as I mention. – Je Young Kim Mar 31 '19 at 5:13
• I see. But then the appropriate way of increasing the padding is not to add empty lines, but tex.stackexchange.com/a/69665/121799. – user121799 Mar 31 '19 at 5:15

In order to increase the space around equations, you can use this answer, which redefines \abovedisplayskip and so on. (And in order to increase space after section titles, you use this answer.) Empty lines end paragraphs and should not be used to change the spacing around the equations. You effectively say latex to start a new paragraph, and that's why the result is not as you want it to be.

\documentclass[twoside]{article}
\usepackage{amsmath}
% from https://tex.stackexchange.com/a/69665/121799
\expandafter\def\expandafter\normalsize\expandafter{%
\normalsize
\setlength\abovedisplayskip{4ex}
\setlength\belowdisplayskip{4ex}
\setlength\abovedisplayshortskip{4ex}
\setlength\belowdisplayshortskip{4ex}
}
\usepackage{titlesec}
% from https://tex.stackexchange.com/a/108747/121799
\titlespacing*{\section}
{0pt}{3.5ex plus 1ex minus .2ex}{5.3ex plus .2ex}
\titlespacing*{\subsection}
{0pt}{3.5ex plus 1ex minus .2ex}{5.3ex plus .2ex}
\begin{document}

\subsection{1D numerical modeling of the SI-engine}
The numerical models and related equations applied in the 1D engine
simulation are presented and briefly discussed.

\subsubsection{Pipe}
In one-dimension modeling of flow through the pipes, working fluid is
assumed that it is flowing in one-direction, instead of three direction (X,
Y, and Z). It seems plausible, as most fluid particles are moving mostly in
longitudinal direction rather than radial direction of the pipe. A one-
dimensional pipe flow is described by Euler equation which is given in
conservation form below.
$$\label{Euler} \frac{\partial \boldsymbol{U}}{\partial t} + \frac{\partial \boldsymbol{F(U)}} {\partial x}= \boldsymbol{S(U)}$$
$\textbf{U}$ and $\textbf{F}$ represent state vector and flux vector,
respectively which are represented as follows.
$$\boldsymbol{U}= \begin{pmatrix} \rho \\ \rho \cdot u \\ \rho \cdot \bar{C_v} \cdot T + \frac{1}{2} \cdot \rho \cdot u^2 \\ \rho \cdot w_j \end{pmatrix}\;,\quad \boldsymbol{F}= \begin{pmatrix} \rho \cdot u \\ \rho \cdot u^2 + p \\ \rho \cdot (E+p) \\ \rho \cdot u \cdot w_j \end{pmatrix}$$
With total energy, $E$ is given as below.
$$\label{E} \begin{split} E=\rho \cdot \bar{C_v} \cdot T + \frac{1}{2} \cdot \rho \cdot u^2 \end{split}$$
The source term, $\textbf{S}$ is divided into two different sub-source
terms.
$$\label{S} \boldsymbol{S(U)}= \boldsymbol{S_A(F(U))} + \boldsymbol{S_R(U)}$$
$\boldsymbol{S_A}$ is the source term caused by axial changes in the pipe cross
section.
$$\label{Sa} \boldsymbol{S_A(F(U))}= - \frac{1}{A} \cdot \frac{\mathrm{d}A}{\mathrm{d}x} \cdot \left(F + \begin{pmatrix} 0 \\ -p \\ 0 \\ 0 \end{pmatrix} \right)$$
$\boldsymbol{S_R}$ is the source term taking into account homogeneous chemical
reaction, friction, heat and mass transfer between gas and solid phase.
$$\label{Sr} \boldsymbol{S_R(F(U))}= \begin{pmatrix} 0 \\ -\frac{F_R}{V} \\ \frac{q_w}{V} \\ M W_j \cdot \left(\sum\limits_{i}^{R_{hom}} \nu_{i.j} \cdot \dot{r_i}\right)\end{pmatrix}$$

\end{document}