我尝试使用\\[\bigskipamount]
在表格行之间创建空白,但tabularx
加载包后,空白没有出现。以下是 MWE:
\documentclass{article}
\usepackage{tabularx} % to get expected behavior, comment this out
\begin{document}
\thispagestyle{empty}
\noindent
\begin{tabular}{p{\linewidth}}
The machine has just finished evaluating an expression to
produce value~$v$; it is about to plug~$v$ into the hole in the top
frame of stack~$S$.
The~machine's next transition is determined by the syntactic form
of~the stack~$S$---usually by the form of the
topmost~frame---and possibly also by a property of~$v$.
\\[\bigskipamount]
The machine has just finished evaluating an expression to
produce value~$v$; it is about to plug~$v$ into the hole in the top
frame of stack~$S$.
The~machine's next transition is determined by the syntactic form
of~the stack~$S$---usually by the form of the
topmost~frame---and possibly also by a property of~$v$.
\\
\end{tabular}
\end{document}
结果如下:
如果我注释掉\usepackage{tabularx}
,我就会得到我希望的结果:
我需要做什么才能获得我想要的装载空间tabularx
?
答案1
在这种情况下,预期的行为是不会获得任何额外的空间,因为p
列深度已经大于使用可选参数添加的额外深度。
tabularx
除了加载array
修复此错误的包之外,此更改与其他更改无关。
如果添加额外的列(使这里的年龄过满,但忽略这一点),则会更清楚
\documentclass{article}
%\usepackage{array} % to get same behaviour with or without this
\begin{document}
\thispagestyle{empty}
\noindent
\begin{tabular}{p{\linewidth}c}
The machine has just finished evaluating an expression to
produce value~$v$; it is about to plug~$v$ into the hole in the top
frame of stack~$S$.
The~machine's next transition is determined by the syntactic form
of~the stack~$S$---usually by the form of the
topmost~frame---and possibly also by a property of~$v$.
&zzz\\[\bigskipamount]
The machine has just finished evaluating an expression to
produce value~$v$; it is about to plug~$v$ into the hole in the top
frame of stack~$S$.
The~machine's next transition is determined by the syntactic form
of~the stack~$S$---usually by the form of the
topmost~frame---and possibly also by a property of~$v$.
&zzz\\
\end{tabular}
\end{document}
在这里,您可以看到无论有没有array
深支柱产生的行为都是相同的,因为\\[\bigskipamount]
它附着在 c 柱的基线,所以由于p
柱的深度更大,所以没有影响。
可选参数的行为\\[..]
确实应该取决于整行,而不应仅受最后一列的影响。array
包实现确保了这一点。
要添加更多空间,请为可选参数添加更大的长度,或\bigskip
在条目末尾添加p
或使用\\\noalign{\bigskip}
(booktabs 包有一些间距命令来隐藏\noalign
原始命令,但相当于这个)