# Why does ltablex skip a number in captions?

The below example presents two tables with an tabularx environment (taken from package ltablex) and a caption. After each tabularx-table, the table counter skips one, as if both the caption and the tabularx environment increase it, while the latter shouldn't.

\documentclass{report}
\usepackage{ltablex}
\begin{document}

\begin{table}
\caption{Caption 1.} % "Table 1"
\begin{tabularx}{\linewidth}{|c|}
empty table
\end{tabularx}
\end{table}

\begin{table}
\caption{Caption 2.} % "Table 3"
\begin{tabularx}{\linewidth}{|c|}
empty table
\end{tabularx}
\end{table}

\end{document}


My reputation doesn't allow me to upload a picture, but the captions are Table 1 and Table 3 respectively.

• Consider using the tabu package. – cacamailg Apr 22 '13 at 12:54
• Note that the document would work as you have it if you used the standard tabularx package version of tabularx instead of the ltablex version. – David Carlisle Apr 22 '13 at 13:11
• @DavidCarlisle: I realized that, but I needed ltablex for a different table and cannot use them side-by-side (right?). – roelandvanbeek Apr 22 '13 at 13:35
• @roelandvanbeek ltablex includes tabularx (and then changes it) so no you can not use the original in that case., you could use my own merger of tabularx and longtable instead: ltxtable package. but Herbert's answer is the usage intended by ltablex I think. – David Carlisle Apr 22 '13 at 14:35

ltablex behaves like a longtable, the reason why you should use the \caption as a tabular line:

\documentclass{report}
\usepackage{ltablex}
\begin{document}

\begin{table}
\begin{tabularx}{\linewidth}{|c|}
\caption{Caption 1.}\\ % "Table 1"
empty table
\end{tabularx}
\end{table}

\begin{table}
\begin{tabularx}{\linewidth}{|c|}
\caption{Caption 2.}\\ % "Table 2"
empty table
\end{tabularx}
\end{table}

\end{document}