2

I am using a latex template of a journal on Overleaf to prepare an article. The template adds spaces around the \hline so that the following code:

\documentclass[draft]{agujournal2019}

\begin{document}
\begin{table}
\caption{Table Name}
\centering
\begin{tabular}{|l|c|}
\hline
 Run  & Time (min)  \\
\hline
  $l1$  & 260   \\
  $l2$  & 300   \\
  $l3$  & 340   \\
\hline
\end{tabular}
\end{table}
\end{document}

produces a table with broken borders:

enter image description here

So far I could not find a way to make the borders solid and I will appreciate any advice.

Edit: extended the code sample

2
  • Does your class/file load booktabs? (we cannot say, because you didn't post a minimal working example (MWE)). If yes, vertical lines and booktabs are not compatible. Remove them.
    – Rmano
    Aug 26, 2021 at 9:58
  • 1
    @Rmano booktabs on its own wouldn't do that, there must be also some redefinition. Aug 26, 2021 at 10:03

2 Answers 2

6

The class you are using has

  %% 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}}

So use \savehline or (better) don't use vertical rules.

0

had the same problem without any conflicting packages installed or any personal definitions, the solution was to use the \hhline package. it's a little more work to define an horizontal style for each column, but the interaction with vertical lines works better. for standard tables you can just use \hhline{-----} with a dash for each column.

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 19, 2022 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .