我正在使用 agujournal2018 cls 文件(可用这里)。为了方便起草,我想在表格中添加线条。如何使表格中的垂直线和水平线连接起来?
我尝试使用\aboverulesep=0ex
\belowrulesep=0ex
与 booktabs 相关的答案这里没有运气
平均能量损失
\documentclass[draft]{agujournal2018}
\usepackage{apacite}
\usepackage{url} %this package should fix any errors with URLs in refs.
\usepackage{lineno}
\linenumbers
%%%%%%%
\draftfalse
\journalname{Enter journal name here}
\begin{document}
\begin{table}
\caption{Time of the Transition Between Phase 1 and Phase 2$^{a}$}
\centering
\begin{tabular}{l | c}
\hline
Run & Time (min) \\
\hline
$l1$ & 260 \\
$l2$ & 300 \\
$l3$ & 340 \\
$h1$ & 270 \\
$h2$ & 250 \\
$h3$ & 380 \\
$r1$ & 370 \\
$r2$ & 390 \\
\hline
\multicolumn{2}{l}{$^{a}$Footnote text here.}
\end{tabular}
\end{table}
\end{document}
我意识到期刊中没有这些线条,我需要在提交之前将它们删除,但如果可以用线条布置表格,它将使起草变得容易得多。
答案1
这agujournal2018.cls
文档类别提到了这一点:
%% This puts extra space between horizontal lines in tables.
%% If you want to use vertical lines in tables, you should use
%% \savehline rather than \hline, otherwise the vertical and
%% horizontal lines will not abutt.
%% \noalign is a command that allows the uses to put something
%% between lines in a table.
\let\savehline\hline
\def\hline{\noalign{\vskip3pt}\savehline\noalign{\vskip3pt}}
因此,您可以使用\savehline
而不是\hline
,或者使用这种构造:
\let\savedhline\hline % Store default \hline
\documentclass{agujournal2018}
\let\hline\savedhline % Restore default \hline
\journalname{Enter journal name here}
\begin{document}
\begin{table}
\caption{A caption}
\centering
\begin{tabular}{l | c}
\hline
Run & Time (min) \\
\hline
$l1$ & 260 \\
$l2$ & 300 \\
$l3$ & 340 \\
$h1$ & 270 \\
$h2$ & 250 \\
$h3$ & 380 \\
$r1$ & 370 \\
$r2$ & 390 \\
\hline
\end{tabular}
\end{table}
\end{document}