2

\rowcolor seems to alter the thickness of cell borders. Example:

\documentclass{scrbook}
\usepackage[table]{xcolor}

\definecolor{maroon}{cmyk}{0.20,0.00,0.00,0.00}

\begin{document}

\noindent\begin{tabular}{|l|c|}
\hline
one & two \\
\rowcolor{maroon}three & four \\

five & six \\
\hline
\end{tabular}

\end{document}

outputs (I have added the red rectangles to show the alterations), rendered by Adobe Acrobate Pro XI:

enter image description here

The output depends on the PDF viewer as well as the zoom. In some cases, borders are even invisible:

enter image description here

How to prevent \rowcolor from altering the thickness of cell borders?

  • If it depends on the viewer, it is a viewer issue and nothing to do with TeX. Does the table print correctly? – cfr Apr 23 '16 at 2:21
  • @cfr Thanks. If some PDF viewers have issues, can't part of the issue come from the way the PDF was generated? I'll try printing, but the reviewers of the document won't print it and are likely to use the same PDF viewer. – Franck Dernoncourt Apr 23 '16 at 2:30
  • 3
    I'm voting to close this question as off-topic because it's a viewer issue – Moriambar Jun 12 '17 at 19:04
  • 1
    @FranckDernoncourt is what I wrote what you were thinking of as an answer? – Moriambar Jun 12 '17 at 19:41
  • 1
    @Moriambar I am voting to keep it open, because it is not entirely a viewer issue. The table can be fixed by drawing it two times, first background, then the lines, for example. – Heiko Oberdiek Jun 13 '17 at 0:02
3

As OP asked, I'm expanding on comments, especially @cfr's.

The issue is due to the fact that the viewers render the images and pdf differently at different magnifications (or when the part of the page seen is different). So one has to rely more on print that on screen, although also the print differs from driver to driver. So it's best to check the output at different maginifications, and possibly print it.


Nevertheless I think that your vertical separators, and your "boxy" table style could need a bit of restyling. Also I think it's best to use different shades of grey for enhancing any rows/cells that need such enhancement (as a plus is colourblind friendly!).

So here is an example of what I mean

\documentclass{scrbook}
\usepackage[table]{xcolor}
\usepackage{booktabs}

\begin{document}

\noindent\begin{tabular}{lc}
\toprule
header&header\\
\midrule
one & two \\
\rowcolor{gray!30}three & four \\

five & six \\
\bottomrule\end{tabular}

\end{document}

enter image description here

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.