\cmidrule 的延伸为虚线

\cmidrule 的延伸为虚线

我有一个\cmidrule(l){1-7},想将其扩展为相同样式的虚线(填充、宽度、颜色、左右修剪选项都很棒),从第 10 列到第 14 列。
我尽力提供 MWE。
谢谢,并致以亲切问候
Pullp

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{booktabs}
\usepackage[table,xcdraw,dvipsnames]{xcolor}
\usepackage{multirow,bigdelim}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage{pdflscape}
\usepackage{lscape}
\usepackage{colortbl}
\definecolor{light-red}{RGB}{255,174,174}
\definecolor{light-green}{cmyk}{0.4,0,0.4,0}

\begin{document}

\begin{landscape}
 \centering
\begin{table}[ht]
\begin{scriptsize}
\renewcommand{\arraystretch}{1.3}
\caption{Effects of an Integrated Model on membership with the Hyperactives}
\label{tab:Total_simplified_results_2}
\begin{threeparttable}
\begin{tabular}{llcccccl@{\,}cccccc}
\toprule
\multirow{2}{*}{\textbf{Model}} & \multirow{2}{*}{\textbf{Variable}} & \multicolumn{12}{c}{membership with the \textbf{Hyperactives (2)} compared to}\\
\cmidrule(lr){3-14}
 &  &C3 & C4 & C5 & C6 & C8 & & & C3 & C4 & C5 & C6 & C8\\
  \midrule
 \multirow{11}[0]{*}{\textbf{GIM}} & Selective-outcome & & & & & & \rdelim\}{23}{*}%[\begin{large}$\Rightarrow$\end{large}]
 & \parbox[t]{2mm}{\multirow{21}{*}{\rotatebox[origin=c]{90}{\textbf{Integrated Regression Model}}}}\\
          & Selective-process  & &&&&&&&\\
          & Collective-political & & \cellcolor{light-green}& & & & & &     \\
          & Normative &  &&&&&&&&\\
          & Altruistic  & & & & & && & && \cellcolor{light-green} & \cellcolor{light-green} & \cellcolor{light-green}\\
          & Ideological  & \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red} & &  & \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}\\
          & Expressive  & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}&  \cellcolor{light-green}&  & & \cellcolor{light-green}& \cellcolor{light-green}& & \cellcolor{light-green}&  \cellcolor{light-green}\\
          & Opp. Costs (n)  & & & & &  \cellcolor{light-red}& & & & & & &  \\
          & Disutility (n) & & & & &  \cellcolor{light-green} & & &   & & & &  \cellcolor{light-green}\\
          & Financial (n) & & \cellcolor{light-green}& & &  \cellcolor{light-green}& & & & & & &  \cellcolor{light-green}\\
\cmidrule(l){1-7}    
\multirow{5}[0]{*}{\textbf{SPM}} & Internal efficacy  & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& & & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}\\
          & External efficacy & & & & & & & & & & & & \\
          & Political interest  & & \cellcolor{light-green}& & \cellcolor{light-green}& \cellcolor{light-green}& & & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}\\
          & Party affinity  & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green} & & & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}\\
\cmidrule(l){1-7}
\multirow{9}[0]{*}{\textbf{SEM}} & Age & \cellcolor{light-red} & \cellcolor{light-red}  & & & & & &  \cellcolor{light-red}& \cellcolor{light-red}&  \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red} \\
& Sex, male & & \cellcolor{light-green} & \cellcolor{light-green} &  \cellcolor{light-green} &  \cellcolor{light-green}  & & & & \\
& Income, high & \cellcolor{light-green} & &  & \cellcolor{light-green} & & & & \\
& Civil status, married &  &  &  &   & & & &  \\ 
& Education, high &  &  &   & & & & & &\\ 
& Club Membership, Yes &  &\cellcolor{light-green} & &  &  & & & &  \cellcolor{light-green}& & & \\
& Occupational Prestige & & & & & & & & & \\
& Social Stratum, high &  &  & &  & & & & & & \\ 
\bottomrule
\end{tabular}
\end{threeparttable}
\end{scriptsize}
\end{table}
\end{landscape}

\end{document}

答案1

欢迎使用 TeX SX!我不知道如何扩展cmidrule到虚线,但我建议使用这个解决方法,并arydshln进行一些小改动,使虚线与对齐\cmidrule。我们可以有彩色虚线,但不能修剪。我加载了 caption 包,以便在标题和表格之间有更合理的间距。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{booktabs}
\usepackage[table, xcdraw, dvipsnames]{xcolor}
\usepackage{multirow,bigdelim}
\usepackage{array, caption}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage{pdflscape}
\usepackage{lscape}
\definecolor{light-red}{RGB}{255,174,174}
\definecolor{light-green}{cmyk}{0.4,0,0.4,0}
\usepackage{arydshln}

\begin{document}

\begin{landscape}
\begin{table}[ht]
 \centering
\begin{scriptsize}
\renewcommand{\arraystretch}{1.3}
\caption{Effects of an Integrated Model on membership with the Hyperactives}
\label{tab:Total_simplified_results_2}
%\begin{threeparttable}
 \begin{threeparttable}
\begin{tabular}{llcccccl@{\,}cccccc}
\toprule
\multirow{2}{*}{\textbf{Model}} & \multirow{2}{*}{\textbf{Variable}} & \multicolumn{12}{c}{membership with the \textbf{Hyperactives (2)} compared to}\\
\cmidrule(lr){3-14}
 & &C3 & C4 & C5 & C6 & C8 & & & C3 & C4 & C5 & C6 & C8\\
  \midrule
 \multirow{11}[0]{*}{\textbf{GIM}} & Selective-outcome & & & & & & \rdelim\}{23}{*}%[\begin{large}$\Rightarrow$\end{large}]
 & \parbox[t]{2mm}{\multirow{21}{*}{\rotatebox[origin=c]{90}{\textbf{Integrated Regression Model}}}}\\
          & Selective-process & &&&&&&&\\
          & Collective-political & & \cellcolor{light-green}& & & & & & \\
          & Normative & &&&&&&&&\\
          & Altruistic & & & & & && & && \cellcolor{light-green} & \cellcolor{light-green} & \cellcolor{light-green}\\
          & Ideological & \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red} & & & \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}\\
          & Expressive & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& & & \cellcolor{light-green}& \cellcolor{light-green}& & \cellcolor{light-green}& \cellcolor{light-green}\\
          & Opp. Costs (n) & & & & & \cellcolor{light-red}& & & & & & & \\
          & Disutility (n) & & & & & \cellcolor{light-green} & & & & & & & \cellcolor{light-green}\\
          & Financial (n) & & \cellcolor{light-green}& & & \cellcolor{light-green}& & & & & & & \cellcolor{light-green}\\
\cmidrule(l){1-7}
\multirow{5}[0]{*}{\textbf{SPM}} & Internal efficacy & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& & & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}\\
          & External efficacy & & & & & & & & & & & & \\
          & Political interest & & \cellcolor{light-green}& & \cellcolor{light-green}& \cellcolor{light-green}& & & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}\\
          & Party affinity & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green} & & & & \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}& \cellcolor{light-green}\\
\cmidrule(l){1-7}\noalign{\vskip-\dimexpr\belowrulesep+0.4pt}
\arrayrulecolor{Goldenrod}\cdashline{10-14}\noalign{\vskip\belowrulesep}\arrayrulecolor{black}
\multirow{9}[0]{*}{\textbf{SEM}} & Age & \cellcolor{light-red} & \cellcolor{light-red} & & & & & & \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red}& \cellcolor{light-red} \\
& Sex, male & & \cellcolor{light-green} & \cellcolor{light-green} & \cellcolor{light-green} & \cellcolor{light-green} & & & & \\
& Income, high & \cellcolor{light-green} & & & \cellcolor{light-green} & & & & \\
& Civil status, married & & & & & & & & \\
& Education, high & & & & & & & & &\\
& Club Membership, Yes & &\cellcolor{light-green} & & & & & & & \cellcolor{light-green}& & & \\
& Occupational Prestige & & & & & & & & & \\
& Social Stratum, high & & & & & & & & & & \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{scriptsize}
\end{table}
\end{landscape}

\end{document} 

在此处输入图片描述

相关内容