TransWikia.com

Issues with Subcaption package and spacing

TeX - LaTeX Asked by fjungplan on March 2, 2021

I lately added the subcaption package to my article in order to place my figures and caption them accordingly. Before I embedded the figures like this:

documentclass[a4paper,12pt]{article}
%usepackage{subcaption}

begin{document}
    begin{figure}[htb]
        hrule
        vspace*{2mm}
        centering
        rule{5cm}{5cm}
        rule{5cm}{5cm}
        vspace*{2mm}
        hrule
        caption{Some Caption}
        vspace*{2mm}
        hrule
        label{fig:somefigure}
    end{figure}
end{document}

with looked like this:

Nice spacing around caption

Since I wanted subcaptions, subcaption seemed to be the recommended choice. However, now my figures (code yet unchanged to actually include subcaptions) look like this:

Not-so-nice spacing around caption

The subcaption package causes this weird vertical spacing around the caption between the two hrules. I tried understanding the caption manual, as suggested, but I can’t figure out why this happens and how to make it stop. Eliminating the vspace*{2mm} after the caption still leaves a big gap.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP