Insert Figures and Set whose Style in LaTeX beamer

Oct. 20, 2023

Insert figures

Inserting figures in LaTeX beamer class is similar to that in article class, which could be found in blog [1] and [2]:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{graphicx,subfig}
\renewcommand{\figurename}{Fig.}
\captionsetup[figure]{justification=raggedright,singlelinecheck=false}
\captionsetup[subfigure]{justification=centering}

\begin{document}
	\begin{frame}{Figure and multi-figure layout}
		\begin{figure}
			\centering
			\includegraphics[width=0.2\textwidth]{pic-2.pdf}
			\caption{This is a random data series, and here is long long long long long long long long long long caption.}
			\label{fig-1}
		\end{figure}
		
		\begin{figure}
			\def\CE{0.20}
			\centering
			\subfloat[]{\includegraphics[height=\CE\textwidth,width=\CE\textwidth]{pic-1.pdf}\label{fig-a}}\hfill
			\subfloat[]{\includegraphics[height=\CE\textwidth,width=\CE\textwidth]{pic-2.pdf}}\hfill
			\subfloat[]{\includegraphics[height=\CE\textwidth,width=\CE\textwidth]{pic-3.pdf}}\hfill
			\subfloat[]{\includegraphics[height=\CE\textwidth, width=\CE\textwidth]{pic-4.pdf}}
			\caption{This is a set of random data series.}
			\label{fig-2}
		\end{figure}
	\end{frame}
	
	\begin{frame}{Figure in columns environment}
		\begin{columns}
			\begin{column}{0.5\textwidth}
				The right side is a figure in the columns environment.\\ \bigskip
				There are three figures in these two slides, that is Fig. $\ref{fig-1}$, Fig. $\ref{fig-2}$, and Fig. $\ref{fig-3}$.
			\end{column}

			\begin{column}{0.5\textwidth}
				\begin{figure}
					\centering
					\includegraphics[width=0.7\textwidth]{pic-1.pdf}
					\caption{This is a random data series}
					\label{fig-3}
				\end{figure}
			\end{column}
		\end{columns}
	\end{frame}
\end{document}

beamer1-1

beamer1-2


Dispalying figure caption number

Under default settings, as can be seen, there exist no caption number although the figure counter is available. And setting to display it is also very simple, all we need is setting:

1
\setbeamertemplate{caption}[numbered]

in the preamble area [3].

beamer2-1

beamer2-2


References

[1] Customise Figure Caption Style in LaTeX System - What a starry night ~.

[2] Organise Multi-figure Layout in LaTeX System - What a starry night ~.

[3] Beamer Presentation: Figure has no number? - Stack Exchange.

[4] Figures in Beamer - A detailed tutorial - LaTeX Beamer.