2

I have a table and am trying to include a caption and label. The caption is printed but with the wrong number. It is my first table in the document, but latex uses the number of my Chapter (3.1) for the table. I tried fixing it by manipulating the counter, but it will only change between 3.1 and 3.2.

This is my code:

\setcounter{table}{0} 
\begin{table}[h!]
\begin{tabu}to 0.8\textwidth { | X[c] || X[c] | X[c] | }
\hline
Measure & Min & Max \\ 
\hline \hline
One & 1 & 26 \\ 
\hline
Two & 6.353 & 2.2 \\ 
\hline
Three & 0 & 8.46 \\ 
\hline
Four & -16.86 & -2.94 \\ 
\hline
\end{tabu}
\caption{Statistics of indices}
\label{table:1}
\end{table}

Can somebody help? I've been fighting with this table for hours and would really appreciate tips!

visitor
  • 21
  • 1
    Table 3.1 for the first table in chapter 3 is correct. What do you expect instead? – user187802 May 11 '19 at 12:05
  • Just Table 1. I've seen the table numeration being independent from the chapters in other documents and thought that was the normal way to do it? This sounds like there were several tables before this one – visitor May 11 '19 at 12:13
  • 4
    Add \counterwithout{table}{chapter} to your preamble. – Bernard May 11 '19 at 12:14
  • @Bernard. Works perfectly, thank you! One last thing: I positioned the table with [h!], how do I put the caption right under it? It's somehow shifted to the left – visitor May 11 '19 at 12:23
  • @visitor: The normal way is Table 3.1 and starting the counting new for each chapter. – user187802 May 11 '19 at 12:25
  • Normally it is centred in its line. Add \centering just after \begin{table}. – Bernard May 11 '19 at 12:26
  • @Bernard, I tried \centering, but it doesn't change anything. The caption is aligned with the text above the table. – visitor May 11 '19 at 12:30
  • Just got it. Made a mistake with the package needed for \centering. Thank you all for your quick help! – visitor May 11 '19 at 12:33
  • 1
    No package is require for \centering. – Bernard May 11 '19 at 13:04

0 Answers0