0

As shown below, tables and figures seem to add extra space at the bottom:

enter image description here

In the example below the problem persist also using float (\intextsep was multiplied by 1.5 \baselineskip for better readability):

enter image description here

Code for the first image:

\documentclass[a4paper,12pt]{article}
\usepackage[demo]{graphicx}

\begin{document}

\noindent AAAAAAAAAAAAAAAAAAAAAAAA

\begin{table}[h]
 \begin{tabular}{c} 
  \hline
  table \\
  \hline
 \end{tabular}
\end{table}

\noindent BBBBBBBBBBBBBBBBBBBBBBBB

\begin{table}[h]
 \vspace*{-\baselineskip}
 \begin{tabular}{c} 
  \hline
  table \\
  \hline
 \end{tabular}
 \vspace*{-\baselineskip}
\end{table}

\noindent CCCCCCCCCCCCCCCCCCCCCCCC

\begin{figure}[ht]
 \includegraphics{demo}
\end{figure}

\noindent DDDDDDDDDDDDDDDDDDDDDDDD

\begin{figure}[!ht]
 \vspace*{-\baselineskip}
 \includegraphics{demo}
 \vspace*{-\baselineskip}
\end{figure}

\noindent EEEEEEEEEEEEEEEEEEEEEEEE

\end{document}
8
  • 1
    tex.stackexchange.com/a/23316/197451
    – js bibra
    Mar 22, 2021 at 15:37
  • @jsbibra already tried, no change except for \intextsep, which modifies both
    – Polizi8
    Mar 22, 2021 at 15:44
  • your question isn't very clear you say "seem to add extra space" but you answer this in your own question, latex (for h position) adds \intextsep before and after the float. Mar 22, 2021 at 15:52
  • if you want no space, do not want the float to move and have no captions, you can simply remove the figure and table environments. Mar 22, 2021 at 15:53
  • @DavidCarlisle the code I posted is a MWE to reproduce the issue, the final look will be the one in the second picture. My question is why the bottom space is different from the top one, you can see that along \intextsep something else is adding space. Even after removing the two \intextsep there is a bit of space left under the figures/tables
    – Polizi8
    Mar 22, 2021 at 16:18

1 Answer 1

2

If you set the space around here floats to 0pt and remove the negative spacing added in the example you get

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[demo]{graphicx}

\setlength\intextsep{0pt}
\setlength\lineskip{0pt}

\showoutput
\begin{document}

\noindent AA

\begin{table}[h]
 \begin{tabular}{c} 
  \hline
  table \\
  \hline
 \end{tabular}
\end{table}

\noindent BB

\begin{table}[h]
 \begin{tabular}{c} 
  \hline
  table \\
  \hline
 \end{tabular}
\end{table}

\noindent CC

\begin{figure}[ht]
 \includegraphics{demo}
\end{figure}

\noindent DD

\begin{figure}[!ht]
 \includegraphics{demo}
\end{figure}

\noindent EE

\end{document}

looking in the log you see the vertical space after the first table before BB is

...\penalty 0
...\glue 0.0
...\glue 0.0 plus -1.0
...\penalty 10000
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 6.3

so standard baselineskip spacing as between lines of a paragraph, similarly before CC

....\glue 0.0
...\penalty 0
...\glue 0.0
...\glue 0.0 plus -1.0
...\penalty 10000
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 6.3

DD and EE are the same.

4
  • I see, but how can I remove the vertical space between the first table and BB? Is there a \vspace lenght or similar I can enter within the table/figure environment to get rid of it and have a symmetical top/bottom spacing?
    – Polizi8
    Mar 22, 2021 at 17:13
  • 1
    @Polizi8 sorry I just do not understand. As I showed it is just baselineskip, so if the table ended with a row of letters with descenders like gygygygyggy and the BBB were capitals, or even accented capitals, they would over-print if you put them any closer together. It is exactly the same as asking about the space between lines of a paragraph, if you use all lowercase letter with no descenders it looks like there is extra space. Mar 22, 2021 at 17:20
  • 1
    @Polizi8 If you really want that you can use \nointerlineskip \noindent BB Mar 22, 2021 at 17:22
  • Thank you, so the small space in the first picture it was that kind of skip. I fixed the issue in my second image by adding \vspace*{-1.5\baselineskip} before closing the environment. Now I can freely set \intextsep to what I want to regulate the same space before and after a table/figure
    – Polizi8
    Mar 22, 2021 at 18:09

You must log in to answer this question.

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