Graphics, Figures & TablesProblem with table reference

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

Problem with table reference

Post by paulosousa »

Hi people, I have a problem when I call the table in the text using

Code: Select all

\ref{table:name}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Item 1 - have no table, only text
item 2 - when I call table 1, inside the text, the reference writes Table 2 and not Table 1... What am I doing wrong?

Code: Select all

Code, edit and compile here:
\documentclass[12pt, twoside, a4paper]{article}
\usepackage[portuguese]{babel}
\usepackage[applemac]{inputenc}
\usepackage[left=2.0cm,top=1.5cm,right=2.0cm,bottom=1.75cm]{geometry}
\usepackage{amsmath,amssymb,amsfonts,lastpage,textcomp,setspace,color,enumerate,environ,tabularx,enumitem,caption}
\renewcommand*{\theenumii}{\arabic{enumii}}
\begin{document}
\begin{enumerate}[font=\bfseries]
\item HERE I HAVE ONLY TEXT
\item Na Tabela \ref{table:habitantes}, apresentam-se os números de habitantes de Hiller\o d, na Dinamarca, contabilizados de 2004 a 2013, no dia 1 de fevereiro.
\begin{center}
\textbf{Tabela 1} \\ \label{table:habitantes}
\vspace{0.20cm}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\hspace{0.15cm} $t$ \hspace{0.15cm} & 0 & 1 & 3 & 5 & 6 & 8 & 9 \\
\hline
$H$ & 804 & 908 & 1028 & 1392 & 1598 & 1884 & 1998 \\
\hline
\end{tabular}
\end{center}
\end{enumerate}
\end{document}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

BlackForestrian

Problem with table reference

Post by BlackForestrian »

You neither have a \caption nor a \label{table:name} command in your code.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

Problem with table reference

Post by paulosousa »

BlackForestrian wrote:You neither have a \caption nor a \label{table:name} command in your code.
Thanks a lot for the help...
Now the numbering is ok with

Code: Select all

Code, edit and compile here:
\begin{center}
\captionof{table}{} \label{table:habitantes}
\vspace{0.20cm}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\hspace{0.15cm} $t$ \hspace{0.15cm} & 0 & 1 & 3 & 5 & 6 & 8 & 9 \\
\hline
$H$ & 804 & 908 & 1028 & 1392 & 1598 & 1884 & 1998 \\
\hline
\end{tabular}
\end{center}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


but the top title is not really entered with the table. Do you know why?
BlackForestrian

Problem with table reference

Post by BlackForestrian »

paulosousa wrote:
BlackForestrian wrote:You neither have a \caption nor a \label{table:name} command in your code.
Thanks a lot for the help...
Now the numbering is ok with

Code: Select all

Code, edit and compile here:
\begin{center}
\captionof{table}{} \label{table:habitantes}
\vspace{0.20cm}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\hspace{0.15cm} $t$ \hspace{0.15cm} & 0 & 1 & 3 & 5 & 6 & 8 & 9 \\
\hline
$H$ & 804 & 908 & 1028 & 1392 & 1598 & 1884 & 1998 \\
\hline
\end{tabular}
\end{center}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


but the top title is not really entered with the table. Do you know why?
Well, what is the top title? \captionof{table}{} is empty...
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

Problem with table reference

Post by paulosousa »

It must be empty since I need only Table 1 and not Table 1: this is the caption
BlackForestrian wrote:
paulosousa wrote:
BlackForestrian wrote:You neither have a \caption nor a \label{table:name} command in your code.
Thanks a lot for the help...
Now the numbering is ok with

Code: Select all

Code, edit and compile here:
\begin{center}
\captionof{table}{} \label{table:habitantes}
\vspace{0.20cm}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\hspace{0.15cm} $t$ \hspace{0.15cm} & 0 & 1 & 3 & 5 & 6 & 8 & 9 \\
\hline
$H$ & 804 & 908 & 1028 & 1392 & 1598 & 1884 & 1998 \\
\hline
\end{tabular}
\end{center}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


but the top title is not really entered with the table. Do you know why?
Well, what is the top title? \captionof{table}{} is empty...
BlackForestrian

Problem with table reference

Post by BlackForestrian »

You are aware that in your previous posts you did not indicate that Table 1: is the issue?

Please have a look into the documentation of the caption package -- it reveals how to get rid off the :.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

Problem with table reference

Post by paulosousa »

Well, it is almost perfect with ...

Code: Select all

Code, edit and compile here:
\begin{table}[h]
\caption{} \label{table:habitantes}
\centering
\vspace{-0.20cm}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\hspace{0.15cm} $t$ \hspace{0.15cm} & 0 & 1 & 3 & 5 & 6 & 8 & 9 \\
\hline
$H$ & 804 & 908 & 1028 & 1392 & 1598 & 1884 & 1998 \\
\hline
\end{tabular}
\end{table}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Post Reply