2

This is a follow-up to this question: Figures three spaces after and before text

Per the requirements for my PhD thesis the spacing below the floats, in this case figures, needs to be three lines above and below text. Now, the issue I'm coming up against is that the spacing below my figures is bigger than three lines. In other words, there is more empty space below. If I use of the macros

\setlength{\floatsep}{}

\setlength{\textfloatsep}{}

\setlength{\intextsep}{}

to try to fix this problem, it will affect the space both above and below. I have also tried \belowcaptionskip but it messes up some of the floats, where the caption is intruding into footnote space.

So, how do I make it so that the spacing below the float is equal to the one above the float?

From what I've read I think the figure environment inserts a parskip (?) after such that an extra space is added below the figure. Would there be a way to neutralize this effect?

2
  • this seems to be a duplicate of the referenced question, as the image shows if you have a sequence of figures at the top of the page they have \floatsep between them and \textfloatsep at the end before the text. Commented Oct 21, 2022 at 8:17
  • 1
    "it messes up some of the floats, where the caption is intruding into footnote space." is not anything anyone can debug. If you get a bad output, make a small example that shows the problem and ask about that. Commented Oct 21, 2022 at 8:19

1 Answer 1

0

Perhaps you need to provide a minimum working example to demonstrate the problem in your case. Otherwise, using standard document class, everything seems to work as expected.

I can set the three lengths you mentioned in your question to 3 \baselineskips and spacing between figures is fixed to that length. Below is an example with rules of size of three baseline skips added to figures as a reference.

enter image description here

Additionally, caption provides the possibility to alter bottom space after caption by changing the belowskip option

\usepackage{caption}
    \captionsetup[figure]{position=bottom,belowskip=-3pt}

The code

\documentclass{article}
\usepackage{graphicx}
\usepackage{kantlipsum}

\newsavebox\myimg
\newcommand\VRule[1][0pt]{\smash{\rule[#1]{1pt}{3\baselineskip}}}
\AtBeginDocument{%
    \setlength\floatsep{3\baselineskip}%
    \setlength\textfloatsep{3\baselineskip}%
    \setlength\intextsep{3\baselineskip}
    \setlength\parskip{0pt plus 12pt}}


\begin{document}
\sbox\myimg{\raisebox{-\totalheight}{%
        \clap{\includegraphics[width=0.5\textwidth]{example-image}}}}%
\kant[5][1-2]

\begin{figure}[!h]
    \centering
    \VRule%
    \usebox\myimg
    \caption{\VRule[-3\baselineskip]In-text placement}%
\end{figure}

\kant[7][1]

\begin{figure}[!t]
    \centering
    \usebox\myimg
    \caption{Top placement 1}
\end{figure}

\kant[9][1-2]\kant[10][1-2]

\begin{figure}[!t]
    \centering
    \VRule%   <--- Vertical rule
    \usebox\myimg
    \caption{\VRule[-3\baselineskip]Top placement 2}
\end{figure}

\kant[11][1-5]\kant[12][1-2]
\end{document}

You must log in to answer this question.

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