Graphics, Figures & Tablestable won't get referenced

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

table won't get referenced

Post by juliette »

Am I doing something wrong here ??
The reference keeps showing up as '??'


\begin{table}[th]
\begin{description}
\item[Table II]
Summary of experimental data used in the present study.
\end{description}
\begin{center}
\begin{tabular}{l c c c c c c c c c c}
... all my data ...
\end{tabular}
\end{center}
\label{tab:basic}
\end{table}

and the way I'm referencing it in the text is: \ref{tab:basic}

but it keeps showing up as questions marks for some reason )=

Recommended reading 2024:

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

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

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

table won't get referenced

Post by localghost »

juliette wrote:Am I doing something wrong here ?? […]
Yes, of course. You need a caption. See lshort.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}

\begin{document}
  \begin{table}[!ht]
    \caption{Summary of experimental data used in the present study}\label{tab:basic}
    \centering
    \begin{tabular}{l*{10}{c}}
      % table contents
    \end{tabular}
  \end{table}
\end{document}
Captions of floats can be customized with the caption package. If you want Roman numerals for the table counter, you can redefine it. Note that float numbering depends on the document class.


Best regards
Thorsten
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: table won't get referenced

Post by juliette »

Or is it that I can't reference tables when using RevTex 4 ??
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

table won't get referenced

Post by localghost »

juliette wrote:Or is it that I can't reference tables when using RevTex 4 ??
No, that's not the cause. See my last reply. A \caption command is essential to get the right numbering for floats.
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: table won't get referenced

Post by juliette »

Perfect! It works! Thanks localgohst, I didn't see your response when typed the response regarding revtex4 .. but your original reply was enough to get it working. Thanks again!!
Post Reply