对于科学论文我使用llncs 布局。我在这里创建了一个带有表格的表格。该表格的第一列应占据文本宽度的一半。第一列的内容可以有不同的长度,并延伸到多行。我使用以下代码创建表格。
\documentclass[runningheads]{llncs}
%
\usepackage{graphicx}
\begin{document}
\begin{table}
\centering
% stretch table over full \textwidth
\resizebox{\textwidth}{!}{
\begin{tabular}{l|lll}
\hline
Column \#1 & Col \#2 & Col \#3 & Col \#4 \\
\hline
\parbox{6cm}{In reviewing applicants, we consider both objective criteria, such as test scores, and subjective criteria, such as leadership ability.} & negative & neutral & positive \\
\parbox{6cm}{As a test for centrophobia, we measured the time fish spent in the centre of the tank in the horizontal plane.} & negative & neutral & positive \\
\parbox{6cm}{The fortifications failed their only test when the New Model Army entered London in 1647 and they were levelled by Parliament the same year.} & negative & neutral & positive \\
\parbox{6cm}{But Tower did better than HBO, the Boston Business Journal, and some others, where the test messages apparently fell into a cyberhole.} & negative & neutral & positive \\
\parbox{6cm}{As you can see from the test reports, in the lower frequency ranges in particular, egg crates offer little value for absorption.} & negative & neutral & positive \\
\end{tabular}
}
\end{table}
\end{document}
问题在于,表格中不同行之间的距离太近,难以区分。
我如何更新代码以获得均匀、清晰且覆盖整个的表格\textwidth
?
答案1
首先我建议你避免使用,因为 LaTeX 已经有在环境parbox
中创建内部段落的默认选项tabular
\begin{tabular}{p{6cm}|lll}
\hline
Column \#1 & Col \#2 & Col \#3 & Col \#4 \\
\hline
In reviewing applicants, we consider both objective criteria, such as test scores, and subjective criteria, such as leadership ability. & negative & neutral & positive \\
As a test for centrophobia, we measured the time fish spent in the centre of the tank in the horizontal plane. & negative & neutral & positive \\
The fortifications failed their only test when the New Model Army entered London in 1647 and they were levelled by Parliament the same year. & negative & neutral & positive \\
But Tower did better than HBO, the Boston Business Journal, and some others, where the test messages apparently fell into a cyberhole. & negative & neutral & positive \\
As you can see from the test reports, in the lower frequency ranges in particular, egg crates offer little value for absorption. & negative & neutral & positive \\
\end{tabular}
在 这里,我删除了所有 parbox,并替换了l
上面的位置,p{6cm}
它的作用完全相同,并获得了正确的间距。如果你想进一步增加它,你可以重新定义arraystretch
这个 stackexchange 论坛,其最终编码如下:
\bgroup
\def\arraystretch{1.5}
\begin{tabular}{p{6cm}|lll}
\hline
Column \#1 & Col \#2 & Col \#3 & Col \#4 \\
\hline
In reviewing applicants, we consider both objective criteria, such as test scores, and subjective criteria, such as leadership ability. & negative & neutral & positive \\
As a test for centrophobia, we measured the time fish spent in the centre of the tank in the horizontal plane. & negative & neutral & positive \\
The fortifications failed their only test when the New Model Army entered London in 1647 and they were levelled by Parliament the same year. & negative & neutral & positive \\
But Tower did better than HBO, the Boston Business Journal, and some others, where the test messages apparently fell into a cyberhole. & negative & neutral & positive \\
As you can see from the test reports, in the lower frequency ranges in particular, egg crates offer little value for absorption. & negative & neutral & positive \\
\end{tabular}
\egroup