0

I'm using a poster template on Overleaf (Imperial College London template) but when I put in figures I'm not getting the figure number in the caption section.

This is my document preamble:

\documentclass[xcolor={table}]{beamer}
\usepackage[size=a0,orientation=portrait,scale=1]{beamerposter}
\usepackage{amsmath,amsthm}
\usepackage{amssymb}
\usepackage{subcaption}
\usepackage{cite}
\usepackage{comment}

\begin{document}
\begin{frame}[fragile=singleslide,t]\centering
\begin{columns}[onlytextwidth,T]

\begin{column}{.47\textwidth}

\begin{figure}
     \centering
     \begin{minipage}[b]{0.4\textwidth}
         \includegraphics[width=0.6\hsize]{Cauchy_arm1.PNG}
         \caption{$Q$ with two sign changes}
         \label{fig:Cauchy_arm1}
     \end{minipage}
\hfill
    \begin{minipage}[b]{0.4\textwidth}
        \includegraphics[width=0.6\hsize]{Cauchy_arm2.PNG}
        \caption{$Q$ with one sign change}
        \label{fig:Cauchy_arm2}
    \end{minipage}
\end{figure}


\end{column}
\end{columns}
\end{frame}
\end{document}

Code output: out put of code

I haven't used overleaf much and the times that I've used similar code in TeXmaker. It worked fine, I'm not sure why this isn't working here. Does anyone know what I've done wrong?

3
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
    – Rmano
    Commented Jul 17, 2021 at 16:27
  • 2
    By default figures in a document created using the beamer class are not numbered. You could add \setbeamertemplate{caption}[numbered] to the preamble of your document to get numbered figures.
    – leandriis
    Commented Jul 17, 2021 at 16:48
  • @Rmano understood, ill update for clarity Commented Jul 17, 2021 at 20:26

1 Answer 1

0

I assume you want to use the subfigure functionality. An alternative way is as below:

\documentclass{beamer}

\usepackage{graphicx}
\usepackage{subcaption}

\setbeamertemplate{caption}[numbered]

\begin{document}
    
\begin{frame}
  \frametitle{}
    
\begin{figure}[ht!] 
    \centering
    \begin{subfigure}[t]{0.4\textwidth}
        \centering
        \includegraphics[width=\linewidth]{a.png}
        \caption{}
        \label{fig:my_label_a}
    \end{subfigure}
    \begin{subfigure}[t]{0.4\textwidth}
        \centering
        \includegraphics[width=\linewidth]{b.png}
        \caption{}
        \label{fig:my_label_b}
    \end{subfigure}
    \caption{Caption here}
    \label{fig:my_label}
\end{figure}

\end{frame}

\end{document}

which yields

enter image description here

4
  • Which documentclass did you use to compile your code? If I use beamer, just as the OP, I still get an unnumbered figure.
    – leandriis
    Commented Jul 17, 2021 at 16:47
  • I updated above for beamer. Please try above now. Commented Jul 17, 2021 at 16:56
  • thanks this works great :) Commented Jul 17, 2021 at 20:29
  • 1
    graphicx package is already loaded by beamer, so you not need to load it again.
    – Zarko
    Commented Jul 17, 2021 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .