I just found that after I used tabularx, the table number in my document is not right, shown as follows

enter image description here

where the first four tables were done using tabularx and they are all even numbered, despite the fact that no other tables are there in between, while the tables done using normal tabularx are numbered rightly. The following code is the structure I used

\usepackage[margin=0.85in, paperwidth=8.5in, paperheight=11in ]{geometry}
\usepackage{siunitx}   %%package for scientific notation





\newcommand{\tabitem}{~~\llap{\textbullet}~~} %%% bullet in table



     colorlinks   = true,
     citecolor    = Blue

\usepackage[utf8]{inputenc} %%page number
\setlength{\parindent}{0pt} %no indentation
    \setlist[itemize]{wide =0pt, leftmargin=*, nosep, before=\vspace{-\baselineskip}, after = \vspace{-\baselineskip}}
    \begin{tabularx}{\linewidth}{|c |X |} \hline
    \thead{Title One} & \thead{Title Two} \\
    \textbf{Things One} &  Content One\\
    \caption[Blah Blah]{Blah Blah}

and how it looks like in the report enter image description here

Everything is fine apart from the table number. Any suggestions on how to fix it. Thanks in advance.

  • Please add a minimal working example (MWE) that illustrates your problem.
    – TH.
    Commented Jun 15, 2017 at 3:47
  • A minimal working example is the code that is minimal and has the same issue as described. The code above misses \documentclass, the relevant packages and is not compilable
    – user31729
    Commented Jun 15, 2017 at 4:16
  • @ChristianHupfer I've added whatever package I used for my thesis, cz It is really long, I am not sure which one is for the table now.
    – Zhifang Hu
    Commented Jun 15, 2017 at 4:30
  • @ZhifangHu: You're using ltablex which is the longtable version for tabularx. Just put the \caption and the \label command before \end{tabularx}
    – user31729
    Commented Jun 15, 2017 at 4:40

1 Answer 1


ltablex uses longtable in the background in order to merge the features of tabularx and breakable tabular environment.

However, longtable increases the table counter even if there is no \caption command.

The \caption command should be inside in the longtable environment, which is no floating environment then and everything will be alright. Using it outside in the redefined tabularx environment the environment will increase table and the outer \caption will step it again, so the table number steps by 2 and not by one, as expected.

Solution: Use \caption within \begin{tabularx}...\end{tabularx}, not after it.

The table environment around the redefined tabularx environment is not really useful, in my point of view. Removing it would make \caption outside of tabularx impossible any way, so shifting the \caption inside of tabularx is the best way, other than manipulating the table counter





The table number is now: \thetable -- although there is no caption command. 

  \begin{tabularx}{\linewidth}{|c |X |}
  \caption[Blah Blah]{Blah Blah}    \label{tab:inside}  % 'Correct' counting should be 2

% Now with wrong \caption outside

  \begin{tabularx}{\linewidth}{|c |X |}
  \caption[Blah Blah]{Blah Blah}    \label{tab:outside} % Now tabularx increases and \caption increases again: counter is 4

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .