Latex takes care of the number of tables by itself. Like it will automatically number the table as Table 4 etc. I want to use this number in the text.

For example, if I write "See Table 4" and later on I insert one more table above it then Table 4 becomes Table 5 but my text still says Table 4 which is inconsistent.

  • 4
    You need to insert \label{name} after the table caption and then you can refer to the table by \ref{name} in the text. LaTeX will take care of updating the number. You will need to compile the document twice to get the referencing right.
    – mythealias
    Mar 3 '13 at 19:04
  • 1
    When a structural change in the document occurs that affects the numbers of sectioning headers and floats, be sure to recompile twice so that all cross-references are fully updated. For a general discussion of LaTeX cross-referencing methods see, e.g., tex.stackexchange.com/a/36312/5001.
    – Mico
    Mar 3 '13 at 19:55

I suggest to have a look at The Not So Short Introduction to LaTex2e, in particular Section 2.8, which explains cross referencing.

In short, you need to define a label for your table, and later on reference this label to have an always updated number. It looks like this:

    Some & text
  \caption{The caption of the table}\label{table:somename}
In text, I can reference the Table~\ref{table:somename} like this.

You need to run latex twice to get the reference mechanism correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.