Example:
\documentclass[]{article}
\usepackage{hhline,booktabs}
\usepackage{tabularx}
\usepackage{ltablex}
\begin{document}
\begin{table}
\caption{My Table 1}
\label{tab:mytable1}
\begin{tabularx}{\textwidth}{lXX} \toprule
a & b & c \ \midrule
1 & 2 & 3\ \hline
\end{tabularx}
\end{table}
\begin{table}
\caption{My Table 2}
\label{tab:mytable2}
\begin{tabularx}{\textwidth}{lXX} \toprule
d & e & f \ \midrule
4 & 5 & 6\ \hline
\end{tabularx}
\end{table}
\end{document}
This code result in this:
As you can see, the automatic enumeration does not count correctly here. I guess, it counts both \table and \tabularx.
In this very similar question it is stated that the reason is the ltablex package which should be removed. Well, I need it because some of my tables are really long and need to be spread over several pages.
Is there a way to solve this problem? I require:
- long tables
- flexible column widths (the X feature)
- captions and labels
Thanks in advance.

tablea – David Carlisle Mar 17 '23 at 12:54tabularxandlongtablemeaning you would have access toX-type column with a table continuing on subsequent pages. – Celdor Mar 17 '23 at 13:30