I have a LaTeX document with:
\documentclass[12pt]{report}
And most of the spacing between paragraphs and images look like this:
When I just change the document class to:
\documentclass[12pt]{book}
Some pages contain way too much space either between paragraphs or between paragraphs and chapter titles or between paragraphs and images.
The same piece becomes:
How can I remove this spacing and what causes it?
The piece of code of that part is:
% ...
\vspace{20pt}
\begin{figure}[H]
\centering
\includegraphics[width=350pt]{img/javascript.jpeg}
\caption{Esempio di mancanza di scoping in Javascript. \\Fonte: https://dev.to/murithi/scope-in-javascript-e5e}
\end{figure}
\vspace{20pt}
\par Questo è solo un esempio di come in alcune situazioni si rischia di perdere molto tempo nel cercare di
sistemare problemi derivanti per lo più da funzionalità poco intuitive del linguaggio.
\par L'unica eccezione all'utilizzo di tale linguaggio sarebbe lo sviluppo di prototipi veloci che poi non saranno
più mantenuti o utilizzati in futuro.
\subsection{Interesse nei linguaggi tipizzati}
\par Ho avuto il piacere di studiare e scoprire Haskell qualche anno fa per conto mio.
% ...


\flushbottomdirective and the[H]option for figures. Try with\raggedbottomin the preamble. – Bernard Dec 04 '17 at 20:40[H]placement specifiers... – Mico Dec 04 '17 at 20:48[H]sledge hammer tends to create more problems than it solves. If you believe strongly that you have no choice but to override LaTeX's algorithm for placing floats, at least replace[H]with[ht!]. – Mico Dec 04 '17 at 20:53[H](so disabling floats) you are by design opting to get bad white space as a price to pay to never allow figures to move. – David Carlisle Dec 04 '17 at 20:59\par(they are doing nothing at all) – David Carlisle Dec 04 '17 at 21:00[H]will occasionally cause real trouble (specifically: big gaping holes on a page), whereas[ht!]won't. For more information on this topic, see the posting How to influence the position of float environments like figure and table in LaTeX -- and esp. Frank Mittelbach's answer. – Mico Dec 04 '17 at 21:28