General ⇒ Problem with citing figures, citations are displayed incorre
Problem with citing figures, citations are displayed incorre
http://www.photonics.umd.edu/umd/index.html
In it, I am citing several figures that appear within the paper, like this
\begin{figure}
...
\label{fig}
\end{figure}
Later on I cite the figure using \ref{fig}.
In the text, the citation does not appear as "figure 1", but instead appears as "1" bounded by a red box. I have been trying to correct this by searching the .sty files my document is using, but I cannot identify the cause. Does anyone know why LaTex is doing this, or how to fix it?
Thanks for the help.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Problem with citing figures, citations are displayed incorre
You always have to use a caption to create an anchor for reference.Phanixis wrote:[…] Does anyone know why LaTex is doing this, or how to fix it? […]
Code: Select all
\begin{figure}[!ht]
\rule{4cm{3cm}
\caption{Dummy figure}\label{fig:dummy}
\end{figure}
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Problem with citing figures, citations are displayed incorre
Also, the problem isn't that LaTex is unable to find the correct figure, its that it is not displaying the caption properly. I almost suspect that somewhere in one of the packages /ref has been redefined to bound the citation number by boxes instead of writting the word "figure" in front of the citation number.