3

I have tried \caption{\label{fig:your-figure}Caption goes here.}. But it's not working. Can anyone please help?

\documentclass[10pt, blue]{beamer}
\mode<presentation>
{
  \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
  \usecolortheme{default} % or try albatross, beaver, crane, ...
  \usefonttheme{default}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\PassOptionsToPackage{demo}{graphicx}
\begin{document}
\begin{frame}
    \centering
    \begin{tabular}{c}
        (a)\\
        \includegraphics[height=3.5cm, width=9cm]{black1}
    \end{tabular}

    \vspace{0.01em}
    \begin{tabular}{c}
        (b)\\
        \includegraphics[height=3.5cm, width=9cm]{black1}
    \end{tabular}
\end{frame}

\end{document}
4

enter image description here

For have a caption, you need enclose your images with figure environment. Use of tabular are superfluous:

\documentclass[10pt, blue, demo]{beamer}
\mode<presentation>
{
  \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
  \usecolortheme{default} % or try albatross, beaver, crane, ...
  \usefonttheme{default}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
}

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
%\PassOptionsToPackage{demo}{graphicx}
\begin{document}
\begin{frame}
\begin{figure}
    \centering
%    \begin{tabular}{c}
        (a)\\
        \includegraphics[height=3.5cm, width=9cm]{black1}
%    \end{tabular}

    \smallskip
%    \begin{tabular}{c}
        (b)\\
        \includegraphics[height=3.5cm, width=9cm]{black1}
%    \end{tabular}
\caption{Caption goes here.}
    \label{fig:your-figure}
\end{figure}
\end{frame}
1

You could use the subcaption package

\documentclass[10pt, blue]{beamer}
\mode<presentation>
{
  \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...
  \usecolortheme{default} % or try albatross, beaver, crane, ...
  \usefonttheme{default}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\PassOptionsToPackage{demo}{graphicx}

\usepackage{subcaption}

\begin{document}

\begin{figure}
    \begin{subfigure}{1\textwidth}\centering
        \caption{This is Caption a}
            \includegraphics[height=3.5cm, width=9cm]{black1}
    \end{subfigure}
    \begin{subfigure}{1\textwidth}\centering
        \caption{This is Caption b}
            \includegraphics[height=3.5cm, width=9cm]{black1}
    \end{subfigure} 
\caption{This is a caption for a and b}
\end{figure}

\end{document}
0

You don't have a table environment, so \caption doesn't have anything to actually caption. Either you encapsulate the two tabulars in a table environment, or (as I would recommend for a presentation) just forget about \caption, and write the description as a simple line of text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.