The following code
\documentclass{article}
\usepackage{graphicx, caption, subcaption}
\begin{document}
This article is about geometrical figures.
\begin{figure}[h]
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{image1_example}
\caption{The rectangle is a complicated geometrical figure that has 4 edges and 4 vertices while a star is an even more complex geometrical figure}
\end{subfigure}
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{image2_example}
\caption{A simple circle and a spiral}
\end{subfigure}
\caption{Geometrical figures}
\end{figure}
\end{document}
produces the following output
-
The more verbose caption for subfigure a) produces an asymmetric
placement of the two subfigures. -
It would be nicer if there would be more horizontal space between the
two subfigures.
Is it possible to control these features?
Best Answer
The optional argument for the
subfigure
environment provides the placement of the sub-caption anchor. This is used to align the sub-captions vertically. Here is a visual:So I'd use a
[t]
op alignment. Additionally, you can spread out the figures using a number of options.If your images have different vertical heights and you want to align those as well, you can raise content into place; the default alignment of images would be at the baseline: