This is the problem: the "distance" between every subsubsection changes, according to how I end the previous subsubsection. If I end it with a text line, then it's ok. If I end it with a formula (between the \[ \]) then the next subsubsection is put at a bigger distance, and I need to use \vspace{-5mm}, to say.

How can I fix the distance to be the same, regardless of what I write in each subsubsection?

This is an example of the preamble I use, you can use it to see what I mean (but I add a screenshot too).

\documentclass[a4paper, 11pt]{scrreprt}
\geometry{total={173mm, 257mm}, left=23mm, top=23mm, right=23mm, bottom=23mm}




\usepackage{enumitem, xcolor}


\DeclareMathOperator{\lzp}{\displaystyle\lim_{x\to 0^+}}
\DeclareMathOperator{\lzm}{\displaystyle\lim_{x\to 0^-}}



\subsubsection*{Exercise $1.$} Find the derivative of $f(x) = \sqrt{\abs{x}\ln(\abs{x})}$

\subsubsection*{Exercise $2.$} What is the derivative of 
\[f(x) = \dfrac{x^2 + \sin(x^2 + \cos(x))}{x^2 + x + 1}\]

\subsubsection*{Exercise $3.$} State Rolle's Theorem with an example. 


enter image description here

As you can see, I should add a \vspace{-5mm} before subsubsection three.

Thank you!

  • Off-topic: The option list left=23mm, top=23mm, right=23mm, bottom=23mm may be expressed more succinctly as margin=23mm.
    – Mico
    Commented May 27 at 0:29
  • 1
    The bad space is cause by your use of \everydisplay{\color{red}} if you remove \everymath{\color{red}} \everydisplay{\color{red}} \EverySelectfont{\color{black}} you get the intended space Commented May 27 at 8:09
  • @DavidCarlisle You're right about that, but I wanted to avoid to eliminate that part, for I find it "personal" and useful to have math ambient coloured...
    – Henry
    Commented May 27 at 15:22
  • yes but for example \[\mathcolor{red}{.................}\] wouldn't affect the space Commented May 27 at 17:55
  • @DavidCarlisle I understand, but in the notes I write I then would use that command like water. It's not that comfortable since I use it for EVERY mathematical part, not just the display mode or the highlighted parts...
    – Henry
    Commented May 27 at 18:52

1 Answer 1


I think you're abusing LaTeX's sectioning framework. I suggest you create a bespoke list called, say, exercise, instead.

enter image description here


\geometry{total={173mm, 257mm}, margin=23mm}

\usepackage{mathtools} % 'mathtools' loads 'amsmath' automatically


\usepackage{enumitem, xcolor, cleveref}

            label=\textbf{Exercise} \textcolor{red}{\arabic*.},
            ref  =\arabic*}


\item  Find the derivative of $f(x) = \sqrt{\abs{x}\ln(\abs{x})}$ \label{ex:1}

\item Find the derivative of \label{ex:2}
$\displaystyle f(x) = \sqrt{\abs{x}\ln(\abs{x})}$
\end{center} % TeX discards leaders when needed

\item State Rolle's Theorem with an example. \label{ex:3}


Cross-references to \cref{ex:1,ex:3}.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .