也许有人可以帮助我解决这个问题:
我有一张简单的桌子,我在右边放了一些括号。这样效果很好,但括号交叉/重叠,看起来不太好(第一张图片)。我发现当我不使用\setstretch{1.433}
它时看起来不错(第二张图片)。
使用 setstretch 时如何避免括号重叠?
这是我的 MWE:
\documentclass[a4paper, fontsize=12pt]{scrbook}
\usepackage[svgnames,table]{xcolor}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{booktabs,tabularx}
\usepackage{multirow}
\usepackage{bigdelim}
\usepackage{cellspace}
\usepackage{float}
\usepackage{mathtools,amssymb,amsthm,bm}
\usepackage{blindtext}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength\cellspacetoplimit{6pt}
\setlength\cellspacebottomlimit{6pt}
\addtokomafont{caption}{\footnotesize}
\setkomafont{captionlabel}{\footnotesize\bfseries\itshape}
\setkomafont{disposition}{\normalfont\bfseries}
\setkomafont{chapter}{\Large}
\setkomafont{section}{\large}
\setkomafont{subsection}{\large\normalfont}
\setlength{\parindent}{0pt}
\setstretch{1.433} %commenting it out, it looks good
\begin{document}
\blindtext
\begin{table}[H]
\centering
\caption{Caption}
\begin{tabular}{c|c|l}
\toprule
Index & Test\\
\midrule
1 & 1&\rdelim\}{2}{*}[2]\\
2 & 1&\\
3 & 1&\rdelim\}{2}{*}[2]\\
4 & 1&\\
\bottomrule
\end{tabular}
\end{table}
\blindtext
\end{document}
答案1
对于最后一行之前的行,添加&&\\[-16pt]
足以引入间隙。对于最后一行,不幸的是,它将垂直线延伸得太远了。所以,我添加了\rule[-10pt]{0pt}{0pt}
作为最后一行的最后一列。
\documentclass[a4paper, fontsize=12pt]{scrbook}
\usepackage[svgnames,table]{xcolor}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{booktabs,tabularx}
\usepackage{multirow}
\usepackage{bigdelim}
\usepackage{cellspace}
\usepackage{float}
\usepackage{mathtools,amssymb,amsthm,bm}
\usepackage{blindtext}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength\cellspacetoplimit{6pt}
\setlength\cellspacebottomlimit{6pt}
\addtokomafont{caption}{\footnotesize}
\setkomafont{captionlabel}{\footnotesize\bfseries\itshape}
\setkomafont{disposition}{\normalfont\bfseries}
\setkomafont{chapter}{\Large}
\setkomafont{section}{\large}
\setkomafont{subsection}{\large\normalfont}
\setlength{\parindent}{0pt}
\setstretch{1.433} %commenting it out, it looks good
\begin{document}
\blindtext
\begin{table}[H]
\centering
\caption{Caption}
\begin{tabular}{c|c|l}
\toprule
Index & Test\\
\midrule
&&\\[-16pt]
1 & 1&\rdelim\}{2}{*}[2]\\
2 & 1&\\
&&\\[-16pt]
3 & 1&\rdelim\}{2}{*}[2]\\
4 & 1&\rule[-10pt]{0pt}{0pt}\\
\bottomrule
\end{tabular}
\end{table}
\blindtext
\end{document}
另外,也可以在各处使用零宽度\rule
来达到相同的效果:
\begin{tabular}{c|c|l}
\toprule
Index & Test\\
\midrule
1 & 1&\rdelim\}{2}{*}[2]\rule{0pt}{18pt}\\
2 & 1&\rule[-10pt]{0pt}{0pt}\\
3 & 1&\rdelim\}{2}{*}[2]\\
4 & 1&\rule[-10pt]{0pt}{0pt}\\
\bottomrule
\end{tabular}