I've followed tutorials online such as https://latex-tutorial.com/tutorials/figures/ and https://www.overleaf.com/learn/latex/How_to_Write_a_Thesis_in_LaTeX_(Part_3):_Figures,_Subfigures_and_Tables#Tables to create referable figures in my document, but all that is outputted is ?? in place of the figure. Here are the packages imported:
\usepackage[utf8]{inputenc}
\usepackage{booktabs} % for much better looking tables
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
\usepackage{multicol}
\usepackage[a4paper, total={8in, 8in}]{geometry}
\usepackage{appendix}
\usepackage{tabularx}
\usepackage{biblatex}%to cite articles
\usepackage{fancyhdr}
\addbibresource{ACS231.bib}%change the name of the file to a different .bib file
\usepackage{graphicx}
\usepackage{comment}
\graphicspath{ {./images/} }
Further down the document:
\begin{document}
\begin{multicols}{2}
\subsection{Electronics Design | Exercise 9}
Here is the electrical diagram.
\begin{figure}[h!]
\centering
\includegraphics[width=7cm]{finalSchematic.jpg}
\caption{Schematic}
\label{fig:schematic}
\end{figure}
\figurename{\ref{fig:schematic}}
\ref{fig:schematic}
\end{document}
\end{multicols}{2}
I tried this in the example program in Overleaf and it worked, suggesting its not the file itself. I'm inclined to think it may be packages interacting. I created a new file and pasted the entire code which gave the same issue. I've seen the issue arise because of incorrect syntax on other posts, but if it worked in the example file it doesn't suggest this is an issue of syntax. Any ideas?
No red circles are appearing, only a yellow warning that corresponds to the log. The line its referring to is:
\ref{fig:schematic}
which to me appears to be referencing something that is in fact labelled?






\figurenamedoes't take an argument and is not usually used explicitly\figurename{\ref{fig:schematic}}would be expected to makefigure??on the first run. If you get an error do not look at the pdf look at the log file (do you have a red circle in overlearf?, show your log) – David Carlisle Apr 06 '21 at 21:20