Here is a working example illustrating my problem:
\documentclass[12pt]{article}
\usepackage{booktabs, ltablex, siunitx, threeparttablex}
\usepackage[labelsep=endash, skip=5pt]{caption}
\newcommand{\rowgroup}[1]{\hspace{-2em}#1} % for indentation tables
\sisetup{
group-separator={,},
group-four-digits=true,
table-space-text-pre = (,
table-space-text-post = ),
table-space-text-post= \textsuperscript{*},
retain-explicit-plus,
input-open-uncertainty = ,
input-close-uncertainty = ,
table-align-text-pre = false,
table-align-text-post = false,
round-mode=places,
round-precision = 2,
tight-spacing = true
}
\keepXColumns
\usepackage{setspace}
\begin{document}
\setstretch{0.85}
First table is Table \ref{tab:t1}:
\begin{ThreePartTable}
\small
\begin{TableNotes}[flushleft]\footnotesize
\item \textit{Notes:} Bla ...
\end{TableNotes}
\begin{tabularx}{0.9\textwidth}{ @{\hspace*{\leftmargin}}
l S[table-format=+1.2] S[table-format=-1.2] }
\caption {Alternative explanations; estimates for firm size regressions}\label{tab:t1} \\ \toprule
& {Low unemployment} & {High unemployment} \\
& {(1)} & {(2)} \\ \cmidrule(r){2-3}
\endfirsthead
\multicolumn{3}{c}%
{\vspace{5pt}{\tablename\ \thetable{} -- continued from previous page}} \\ \midrule
& {Low unemployment} & {High unemployment} \\
& {(1)} & {(2)} \\ \cmidrule(r){2-3}
\endhead
\multicolumn{3}{c}%
{\textit{Continue to next page}} \\ \midrule
\endfoot
\endlastfoot
\addlinespace
\rowgroup{\textit{Panel A: Buniness cycle conditions}}
& {\phantom{Low unemployment}} & {\phantom{High unemployment}} \\ \addlinespace
{Year 1}
& {...} & {...}\\
& ({...}) & ({...}) \\
{Year 2}
& {...} & {...} \\
& ({...}) & ({...}) \\
{Year 3}
& {...} & {...} \\
& ({...}) & ({...}) \\ \midrule
\end{tabularx}
\vspace{-20pt}
\begin{tabularx}{0.9\textwidth}{ @{\hspace*{\leftmargin}}
l S[table-format=-1.2] S[table-format=-1.2] }
& {Low unemployment} & {High unemployment} \\
& {(1)} & {(2)} \\ \cmidrule(r){2-3}
\addlinespace
\rowgroup{\textit{Panel B: ...\phantom{iness cycle conditions}}}
& {\phantom{Low unemployment}} & {\phantom{High unemployment}} \\ \addlinespace
{Year 1}
& {...} & {...}\\
& ({...}) & ({...}) \\
{Year 2}
& {...} & {...} \\
& ({...}) & ({...}) \\
{Year 3}
& {...} & {...} \\
& ({...}) & ({...}) \\
\bottomrule
\insertTableNotes
\endlastfoot
\end{tabularx}
\end{ThreePartTable}
Second table is Table \ref{tab:t2}:
\begin{table}[h!]
\caption{\label{tab:t2} The second table}
\centering
\begin{tabular}{ccc}
\toprule
column 1 & column 2 & column 3 \\ \midrule
... & ... & ... \\
... & ... & ... \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
The issue is that the labels numbering is inflated by one when compiling first table, so that the second table appears to be Table 3, and not Table 2. Thanks for any suggestions.
EDIT:
For those interested in why I actually need two tabularx
nested inside the ThreePartTable
environment, see this question.
In short, I use one tabularx
for each panel of the table in order to be able to flexibly set the siunitx
columns in each panel.
\addtocounter{table}{-1}
. But have you any reason to use twotabularx
environment for the first table?