I'm trying to use \hhline to draw partial lines in my tables (for which I can't use \cline since my tables contain coloured cells and it is a well-known problem that this combination doesn't work). I'm noticing two kinds of artifacting, however (MWE below):
- All
\hhline{=}s aren't drawn as solid lines, but rather as dots and dashes, where vertical crossings have a longer darker dash. Although it is subtle, it is disturbing to the eye and appears at any zoom size in multiple different PDF viewers. It's not the case for a standard\hline\hlineso it shouldn't be for\hhline.
- When an
\hhlineis used elsewhere in a table,\hline\hlinesuddenly only breaks 3/4 of each vertical line that crosses it.
How do I get rid of these artifacts? (Before anyone suggests it: no, I'm not switching from tabular to NiceMatrix, as suggested here.)
\documentclass{article}
\usepackage{hhline}
\begin{document}
\begin{tabular}{c|c}
A & B \ \hhline{=:=}
C & D
\end{tabular}
\hspace{2em}
\begin{tabular}{c|c}
A & B \ \hline\hline
C & D
\end{tabular}
\hspace{2em}
\begin{tabular}{c|c}
A & B \ \hline\hline
C & D \ \hhline{~-}
E & F
\end{tabular}
\hspace{2em}
\begin{tabular}{c|c}
A & B \ \hline\hline
C & D \ \hline
E & F
\end{tabular}
\end{document}


tabularrayinstead to avoid such problems. – samcarter_is_at_topanswers.xyz Dec 10 '23 at 13:33nicematrixpackage as it draws lines as one single stroke whereever this is possible. – Jasper Habicht Dec 10 '23 at 13:55\cellcolorbased on this computation. – Mew Dec 10 '23 at 13:59|add thearraypackage. – David Carlisle Dec 10 '23 at 16:13It's not the case for a standard \hline\hline so it shouldn't be for \hhline.er... that's like saying it's not the case that apples have orange skin so it shouldn't be the case for oranges. – David Carlisle Dec 10 '23 at 16:14\hhline{=...}with the goal that it looked like\hline\hline? – Mew Dec 10 '23 at 18:11|so the segments will overlap, althoiugh as I say xpdf does not make that noticable as far as I can see the array package version of tabular does not have that negative space. I could not reproduce the vertical line overlapping into the double hline gap. – David Carlisle Dec 10 '23 at 20:31