Graphics, Figures & TablesWhy is there a reference undefined on input?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Kickflip
Posts: 4
Joined: Fri Dec 06, 2019 11:01 am

Why is there a reference undefined on input?

Post by Kickflip »

Hi,

I have a simple code:

Code: Select all

bla bla bla \ref{adhaesion_hysterese} bla bla bla. 

\begin{figure}[H]
	\centering
	\includegraphics[width=0.5\linewidth]{Adhaesion_Hysterese_Pic_Name}
	\caption{bla bla bla (\textsc{Grosch}{Grosch.1963})}			
	\label{adhaesion_hysterese}
\end{figure}
it says: Reference 'adhaesion_hysterese' on page 3 undefined on input line 21


why?

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
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Why is there a reference undefined on input?

Post by Stefan Kottwitz »

Hi,

this document with your code (just completed) runs fine without error:

Code: Select all

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{float}
\begin{document}
la bla bla \ref{adhaesion_hysterese} bla bla bla. 
 
\begin{figure}[H]
	\centering
	\includegraphics[width=0.5\linewidth]{Adhaesion_Hysterese_Pic_Name}
	\caption{bla bla bla (\textsc{Grosch}{Grosch.1963})}			
	\label{adhaesion_hysterese}
\end{figure}
\end{document}
It seems that you are doing actually something different, and that copied code snippets don't show it. Perhaps post a full example, reduced to the minimum, that brings the error, as I did here.

Stefan
LaTeX.org admin
Post Reply