by Stefan Kottwitz » Mon Oct 18, 2021 6:45 pm
I prefer using the
subcaption
package, since it's the perfect companion to the excellent
caption
package by the same author.
Here is a quick example:
Code: Select all
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[ht]
\subcaptionbox*{First subfigure}[.45\linewidth]{%
\includegraphics[width=\linewidth]{example-image-a}%
}%
\hfill
\subcaptionbox*{Second subfigure}[.45\linewidth]{%
\includegraphics[width=\linewidth]{example-image-b}%
}
\caption{Two images}
\end{figure}
\end{document}
This gives us:

- subfigures.png (19.92 KiB) Viewed 271682 times
There are further examples in the
LaTeX Cookbook, Chapter 4, Working with Images.
Stefan
I prefer using the [latex]subcaption[/latex] package, since it's the perfect companion to the excellent [latex]caption[/latex] package by the same author.
Here is a quick example:
[code]\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[ht]
\subcaptionbox*{First subfigure}[.45\linewidth]{%
\includegraphics[width=\linewidth]{example-image-a}%
}%
\hfill
\subcaptionbox*{Second subfigure}[.45\linewidth]{%
\includegraphics[width=\linewidth]{example-image-b}%
}
\caption{Two images}
\end{figure}
\end{document}[/code]
This gives us:
[attachment=0]subfigures.png[/attachment]
There are further examples in the [url=https://www.packtpub.com/hardware-and-creative/latex-cookbook]LaTeX Cookbook[/url], Chapter 4, Working with Images.
Stefan