Quantcast
Channel: What causes extra vertical space around caption with threeparttable and how to remove it? - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

What causes extra vertical space around caption with threeparttable and how to remove it?

$
0
0

I just noticed that Donald Arseneau's excellent threeparttable package adds extra vertical space before and after the caption. This can be seen in the MWE below where I have set \abovecaptionskip and \belowcaptionskip to zero to emphasize the added space.

Could you please help me figure out where the added vertical space comes from and how to remove it? I have tried to decipher the package code but it is sadly beyond my skill level.

\documentclass[12pt]{article}\usepackage{threeparttable}\usepackage{tabularx}\setlength{\abovecaptionskip}{0pt}\setlength{\belowcaptionskip}{0pt}\begin{document}  \begin{table}[h]    \caption{Testing testing testing}    \begin{tabularx}{\linewidth}{XXXX}      A1 & B1 & C1 & D1 \\      A2 & B2 & C2 & D2 \\      A3 & B3 & C3 & D3 \\    \end{tabularx}  \end{table}  \clearpage  \begin{table}[h]    % \vskip-\lastskip%\vspace{-.2\baselineskip}    \begin{threeparttable}      \caption{Testing testing testing}      \vskip-\lastskip%\vspace{-.2\baselineskip}      \begin{tabularx}{\linewidth}{XXXX}        A1 & B1 & C1 & D1 \\        A2 & B2 & C2 & D2 \\        A3 & B3 & C3 & D3 \\      \end{tabularx}    \end{threeparttable}  \end{table}\end{document}

Animated MWE to show added space


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>