0

I have the following problem:

I'm writing an article. I wrote text, then inserted a table. The first table is labeled as Table I with the caption command. I also have, for instance, two other tables in the Appendix, which are labeled as Table 2 and Table 3.

However, when I insert a table into the text again, it labels the second table in the text as Table 2 and not as Table 4? Unfortunately, the number of tables is not continuously. How can I fix this?

Edit:

Here is an example, where my problem is:

enter image description here

Till now, everything is fine, now, i want to add another table in the text, and i get this:

enter image description here

I would like to have that the second table in the text is labeled as Table 4 and not as Table 2.

Here u can find my latex code for it:

\usepackage{caption}

\begin{document}

\section{Introduction}

Text......
\begin{table}[htbp]
  \centering
  \caption{Table A}
    \begin{tabular}{l}
    \toprule
    A \\
    \bottomrule
    \end{tabular}
  \label{tab:addlabel}
\end{table}

\noindent
Text....

% Table generated by Excel2LaTeX from sheet 'Tabelle1'
\begin{table}[htbp]
  \centering
  \caption{D}
    \begin{tabular}{l}
    \toprule
    D \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%


\section{Appendix}
\subsection{Tables}

\begin{table}[htbp]
  \centering
  \caption{A and B}
    \begin{tabular}{ll}
    \toprule
    A     & B \\
    \bottomrule
    \end{tabular}
  \label{tab:addlabel}
\end{table}

\begin{table}[h!]
  \centering
  \caption{A, B and C}
    \begin{tabular}{lll}
    \toprule
    A     & B     & C \\
    \bottomrule
    \end{tabular}
  \label{tab:addlabel}
\end{table}



\end{document}
  • 1
    what you describe is not the usual behaviour so there is an error in code you have not shown. It is always best to include a complete small document that shows the problem – David Carlisle Jul 12 at 11:38
  • 1
    Where exactly are those four tables in the flow from start to finish? Normally appedix comes at the end. So if you insert a new table after table 1, it will become table 2, and the two tables in the appendix will be 3 and 4. Which it should. Remember never use hard coded numbers when you refer to something that LaTeX numbers, always use the label+ref mechanism. – daleif Jul 12 at 11:44
1

It seems that you want to number the tables out of order. That is a strange requirement but simply avoid using latex's automatic numbering, either by not using \caption or by using the unnumbered \caption* and then add numbers by hand as part of the caption text.

enter image description here

\documentclass{article}

\usepackage{caption,booktabs}
\setcounter{totalnumber}{5}

\begin{document}

\section{Introduction}

Text......

\begin{table}[htbp]
  \centering
  \caption*{Table 1: Table A}
    \begin{tabular}{l}
    \toprule
    A \\
    \bottomrule
    \end{tabular}
  \label{tab:addlabelzzzz}
\end{table}

\noindent
Text....

% Table generated by Excel2LaTeX from sheet 'Tabelle1'
\begin{table}[htbp]
  \centering
  \caption*{Table 4: D}
    \begin{tabular}{l}
    \toprule
    D \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabelzzz}%
\end{table}%


\section{Appendix}
\subsection{Tables}

\begin{table}[htbp]
  \centering
  \caption*{Table 2: A and B}
    \begin{tabular}{ll}
    \toprule
    A     & B \\
    \bottomrule
    \end{tabular}
  \label{tab:addlabelzz}
\end{table}

\begin{table}[htp]% dont use [h!]
  \centering
  \caption*{Table 3: A, B and C}
    \begin{tabular}{lll}
    \toprule
    A     & B     & C \\
    \bottomrule
    \end{tabular}
  \label{tab:addlabelz}
\end{table}



\end{document}
  • thank u for ur reply. I used the latex numbering, because in my work i have more than 3 tables. I thought its might be more suitable to do in that way as numbering each table manually. is there really no other way, than manually adding the table number? thank you in advance. – tibiooo Jul 12 at 12:35
  • @texx you have given no indication of how the ordering is produced. TeX is just reading your source file, and that has no information about its edit history of which order you added the tables so that time order can not be used, so the only possibilities are that it orders the tables in the order they are in the file (this is the case in 99.99999% of all documents) or that as I suggest here that you manually say which number to use in each case. – David Carlisle Jul 12 at 13:12
  • @texx why do you want the second table to be numbered 4? – David Carlisle Jul 12 at 13:13
  • @texx that is if you do not manually write Table 4 into that table, how can latex know to number it 4 if it is the second table? – David Carlisle Jul 12 at 13:23
  • i would like it to label it as Table 4, because it will be the fourth table that i will mention in the text. However, I did it manually and it worked. Thanks again for your help. – tibiooo Jul 12 at 13:32

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.