tabularx 和标题和注释

tabularx 和标题和注释

这是使用包的表格ltablex。有人能告诉我如何包含caption并使用threeparttable这个吗?仅供参考,当我使用时:

\begin{table} 
begin{tabularx} 
...
\end{tabularx} 
\end{table}` 

页面没有中断。建议会非常有帮助。我想添加本例中的标题和脚注表格格式

\documentclass{article}
\usepackage{ltablex}
\usepackage{threeparttable}
\usepackage{booktabs}

\title{Document}
\begin{document}
\maketitle

\begin{tabularx}{\textwidth}{Xc}
\toprule\toprule
Some random text & 1,75,650\\\midrule
\multicolumn{2}{l}{\textbf{Panel A1: AAA}} \\\midrule
Number of observations ... & 1,75,650\\
Delete: ... & (78,420)\\
Delete: ... & (7,104)\\
Final sample & 90,126\\
Delete: & (2,143)\\
Delete: & (8,345)\\
Final sample & 79,638\\\midrule
\multicolumn{2}{l}{\textbf{Panel A2: AAA}} \\\midrule
Number of observations & 79,638\\
Delete: & (39,540)\\
Delete: & (7,979) \\
Final sample & 32,119 \\\midrule
\multicolumn{2}{l}{\textbf{Panel B1: BBB }} \\\midrule
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\\midrule
\multicolumn{2}{l}{\textbf{Panel B2: BBB}} \\\midrule
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\\midrule\bottomrule
\end{tabularx}

\end{document}

答案1

对我来说这threeparttablex似乎有效:接下来,我在长表内插入了表格注释,并在末尾也插入了。标题也没有问题。您必须在紧接着编写表格注释\begin{ThreePartTable}并进行两次编译。

        \documentclass{article}
        \usepackage{ltablex}
        \usepackage{threeparttablex}
        \usepackage{booktabs}
        \usepackage[bf,tablename=TABLE,labelsep=newline,aboveskip=0pt]{caption}

        \title{Document}
        \begin{document}
        \maketitle
        \begin{ThreePartTable}
        \begin{TableNotes}
        \item[a] \label{tn:a}1st lovely note.
        \item[b] \label{tn:b}2nd lovely note.
        \end{TableNotes}
        \begin{tabularx}{\textwidth}{Xc}
        \caption{A Fine Caption}\\
        \toprule\toprule
        Some random text & 1,75,650\\\midrule
        \multicolumn{2}{l}{\textbf{Panel A1: AAA}} \\\midrule
        Number of observations ...\tnote{tn:a} & 1,75,650\\
        Delete: ... & (78,420)\\
        Delete: ... & (7,104)\\
        Final sample & 90,126\\
        Delete: & (2,143)\\
        Delete: & (8,345)\\
        Final sample\tnote{tn:b} & 79,638\\\midrule
        \multicolumn{2}{l}{\textbf{Panel A2: AAA}} \\\midrule
        Number of observations & 79,638\\
        Delete: & (39,540)\\
        Delete: & (7,979) \\
        Final sample & 32,119 \\\midrule
        \insertTableNotes\\[12pt]\midrule
        \multicolumn{2}{l}{\textbf{Panel B1: BBB }} \\\midrule
        Number of observations  & 1,75,650\\
        Delete: & (78,420)\\
        Delete: & (47,136)\\
        Delete: & (7,178)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Final sample & 42,884\\\midrule
        \multicolumn{2}{l}{\textbf{Panel B2: BBB}} \\\midrule
        Number of observations  & 1,75,650\\
        Delete: & (78,420)\\
        Delete: & (47,136)\\
        Delete: & (7,178)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Number of observations  & 1,75,650\\
        Delete: & (78,420)\\
        Delete: & (47,136)\\
        Delete: & (7,178)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Delete: & (32)\\
        Final sample & 42,884\\\midrule\bottomrule
        \insertTableNotes
        \end{tabularx}
        \end{ThreePartTable}

        \end{document} 

在此处输入图片描述

答案2

尝试这个:

\documentclass{article}
\usepackage{ltablex}
\usepackage{threeparttablex}
\usepackage{booktabs}
\usepackage{caption}
\title{Document}
\begin{document}
\maketitle
\captionof{table}{TITLE}
\begin{ThreePartTable}
\begin{tabularx}{\textwidth}{Xc}
\toprule\toprule
Some random text\tnote{a} & 1,75,650\\\midrule
\multicolumn{2}{l}{\textbf{Panel A1: AAA}} \\\midrule
Number of observations ... & 1,75,650\\
Delete: ... & (78,420)\\
Delete: ... & (7,104)\\
Final sample & 90,126\\
Delete: & (2,143)\\
Delete: & (8,345)\\
Final sample & 79,638\\\midrule
\multicolumn{2}{l}{\textbf{Panel A2: AAA}} \\\midrule
Number of observations & 79,638\\
Delete: & (39,540)\\
Delete: & (7,979) \\
Final sample & 32,119 \\\midrule
\multicolumn{2}{l}{\textbf{Panel B1: BBB }} \\\midrule
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\\midrule
\multicolumn{2}{l}{\textbf{Panel B2: BBB}} \\\midrule
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\\midrule\bottomrule
\end{tabularx}
\begin{tablenotes}
\item[a]  TEXT-TEXT   
\end{tablenotes}
\end{ThreePartTable}
\end{document}

在以下环境下尝试此操作longtabu

\documentclass[a4,12pt]{article}
\usepackage{caption}
\usepackage{longtable}   
\usepackage{tabu}
\usepackage{threeparttablex} 
\title{Document}
\begin{document}
\maketitle
Text-Text
\captionof{table}{TITLE.}
\begin{ThreePartTable}
\begin{longtabu}{cc}
\tabucline[2pt]{-}
Some random text\tnote{a} & 1,75,650\\
\tabucline[1pt]{-}
\multicolumn{2}{l}{\textbf{Panel A1: AAA}} \\
\tabucline[1pt]{-}
Number of observations ... & 1,75,650\\
Delete: ... & (78,420)\\
Delete: ... & (7,104)\\
Final sample & 90,126\\
Delete: & (2,143)\\
Delete: & (8,345)\\
Final sample & 79,638\\
%\tabucline[1pt]{-}
\multicolumn{2}{l}{\textbf{Panel A2: AAA}} \\
\tabucline[1pt]{-}
Number of observations & 79,638\\
Delete: & (39,540)\\
Delete: & (7,979) \\
Final sample & 32,119 \\
\tabucline[1pt]{-}
\multicolumn{2}{l}{\textbf{Panel B1: BBB }} \\
\tabucline[1pt]{-}
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\
\tabucline[1pt]{-}
\multicolumn{2}{l}{\textbf{Panel B2: BBB}} \\
\tabucline[1pt]{-}
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Number of observations  & 1,75,650\\
Delete: & (78,420)\\
Delete: & (47,136)\\
Delete: & (7,178)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Delete: & (32)\\
Final sample & 42,884\\
\tabucline[2pt]{-}
\end{longtabu}
\begin{tablenotes}
\item[a]  TEXT-TEXT   
\end{tablenotes}
\end{ThreePartTable}
\end{document}

相关内容