7

I'm in the unfortunate situation that I have to make a table in LaTeX which has thick vertical lines. Since this does not seem to be possible with the default tabular environment, I chose the tabu package. I know that there has been some discussion about its further usability about one year ago, but I found no other possibility, so I decided to give it a try.

It works well for me at all, but there is one horizontal line in my Layout, which is thick only half the way, so the vertical lines end to early for the thin parts, leaving ugly gaps.

This is the Layout:

enter image description here

And this is what I currently got:

enter image description here

Produced by this code:

%Dokumentclass
\documentclass[landscape]{letter}

%Packages
\usepackage[landscape]{geometry}
\usepackage[utf8]     {inputenc}
\usepackage           {multirow}
\usepackage           {tabu}

%Formatting
\pagestyle{empty} %Remove numbering

\begin{document}
  \begin{tabu}{ |[1pt] l | l l | l | l |[1pt] }
                                                                                                                 \tabucline[1 pt]{1-5}
    \multicolumn{2}{ |[1pt] l }{ } & \multicolumn{3}{ |[1pt] l |[1pt]}{ }                                     \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } & \multicolumn{2}{  l |[1pt] }{ }   \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } & \multicolumn{2}{  l |[1pt] }{ }   \\ \tabucline[1 pt]{3-5} \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\ \tabucline[1 pt]{1-5}
  \end{tabu}
\end{document}

Except for the fact, that some resizing has to be done, you can see the gaps in the third row at the first and second column.

I haven't found any solution yet. Is this problem even solvable with tabu? Are there any other packages for this purpose?

  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Adam Liter Jan 15 '15 at 20:11
  • I added the missing parts, it should be compilable now without unnecessary additional work. Thank you for the advice! – Wanderer Jan 15 '15 at 20:25
  • Please see my revision for 2nd (perhaps preferable) approach. – Steven B. Segletes Jan 15 '15 at 20:43
7

One way is to shift up the skip prior to the mid-height \tabucline with a \\[-1pt]. See below for 2nd approach.

%Dokumentclass
\documentclass[landscape]{letter}

%Packages
\usepackage[landscape]{geometry}
\usepackage[utf8]     {inputenc}
\usepackage           {multirow}
\usepackage           {tabu}

%Formatting
\pagestyle{empty} %Remove numbering

\begin{document}
  \begin{tabu}{ |[1pt] l | l l | l | l |[1pt] }
                                                                                                                 \tabucline[1 pt]{1-5}
    \multicolumn{2}{ |[1pt] l }{ } & \multicolumn{3}{ |[1pt] l |[1pt]}{ }                                     \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } & \multicolumn{2}{  l |[1pt] }{ }   \\                       \hline
 y   &                              & \multicolumn{1}{ |[1pt] l |     }{ } & \multicolumn{2}{  l |[1pt] }{ }   \\[-1pt]   \tabucline[1 pt]{3-5} 
\hline
 x   &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\ \tabucline[1 pt]{1-5}
  \end{tabu}
\end{document}

enter image description here


Alternately, if you want the thin line to bisect the thick line, then the approach: \\[-1pt] \tabucline[1 pt]{3-5}\\[-12.5pt]\hline works.

%Dokumentclass
\documentclass[landscape]{letter}

%Packages
\usepackage[landscape]{geometry}
\usepackage[utf8]     {inputenc}
\usepackage           {multirow}
\usepackage           {tabu}

%Formatting
\pagestyle{empty} %Remove numbering

\begin{document}
  \begin{tabu}{ |[1pt] l | l l | l | l |[1pt] }
                                                                                                                 \tabucline[1 pt]{1-5}
    \multicolumn{2}{ |[1pt] l }{ } & \multicolumn{3}{ |[1pt] l |[1pt]}{ }                                     \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } & \multicolumn{2}{  l |[1pt] }{ }   \\                       \hline
 y   &                              & \multicolumn{1}{ |[1pt] l |     }{ } & \multicolumn{2}{  l |[1pt] }{ }   \\[-1pt]   \tabucline[1 pt]{3-5}\\[-12.5pt]
\hline
 x   &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\                       \hline
    &                              & \multicolumn{1}{ |[1pt] l |     }{ } &                                 & \\ \tabucline[1 pt]{1-5}
  \end{tabu}
\end{document}

enter image description here

  • I prefer the 2nd approach, the problem with the thin line not bisecting the thick one has been the next one on my list. Thank you for your effort, I never thought that the solution might be that easy. – Wanderer Jan 15 '15 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.