Graphics, Figures & TablesReference a figure [Solved]

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
summers
Posts: 2
Joined: Tue Dec 31, 2024 3:15 pm

Reference a figure [Solved]

Post by summers »

I'm obviously doing something simple wrong, but for the life of me can't work out what. I'm trying to reference a figure, but the reference never gets saved in the aux file, and so I can't reference it. In the LaTeX file I create the figure, before referencing the figure - but page layout means that the figure is moved after the reference. This is the LaTeX:

Code: Select all

\begin{figure}
  \begin{center}
    \includegraphics[width=\textwidth]{CyclesOfset.pdf}
  \end{center}
  \caption{The number of cycles (at 100kHz) of the filter response
    from an integrator, with $a=1-2^{-16}$.}
  \label{fig:COfset}
\end{figure}
Similarly shown in fig \cite{fig:COfset}
So what am I doing wrong, the same code seems to work elsewhere in the document.
Last edited by summers on Tue Dec 31, 2024 4:13 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Re: Reference a figure

Post by Stefan Kottwitz »

Hi summers,

welcome to the forum!

Use \ref instead of \cite.

Stefan
LaTeX.org admin
summers
Posts: 2
Joined: Tue Dec 31, 2024 3:15 pm

Re: Reference a figure

Post by summers »

Bingo! Yes indeed it was something obvious - I should have seen that!
Post Reply