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

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

User avatar
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