Graphics, Figures & TablesCross-reference problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ChemistKatie
Posts: 14
Joined: Wed Sep 01, 2010 4:47 pm

Cross-reference problem

Post by ChemistKatie »

Hi

I am having issues with my cross-references. I have a few cross references in which I want to use the \ref{blah} command before I have writting the \label{blah} command resulting in (??) appearring in the compiled file.

Here is an example:

Code: Select all

\documentclass[a4paper,12pt]{report}
\begin{document}

Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah (\ref{Blah})  blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

\begin{table}[!htb]
\begin{tabular} {|ccc|}
\hline
		x & y & z\\
		x & y & z\\
		x & y & z\\
		x & y & z\\
		x & y & z\\
		\hline
		\end{tabular}
	\label{Blah}
	\caption{blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah}
\end{table}
	
\end{document}
I have trawled the internet and have found nothing that discusses this problem. I have tried compiling the file a couple of times before veiewing the PDF but this does not help.

Is there any way of sorting it?

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Cross-reference problem

Post by localghost »

\label has always to be placed after \caption.


Thorsten
Post Reply