LaTeX Beginner's Guide ⇒ How can I put two images next to each other?
How can I put two images next to each other?
Which one of the mentioned packages shall I choose?
Can you show an simple code example?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
How can I put two images next to each other?
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}
There are further examples in the LaTeX Cookbook, Chapter 4, Working with Images.
Stefan
Last bumped by Anonymous on Mon Oct 18, 2021 6:45 pm.