2

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}
3
  • This is a bug in ltablex really, if you just use tabularx you get the expected numbering Apr 7, 2016 at 13:16
  • @DavidCarlisle: Oh, okay. But i need ltablex for tables that break at page break.
    – Spenhouet
    Apr 7, 2016 at 13:23
  • 1
    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) Apr 7, 2016 at 13:30

1 Answer 1

2

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}
1
  • 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, 2016 at 14:24

You must log in to answer this question.

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