# Continuous table numbering for ltablex with captionof

Problem:

I want to have a independent table numbering in my appendix for tables that break at page break:

• Table A.1
• Table A.2
• Table A.3

Therefor i use \renewcommand{\thetable}{A.\arabic{table}} but it results in:

• Table A.1
• Table A.3
• Table A.5

I tried to use \addtocounter{table}{-1} and it kinda worked but gave me the warning:

destination with the same identifier (name{table.Alph0.2}) has been already used, duplicate ignored

Question:

How to do continuous table numbering with ltablex?

MWE:

\documentclass{article}
\usepackage{ltablex}
\usepackage{capt-of}
\usepackage{chngcntr}

\begin{document}
\renewcommand{\thetable}{A.\arabic{table}}

\captionof{table}{Table 1} \label{tab:1}
\begin{tabularx}{\textwidth}{c}
\end{tabularx}

\captionof{table}{Table 2} \label{tab:2}
\begin{tabularx}{\textwidth}{c}
\end{tabularx}

\captionof{table}{Table 3} \label{tab:3}
\begin{tabularx}{\textwidth}{c}
\end{tabularx}
\end{document}

• This is a bug in ltablex really, if you just use tabularx you get the expected numbering – David Carlisle Apr 7 '16 at 13:16
• @DavidCarlisle: Oh, okay. But i need ltablex for tables that break at page break. – Spenhouet Apr 7 '16 at 13:23
• personally I'd use longtable for that, but otherwise ltablex makes tabularx into longtable so you can put the caption in the table (I'll post an answer with some code) – David Carlisle Apr 7 '16 at 13:30

Unfortunately ltablex makes all tabularx into longtable this means that the form you use doubles up the counting, however it also means that ypu can use longtable caption directly so:

\documentclass{article}
\usepackage{ltablex}
\usepackage{capt-of}
\usepackage{chngcntr}

\begin{document}
\renewcommand{\thetable}{A.\arabic{table}}

\begin{tabularx}{\textwidth}{c}
\caption{Table 1} \label{tab:1}
\end{tabularx}

\begin{tabularx}{\textwidth}{c}
\caption{Table 2} \label{tab:2}
\end{tabularx}

\begin{tabularx}{\textwidth}{c}
\caption{Table 3} \label{tab:3}
\end{tabularx}
\end{document}

• Very interessting that ltablex changes the tabularx into a longtable! I also had to add a \\ break after the label, but yes it works. Thank you :) – Spenhouet Apr 7 '16 at 14:24