Theses, Books, Title pagesProblem with referencing figures

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Problem with referencing figures

Post by templateuser »

Hi,

first of all thanks for the great template!

I'm having trouble with referencing figures, as the title says.
I'm including vector images (typically plotted with Inkscape) with .pdf extension. They are correctly included, with captions and everything.

The problem arises when I write something like "As we can see in Fig.~\ref{label}, ..."
Even after multiple compilations, the double question mark isn't substituted with the figure number displayed in the caption.
Strangely enough, if I click on the question marks (in the output pdf), then I am sent to the right picture! So I deduce that the picture is correctly referenced, but I can't find a way to display its number.

I don't know if this is a template issue: the electron picture example works fine with its reference, even if it is just another pdf.

Do you have any idea of what could be going on?

Thanks in advance!
Andrea

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Vel
Site Moderator
Posts: 463
Joined: Fri Jun 29, 2012 1:20 am

Problem with referencing figures

Post by Vel »

Hi Andrea,

Hmm, are you adding a correct label to your figure environment? You should have something like \label{fig:name} within the \begin{figure} ... \end{figure} environment which you then refer to as \ref{fig:name} in-text to cite it.

If you have that already, can you paste your figure environment and the reference you're trying to use here and I'll see if I can replicate the problem.

Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Problem with referencing figures

Post by templateuser »

Hi Vel,
actually I solved my problem.

It was that I was putting labels before captions, in the figure environment.
Now I discovered that it is something to avoid.

Thanks for your time!
Andrea
Post Reply