Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In the following the first two columns are different in nature from the last two and I wanted to emphasize this by having a break in the horizontal line. I drew lines across columns 1 and 2 and then across 3 and 4 but they connect up. How can I get some space between them so that there are two distinct horizontal line segments? If possible I would like to stick with using tabu.

\documentclass{article}
\usepackage{tabu}
\begin{document}

\begin{center}
\begin{tabu}{XXXX}
1 & 2 & a & b\\
\tabucline{1-2 3-4}
1 & 2 & a & b\\
\end{tabu}
\end{center}

\end{document}

Output (ok except I would like some space in the horizontal line between column 2 and 3):

screenshot

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

You can use \cmidrule from the booktabs package which provides a method of shortening each end:

enter image description here

Notes:

Code:

\documentclass{article}
\usepackage{booktabs}
\usepackage{tabu}
\begin{document}

\begin{center}
\begin{tabu}{XXXX}
1 & 2 & a & b\\
\cmidrule(r{1.0ex}){1-2}\cmidrule(l{1.0ex}){3-4}
1 & 2 & a & b\\
\end{tabu}
\end{center}
\end{document}
share|improve this answer
    
Thanks. I should have included the fact that the rule is in color since that was part of my \tabucline command before I made the example minimal but it seems that \arrayrulecolor{red} placed before the cmidrule line does work so I am ok after all. –  user1189687 Jul 22 '12 at 22:26
    
Is there a solution that does not require booktabs? In another question it was pointed out in tex.stackexchange.com/questions/64332/… that there is a problem with using booktabs with tables having color. –  user1189687 Jul 23 '12 at 3:37
    
@user1189687: I do not know, but I am not an expert on tables by any means... –  Peter Grill Jul 23 '12 at 3:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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