[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Referencing Tables in Latex?



Peter S Galbraith <GalbraithP@dfo-mpo.gc.ca> wrote (about my
suggestion on how to put a \label in in a table):

>>   \label{tab:a-table}
>>   \caption{blablabla}
>> \end{table}
>
>I think that's wrong.  Have you tried it?
>
>The \label needs to be in a \caption.

Well, actually I haven't tried right before writing the
answer. Sorry. On the other hand, the way I described how to do it is
the way my Emacs editor prompts me how to do it. The following works
for me:

\documentclass[11pt]{artikel3}
\begin{document}
In table~\ref{tab:tabel1} we see blablabla, while in
table~\ref{tab:tabel2} we see bliblibli.
\begin{table}[htbp]
  \begin{tabular}{ll}
bla & bla \\
bla & bla \\
bla & bla \\
bla & bla \\
  \end{tabular}
  \caption{De blablabla tabel}
  \label{tab:tabel1}
\end{table}

\begin{table}[htbp]
  \begin{tabular}{ll}
bli & bli \\
bli & bli \\
bli & bli \\
bli & bli \\
  \end{tabular}
  \caption{De bliblibli tabel}
  \label{tab:tabel2}
\end{table}
\end{document}


Reply to: