\documentclass[preprint,floatfix] {revtex4}
\usepackage{caption}
\usepackage{booktabs}
\begin{document}
\renewcommand{\thetable}{\arabic{table}}
\begingroup
\squeezetable
\begin{table}
\captionsetup{font=scriptsize}
\caption {\label{tab:table1} SUMMARY STATISTICS FOR CONTRIBUTIONS BY INDIVIDUAL CONTRIBUTORS}
\begin{ruledtabular}
\begin{tabular}{llllll}
& \multicolumn{2}{c}{Pre-block} & \multicolumn{2}{c}{Post-block} & Paired \textit{t}-test \\
\cline{2-3} \cline{4-5} \cline{6-6}
& Mean & Standard error & Mean
& Standard error & \textit{t}-stats \\ \hline
\input{table1_panelA}
\hline
\addlinespace[0.3cm]
\input{table1_panelB}
\end{tabular}
\end{ruledtabular}
\end{table}
\endgroup
\end{document}
3 Answers
- on-topic issue: use of
threeparttable
is promising way to solve your problem (as suggested in @ AboAmmar comment and provided an example in @js Bibra answer) - off-topic issues, I would make the following changes in your table design:
- instead of
revtex4
userevtex4-2
version of document class, which support rules from thebooktabs
package - for horizontal rules use rules defined in the
booktabs
package - for columns with number use
S
column type, defined in thesiunitx
package
- instead of
- using dummy numbers for table content, An MWE can be:
\documentclass[preprint,floatfix] {revtex4-2}
%\usepackage{caption}
%\captionsetup{font=scriptsize}
\usepackage{booktabs,
multirow, threeparttable} % new
\usepackage{siunitx} % new
\usepackage{xparse} % new
\NewExpandableDocumentCommand\mcc{O{1}m}
{\multicolumn{#1}{c}{#2}}
\usepackage{lipsum} % for dummy text
\begin{document}
\lipsum[11]
\begin{table}[ht]
\begin{threeparttable}
\caption {Summary statistics for contributions by individual contributors}
\label{tab:table1}
\begin{tabular}{l
*{2}{S[table-format=3.2]S[table-format=3.2]}
S[table-format=3.2]}
\toprule
\multirow{2.4}{*}{Contributor}
& \mcc[2]{Pre-block} & \mcc[2]{Post-block} & {Paired $t$-test} \\
\cmidrule(l){2-3}
\cmidrule(l){4-5}
\cmidrule(l){6-6}
& {Mean} & {SE\tnote{a}} & {Mean} & {SE} & {\textit{t}-stats} \\ & {Mean} & {SE\tnote{a}} & {Mean} & {SE} & {\textit{t}-stats} \\ \midrule
panel A\tnote{b}
& 123.45 & 12.3 & 123.45 & 12.3 & 123.45 \\
\midrule
panel B\tnote{c}
& 124.82 & 9.1 & 124.82 & 9.1 & 124.8 \\
& 124.82 & 9.1 & 124.82 & 9.1 & 124.8 \\
\bottomrule
\end{tabular}
\begin{tablenotes}[flushleft]\footnotesize
\item[a] SE: Standard error
\item[b] description of th panel A
\item[c] description of the panel B
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
You can use {NiceTabular}
of nicematrix
which have a built-in command \tabularnote
to typeset the notes of a tabular. You can thoroughly customize the notes (the notes under the tabular are composed in a type of list of enumitem
).
\documentclass{article}
\usepackage{nicematrix}
\usepackage{enumitem}
\begin{document}
\begin{table*}[ht]
\caption{Revisions}
\centering
\begin{NiceTabular}{p{0.10\linewidth}
p{0.15\linewidth}
p{0.45\linewidth}
p{0.20\linewidth}}%
\hline
Title 1 & Title 2 & Title 3 & Title 4 \\
\hline
Cell 1 & Cell 1 & Cell 3 & Cell 4\tabularnote{My note} \\
Cell 1 & Cell 1 & Cell 3 & Cell 4\tabularnote{My other note} \\
\hline
\end{NiceTabular}
\end{table*}
\end{document}
Starting from the excellent suggestion by @AboAmmar
MWE
\documentclass{article}
\usepackage[flushleft]{threeparttable}
\begin{document}
\begin{table*}[ht]
\caption{Revisions}
\begin{threeparttable}
\centering
\begin{tabular}{p{0.10\linewidth}
p{0.15\linewidth}
p{0.45\linewidth}
p{0.20\linewidth}}
\hline
Title 1 & Title 2 & Title 3 & Title 4 \\
\hline
Cell 1 & Cell 1 & Cell 3 & Cell 4 \tnote{a} \\
Cell 1 & Cell 1 & Cell 3 & Cell 4 \tnote{b} \\
\hline
\end{tabular}
\begin{tablenotes}
\item[a] My Note.
\item[b] My Other Note.
\end{tablenotes}
\end{threeparttable}
\end{table*}
\end{document}
This solution already exists at - https://tex.stackexchange.com/a/146129/197451
-
1You don't notice the difference because this tabular is crafted to occupy the whole
\linewidth
, but the\caption
can or should go inside thethreeparttable
to be given the same width as the tabular and the notes. (Otherwise it would be "twoparttable" :-) Commented Mar 25, 2020 at 3:12
\threeparttable
? BTW, make your MWE compilable so others can help you better.booktab
package andS
columns defined in thesiunitx
package.