2

I use the code below for representing three pictures in order as subsections. But, the Figure number is not showing in the caption. Thanks.

\begin{figure}
    \centering
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=\textwidth]{Fig1}
        \caption{Social Networks}
        \label{fig:Social Networks}
    \end{subfigure}
    ~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc. 
      %(or a blank line to force the subfigure onto a new line)
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=\textwidth]{Fig2}
        \caption{Energy Networks}
        \label{fig:Energy Networks}
    \end{subfigure}
    ~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc. 
    %(or a blank line to force the subfigure onto a new line)
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=\textwidth]{Fig3}
        \caption{Internet}
        \label{fig:Internet}
    \end{subfigure}
    \caption{Examples of graph data modelling}
    \label{fig:graph modelling}
\end{figure}
Amin
  • 946

1 Answers1

3

In preamble you need to add

 \setbeamertemplate{caption}[numbered]

than you will obtain the following result:

enter image description here

\documentclass[demo]{beamer}
\setbeamertemplate{caption}[numbered]% <-- added, for other option see beamer manual, page 124
\usepackage{subcaption}

\begin{document}
\begin{frame}
\begin{figure}
    \centering
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=\textwidth]{Fig1}
        \caption{Social Networks}
        \label{fig:Social Networks}
    \end{subfigure}
    ~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
      %(or a blank line to force the subfigure onto a new line)
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=\textwidth]{Fig2}
        \caption{Energy Networks}
        \label{fig:Energy Networks}
    \end{subfigure}
    ~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
    %(or a blank line to force the subfigure onto a new line)
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=\textwidth]{Fig3}
        \caption{Internet}
        \label{fig:Internet}
    \end{subfigure}
    \caption{Examples of graph data modelling}
    \label{fig:graph modelling}
\end{figure}
\end{frame}
See images \ref{fig:Social Networks}, \ref{fig:Energy Networks} and \ref{fig:Internet} in figure \ref{fig:graph modelling}.
\end{document}

Note: your question is related/duplicate to question beamer-presentation-figure-has-no-number.

Zarko
  • 296,517