Q: Space between equations/figure depends on previous paragraph/newline I need to rewrite a Latex book and optimze the code and found a "problem" which I cant solve and dont find a global solution.
In my opinion the code is better to read, if there is a newline/paragraph between text and equation-block.
But this leads to an bigger cap between text and equation, which I try to avoid.
My question is, is it possible to insert a new line in code (for easier code reading) without increasing the gap between text and equation?
Here is my minimal code example:
\documentclass{book}
\begin{document}
\chapter{Gap}
\section{testcase 1}
This is a test sentence and has nothing to do with the real problem.
    \begin{equation}
        a=b+x
    \end{equation}
This is a test sentence and has nothing to do with the real problem.


\section{testcase 2}
This is a test sentence and has nothing to do with the real problem.

    \begin{equation}
        a=b+x
    \end{equation}

This is a test sentense and has nothing to do with the real problem.

\end{document}

Here a picture how it looks like:

I know its not a big difference but still.

A: Actually, there is a semantic difference as well.
Compare where the second sentence starts (paragraph indent). In one case you have started a new paragraph (with the empty line), in the other (without the empty line) you have just continued the current paragraph.
If you want to have an "empty line" in the source code without an impact on the typesetting, use % at its beginning to comment it.
