[Tex/LaTex] Adding captions to aligned images in beamer

beamer

I'm following the answer in the linked question to align two images side by side in beamer in one slide: How to align two images side by side and to scale them automatically to use whole slide?

However, I want to add captions under each image. How can I do that?

Best Answer

You can use columns environment and include one figure in each column:

\documentclass{beamer}

\begin{document}

\begin{frame}

\begin{columns}[onlytextwidth]
\begin{column}{.45\textwidth}
\begin{figure}
  \includegraphics[width=\textwidth]{example-image-a}
  \caption{First image}
\end{figure}
\end{column}
\hfill
\begin{column}{.45\textwidth}
\begin{figure}
  \includegraphics[width=\textwidth]{example-image-b}
  \caption{Second image}
\end{figure}
\end{column}
\end{columns}

\end{frame}

\end{document}

enter image description here