I'm making a cheatsheet and need to get rid of as much unneeded space as possible. However, I just can't figure out how to get rid of this space that is added between a (sub)section title and an equation:
MWE:
\documentclass[8pt]{extarticle}
\usepackage[paper=a5paper]{geometry}
\usepackage[english]{babel}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage[nodisplayskipstretch]{setspace}
\usepackage{titlesec}
\titlespacing{\section}{0pt}{0pt}{0pt}
\titlespacing{\subsection}{0pt}{0pt}{0pt}
\titlespacing{\subsubsection}{0pt}{0pt}{0pt}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\setlength{\lineskip}{0pt}
\setlength{\intextsep}{0pt}
% Display mode equation spacing
\expandafter\def\expandafter\normalsize\expandafter{%
\normalsize
\setlength\abovedisplayskip{0pt}
\setlength\belowdisplayskip{0pt}
\setlength\abovedisplayshortskip{0pt}
\setlength\belowdisplayshortskip{0pt}
}
\begin{document}
\section{Section}
\begin{equation*}
q = q_0 + q_1i + q_2j + q_3k = (q_0,q_1,q_2,q_3)
\end{equation*}
\section{Section}
Some text
\begin{equation*}
q = q_0 + q_1i + q_2j + q_3k = (q_0,q_1,q_2,q_3)
\end{equation*}
More text
\end{document}



\section, then? – egreg Jan 30 '18 at 12:57\section, such as being able to configure the spacing using titlespacing. Of course this could also be done with a custom command, but that seems like a complicated solution. – danmou Jan 30 '18 at 13:41\usepackage[nodisplayskipstretch]{setspace}is unneeded when I'm also redefining the displayskips. – danmou Jan 30 '18 at 13:58