1

I have tried everything. When I run this in overleaf I get (??) but I'm also able to click the (??) to get to the figure in my pdf so clearly the machine understands what I'm referencing but it doesn't give me the number.

The figure (\ref{fig:20_25A}).

\begin{figure}[!h]
    \centering
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/200.png}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/205.png}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/210.png}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/215.png}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/220.png}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/225.png}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/230.png}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{TaskB_20-25/235.png}
    \end{subfigure}
    \label{fig:20_25A}
\end{figure}

It should be a number but it isn't. Why and how do I fix it. I've tried changing the label, its position in the figure code, and much more.

3
  • Might get more help here: tex.stackexchange.com Commented Feb 26, 2024 at 18:46
  • You are missing a \caption{...}. Latex can't reference figures, it can only reference the numbered captions within the figure. Commented Feb 26, 2024 at 23:34
  • @samcarter_is_at_topanswers.xyz You are completely right. Added the caption and it works. Commented Jun 21, 2024 at 18:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.