I have three subfloats and I want them to be aligned over the full \textwidth
, no matter what the sizes are (smaller than a third of the page of course).
I have the following setup:
\begin{figure} %
\centering
\subfloat[subcaption 1]{%
\includegraphics[width=0.2\textwidth]{image1}} %
%
\subfloat[subcaption 2]{%
\includegraphics[width=0.2\textwidth]{image2}} %
%
\subfloat[subcaption 3]{%
\includegraphics[width=0.2\textwidth]{image3}} %
\caption{%
\label{fig:trans_actions} %
Some caption text here. This is the full textwidth.}
\end{figure}
How do I get the images justified over the full width of the text?
Best Answer
Just add
\hfill
to spread out the figures, which adds a rubber length that is allowed to stretch and shrink horizontally as needed.The
[showframe]
option for thegeometry
pacakge was used to show the placement of the figures and the margins.As Werner pointed out, the above solution aligns the edges of the figures with the margins. If you also want spacing between the figures and margins as well you add
\null\hfill
on the left, and\hfill\null
on the right.