长表中的孤立或重复的 hline

长表中的孤立或重复的 hline

我正在 Overleaf 上使用以下长表:

\begin{longtable}{lllll}
\hline
\multicolumn{1}{|l|}{\textbf{DM}}                                                          & \multicolumn{1}{l|}{\textbf{\begin{tabular}[c]{@{}l@{}}White \\ men (n/\%)\end{tabular}}}  & \multicolumn{1}{l|}{\textbf{Black men}}                                                    & \multicolumn{1}{l|}{\textbf{White women}}                                                   & \multicolumn{1}{l|}{\textbf{Black women}}                                                   \\ \hline
\endfirsthead
%
\endhead
%
\multicolumn{1}{|l|}{\textit{Might can}}                                                   & \multicolumn{1}{l|}{24 (5\%)}                                                              & \multicolumn{1}{l|}{10  (9\%)}                                                             & \multicolumn{1}{l|}{14 (4\%)}                                                               & \multicolumn{1}{l|}{5 (4\%)}                                                                \\ \hline
\multicolumn{1}{|l|}{\textit{Might could}}                                                 & \multicolumn{1}{l|}{93 (19\%)}                                                             & \multicolumn{1}{l|}{24 (21\%)}                                                             & \multicolumn{1}{l|}{80 (21\%)}                                                              & \multicolumn{1}{l|}{22 (16\%)}                                                              \\ \hline
\multicolumn{1}{|l|}{\textit{Might would}}                                                 & \multicolumn{1}{l|}{12 (3\%)}                                                              & \multicolumn{1}{l|}{8 (7\%)}                                                               & \multicolumn{1}{l|}{8 (2\%)}                                                                & \multicolumn{1}{l|}{13 (10\%)}                                                              \\ \hline
\multicolumn{1}{|l|}{\textit{Used to could}}                                               & \multicolumn{1}{l|}{29 (6\%)}                                                              & \multicolumn{1}{l|}{9 (8\%)}                                                               & \multicolumn{1}{l|}{22 (6\%)}                                                               & \multicolumn{1}{l|}{10 (8\%)}                                                               \\ \hline
                                                                                           &                                                                                            &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\\ \\
\multicolumn{1}{|l|}{\textbf{White overall}}                                               & \multicolumn{1}{l|}{\textbf{Black overall}}                                                &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{38 (4.3\%)}                                                           & \multicolumn{1}{l|}{15 (6\%)}                                                              &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{173 (20\%)}                                                           & \multicolumn{1}{l|}{46 (19\%)}                                                             &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{20 (2\%)}                                                             & \multicolumn{1}{l|}{21 (9\%)}                                                              &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{51 (6\%)}                                                             & \multicolumn{1}{l|}{19 (8\%)}                                                              &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
                                                                                           &                                                                                            &                                                                                            &                                                                                             &                                                                                             \\ \hline
\multicolumn{1}{|l|}{\textbf{DM}}                                                          & \multicolumn{1}{l|}{\textbf{\begin{tabular}[c]{@{}l@{}}White \\ lower class\end{tabular}}} & \multicolumn{1}{l|}{\textbf{\begin{tabular}[c]{@{}l@{}}Black \\ lower class\end{tabular}}} & \multicolumn{1}{l|}{\textbf{\begin{tabular}[c]{@{}l@{}}White \\ middle class\end{tabular}}} & \multicolumn{1}{l|}{\textbf{\begin{tabular}[c]{@{}l@{}}Black \\ middle class\end{tabular}}} \\ \hline
\multicolumn{1}{|l|}{\textit{Might can}}                                                   & \multicolumn{1}{l|}{13 (6\%)}                                                              & \multicolumn{1}{l|}{10 (7\%)}                                                              & \multicolumn{1}{l|}{24 (4\%)}                                                               & \multicolumn{1}{l|}{5 (5\%)}                                                                \\ \hline
\multicolumn{1}{|l|}{\textit{Might could}}                                                 & \multicolumn{1}{l|}{55 (26\%)}                                                             & \multicolumn{1}{l|}{33 (23\%)}                                                             & \multicolumn{1}{l|}{105 (19\%)}                                                             & \multicolumn{1}{l|}{11 (12\%)}                                                              \\ \hline
\multicolumn{1}{|l|}{\textit{Might would}}                                                 & \multicolumn{1}{l|}{10 (5\%)}                                                              & \multicolumn{1}{l|}{11 (8\%)}                                                              & \multicolumn{1}{l|}{10 (2\%)}                                                               & \multicolumn{1}{l|}{9 (10\%)}                                                               \\ \hline
\multicolumn{1}{|l|}{\textit{Used to could}}                                               & \multicolumn{1}{l|}{21 (10\%)}                                                             & \multicolumn{1}{l|}{13 (9\%)}                                                              & \multicolumn{1}{l|}{29 (5\%)}                                                               & \multicolumn{1}{l|}{5 (5\%)}                                                                \\ \hline
                                                                                           &                                                                                            &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{\textbf{\begin{tabular}[c]{@{}l@{}}White\\ upper class\end{tabular}}} & \multicolumn{1}{l|}{\textbf{\begin{tabular}[c]{@{}l@{}}Black\\ upper class\end{tabular}}}  &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{1 (1\%)}                                                              & \multicolumn{1}{l|}{0 (0\%)}                                                               &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{13 (11\%)}                                                            & \multicolumn{1}{l|}{2 (22\%)}                                                              &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{0 (0\%)}                                                              & \multicolumn{1}{l|}{1 (11\%)}                                                              &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\multicolumn{1}{|l|}{1 (1\%)}                                                              & \multicolumn{1}{l|}{1 (11\%)}                                                              &                                                                                            &                                                                                             &                                                                                             \\ \cline{1-2}
\\
\caption{Incidence of four DMs in LAGS by ethnicity, gender, and social class \citep[from][]{mishoe_pragmatics_1994}\label{table:mishoetable}}
\end{longtable}

当我的表格跨越两页时,其中一个 \hlines 会产生一条与其表格对象分离的孤立水平线:

当我尝试向下移动表格,希望 hline 能够加入其迷你表格时,我得到了重复的一行:

有没有什么方法可以让我的表(及其子组件)的行为更加统一?

下面是我的 overleaf 项目的简化版本:

https://www.overleaf.com/read/xtvjmtwxmscz

希望得到一些帮助!

卡梅伦

答案1

这是代码的一个简化版本,主要是通过删除所有\multicolumn{1}{.}{.}包装器并将longtable设置切换到table/tabular设置来实现的。我还删除了所有垂直线和大多数水平线,以便使表格看起来更加开放,并且我放弃了所有\textbf指令 —— 它们根本就不需要。最后,我还将第二组和第四组向右移动了一列。

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs}
\usepackage{natbib}
\newcommand\mytab[1]{\begin{tabular}[t]{@{}l@{}} #1 \end{tabular}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{@{} lllll }
\toprule
DM & \mytab{White men \\ (n/\%)} & Black men & White women & Black women \\ 
\midrule
\textit{Might can}     & 24  (5\%) & 10  (9\%) & 14  (4\%) &  5  (4\%) \\ 
\textit{Might could}   & 93 (19\%) & 24 (21\%) & 80 (21\%) & 22 (16\%) \\ 
\textit{Might would}   & 12  (3\%) &  8  (7\%) &  8  (2\%) & 13 (10\%) \\ 
\textit{Used to could} & 29  (6\%) &  9  (8\%) & 22  (6\%) & 10  (8\%) \\ 
\bottomrule
\\
\cmidrule[\heavyrulewidth]{2-3}
& \mytab{White \\ overall} & \mytab{Black \\ overall} \\ 
\cmidrule[\lightrulewidth]{2-3}
& 38 (4.3\%) & 15  (6\%) \\ 
&173 (20\%)  & 46 (19\%) \\ 
& 20  (2\%)  & 21  (9\%) \\ 
& 51  (6\%)  & 19  (8\%) \\ 
\cmidrule[\heavyrulewidth]{2-3}
\\ 
\toprule
DM & \mytab{White \\ lower class} & \mytab{Black \\ lower class} & \mytab{White \\ middle class} & \mytab{Black \\ middle class} \\ 
\midrule
\textit{Might can}     & 13  (6\%) & 10  (7\%) &  24  (4\%) &  5  (5\%) \\ 
\textit{Might could}   & 55 (26\%) & 33 (23\%) & 105 (19\%) & 11 (12\%) \\ 
\textit{Might would}   & 10  (5\%) & 11  (8\%) &  10  (2\%) &  9 (10\%) \\ 
\textit{Used to could} & 21 (10\%) & 13  (9\%) &  29  (5\%) &  5  (5\%) \\ 
\bottomrule
\\ 
\cmidrule[\heavyrulewidth]{2-3}
&\mytab{White \\ upper class} & \mytab{Black \\ upper class} \\ 
\cmidrule[\lightrulewidth]{2-3}
& 1  (1\%) & 0  (0\%) \\ 
&13 (11\%) & 2 (22\%) \\ 
& 0  (0\%) & 1 (11\%) \\ 
& 1  (1\%) & 1 (11\%) \\ 
\cmidrule[\heavyrulewidth]{2-3}
\end{tabular}

\caption{Incidence of four DMs in LAGS, by ethnicity, gender, and social class 
         \citep[from][]{mishoe_pragmatics_1994}}
\label{table:mishoetable}
\end{table}
\end{document}

相关内容