First time posting so apologies if any mistakes/ommitted info
I have some regression tables that I am trying to put as separate subtables within a table that spans over two pages, while using \threeparttable to have notes under each portion of the tables that are separated. But as the example below shows, there are still two problems, with the numbering: (1) Table 1 is followed by Table 4 and (2) Subtable b within each table is followed by Subtable c. This was based somewhat on these solutions (1) but still not working...
Thank you, any help is much appreciated!!
\documentclass[a4, 12pt]{article}
\usepackage{tabularx}
\usepackage[flushleft]{threeparttable}
\usepackage{floatrow}
\floatsetup[table]{style=plaintop}
\usepackage{subcaption}
\pagestyle{plain}
\usepackage[tablename=Table]{caption}
\DeclareCaptionTextFormat{up}{#1} % \MakeTextUppercase
\captionsetup[table]{
labelsep=period,
justification=centering,
textformat=up,
}
\begin{document}
Some text, for example noting the numbers in the tables are nonsense
% First table with subtitles
\begin{table} [htp]
\caption{Main table title}\label{tab:main}
% \centering
\begin{threeparttable}
\footnotesize
\begin{subtable}[c]{\textwidth}
\centering
\caption{Subtitle 1}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\
\begin{subtable}[c]{\textwidth}
\centering
\caption{Subtitle 2}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\end{threeparttable}
\begin{tablenotes}[flushleft]
\item \scriptsize{\textit{Notes:} table notes}
\end{tablenotes}
\end{table}
\begin{table} [htp]
\ContinuedFloat
% If possible it would be great here to have the same main table title as above but with the appended text "contd."
\centering
\begin{threeparttable}
\footnotesize
\begin{subtable}[c]{\textwidth}
\centering
\ContinuedFloat
\caption{Subtitle 3}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\
\begin{subtable}[c]{\textwidth}
\centering
\caption{Subtitle 4}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\end{threeparttable}
\begin{tablenotes}[flushleft]
\item \scriptsize{\textit{Notes:} table notes}
\end{tablenotes}
\end{table}
More text noting the numbers in the tables are the same and still nonsense
% Second table with subtitles
\begin{table} [htp]
\caption{Main table title}\label{tab:main}
\centering
\begin{threeparttable}
\footnotesize
\begin{subtable}[c]{\textwidth}
\centering
\caption{Subtitle 1}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\
\begin{subtable}[c]{\textwidth}
\centering
\caption{Subtitle 2}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\end{threeparttable}
\begin{tablenotes}[flushleft]
\item \scriptsize{\textit{Notes:} table notes}
\end{tablenotes}
\end{table}
\begin{table} [htp]
\ContinuedFloat
% If possible it would be great here to have the same main table title as above but with the appended text "contd."
\centering
\begin{threeparttable}
\footnotesize
\begin{subtable}[c]{\textwidth}
\centering
\ContinuedFloat
\caption{Subtitle 3}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\
\begin{subtable}[c]{\textwidth}
\centering
\caption{Subtitle 4}
\input{tables/example}
\vspace{3mm}
\end{subtable}
\end{threeparttable}
\begin{tablenotes}[flushleft]
\item \scriptsize{\textit{Notes:} table notes}
\end{tablenotes}
\end{table}
\end{document}
Not sure if it relevant, but I am generating my tables as a .tex in Stata then including in table using \input{}. So then example.tex looks like:
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{6}{c}}
\hline\hline
&\multicolumn{2}{c}{model group 1} &\multicolumn{2}{c}{model group 2} &\multicolumn{2}{c}{model group 3} \\
&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} &\multicolumn{1}{c}{(4)} &\multicolumn{1}{c}{(5)} &\multicolumn{1}{c}{(6)} \\
\hline
Foo=1& 1.571 & 1.578 & 1.551\sym{***}& 1.177\sym{**} & 1.157 & 1.665 \\
& (1.918) & (1.565) & (1.986) & (1.919) & (1.771) & (1.567) \\
Goo& -1.111 & -1.111 & 1.119\sym{**} & 1.117 & 1.115\sym{**} & 1.116\sym{**} \\
& (1.117) & (1.117) & (1.117) & (1.117) & (1.116) & (1.116) \\
Foo=1 $\times$ Goo& -1.115 & -1.115 & -1.111\sym{***}& -1.111\sym{***}& -1.117\sym{***}& -1.118\sym{***}\\
& (1.115) & (1.115) & (1.115) & (1.115) & (1.115) & (1.115) \\
\hline
Some FE & Y & Y & Y & Y & Y & Y \\
Var1 & N & Y & N & Y & N & Y \\
\hline\hline
\multicolumn{7}{l}{\footnotesize text}\\
\multicolumn{7}{l}{\footnotesize * p $<$ 1.11, ** p $<$ 1.15, *** p $<$ 1.11}\\
\end{tabular}
}

a4is not a valid option for thearticledocument class. You hould probably writea4paper. – Mico Mar 29 '24 at 20:42