0

I would like to reduce the space between a figure and a section. I have tried to use How to change the spacing between figures/tables and text? but it didn't work. The latex script I have used

\setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt}

An example of my code:

\begin{figure}[ht]
\begin{center}
\includegraphics[width=0.8\textwidth]{images/supervised_unsupervised_learning.png}
\end{center}
\caption{The timeline of the deep learning advancements \cite{Parekh2019}}
\label{fig:supervised_unsupervised_learning}
\end{figure}

\setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt}

\subsection{Deep Learning}

David Carlisle
  • 757,742
  • 1
    that is half the value set in the standard classes so will reduce the space between a top float and following text. But if a section heading adds more space at that point then it will still add it. As you have shown no code, impossible to guess what is happening in your case. – David Carlisle Aug 17 '20 at 11:05
  • I have added a sample of the code. I have this that makes things slightly clearer. – Browed1983 Aug 17 '20 at 12:48
  • It would be better to provide something people can run, it is more or less impossible to debug a fragment (you can use example-image as an image available for tests) but don't do \setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt} mid-document the behaviour if you do that is deterministic but hard to explain and almost certainly never what you want. Only set those parameters in the document preamble. – David Carlisle Aug 17 '20 at 12:56
  • 1
    The space there is almost certainly controlled by the space above the section heading about which you have given no information. section headings are not defined in latex itself just in the document class, which is why examples should always be complete. – David Carlisle Aug 17 '20 at 12:57
  • 1
    note \textfloatsep would affect a top float t but you are also allowing h and it has no effect if the h option is taken. – David Carlisle Aug 17 '20 at 13:11
  • 1
    In additon, the center environment adds extra space. Use \centering instead. \caption will always take up the entire width (internally). – John Kormylo Aug 17 '20 at 14:55

0 Answers0