1

In this example, the first and second \hhlines create the farmost left border but it's really thin and doesn't match the width of the rest of the vertical line... I tried adding [4pt] after the initial | (in \hhline) but it doesn't result in the wanted behaviour. It works as expected when the line goes all the way... How can I solve this issue so that the left vertical line looks good when used together with partial \hhlines?

\documentclass{article} 
\usepackage{hhline} 
\usepackage{tabu}

\begin{document}   
    \begin{tabu}{|[4pt]ll|}
        \hhline{|--|}
            \multicolumn{2}{|[4pt]r|}{partial w multicolumn} \\
        \hhline{|~-|}    
        \hhline{|~-|}
            partial w & regular columns \\
        \hhline{|~-|}    
        \hhline{|~-|}
            non-partial w & regular columns \\
        \hhline{|--|}    
        \hhline{|--|}
            & \\
        \hhline{|--|}   
    \end{tabu} 
\end{document}

enter image description here

2
  • you could just use a regular \cline in this case rather than \hhline Jun 16, 2015 at 9:37
  • @DavidCarlisle: The problem is that I need to be able to color the cells and this doesn't work properly with \cline. Otherwise, \cline seems to do the job given that we adjust \arrayrulewidth temporarily... Jun 16, 2015 at 9:47

1 Answer 1

4

You can redefine \vline to make a wide rule then define itself back to normal....

enter image description here

\documentclass{article} 
\usepackage{hhline,colortbl} 
\usepackage{tabu}
\let\xvline\vline
\begin{document}   
    \begin{tabu}{|[4pt]ll|}
        \hhline{|--|}
            \multicolumn{2}{|[4pt]r|}{partial w multicolumn} \\
\noalign{\gdef\vline{\vrule width 4pt\global\let\vline\xvline}}
        \hhline{|~-|}    
\noalign{\gdef\vline{\vrule width 4pt\global\let\vline\xvline}}
        \hhline{|~-|}
            partial w & regular columns \\
\noalign{\gdef\vline{\vrule width 4pt\global\let\vline\xvline}}
        \hhline{|~-|}    
\noalign{\gdef\vline{\vrule width 4pt\global\let\vline\xvline}}
        \hhline{|~-|}
            non-partial w & regular columns \\
        \hhline{|--|}    
        \hhline{|--|}
            & \\
        \hhline{|--|}   
    \end{tabu} 
\end{document}
4
  • Works like ze charm! Could you just briefly explain the different parts of that row? What's going on and where is the width reset? Or rather, it seems to me like you're setting it and then resetting it BEFORE the line is printed, how come it works? Jun 16, 2015 at 12:22
  • @fast-reflexes I'm defining \vline to make one wide line then globally redefine itself back to the saved original definition. Dreadful hack really:-) Jun 16, 2015 at 14:33
  • haha LaTex is all just hacks to me, some more hacky then others of course though... ah, so \vrule width 4pt does the actual drawing of the rule and then the definition of \vline is changed back? And we know that \hhlinewill use \vline right after this temporary redefinition, right? Jun 16, 2015 at 15:38
  • 1
    @fast-reflexes yes, which means if you wanted something other than just the first | to be wide it would be harder.... Jun 16, 2015 at 16:28

You must log in to answer this question.

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