GeneralProblems with command \ref

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
worksofart
Posts: 2
Joined: Mon Mar 17, 2008 7:38 pm

Problems with command \ref

Post by worksofart »

Dear all,
I had a problem with the references of tables and figures. When I compile the PDF, when I refer to a table (for example), it write me the enumeration of the section or the subsection where the table is, in spite of the one of the table.
Do you have any suggestions??
I don't create any label of the section and the subsection and I don't have this problem with equations.

Please, I am really in trouble.
thanks
Luke

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Problems with command \ref

Post by Juanjo »

Have you written the corresponding \label command before \caption? If this were the case, this may be the cause of the problem. Write something like this:

Code: Select all

\begin{figure}
    (some stuff here: \centering, \includegraphics...)
   \caption{Text of the caption}\label{text}
\end{figure}
Same thing with the table environment.
worksofart
Posts: 2
Joined: Mon Mar 17, 2008 7:38 pm

Re: Problems with command \ref

Post by worksofart »

Juanjo, you are a master!!!

It was (obviously) my fault ;)...I used \label before \caption..
thanks for your prompt answer
Post Reply