I'm trying to improve the lines in a tabular with colored rows (lines above a colored row can disappear in the adobe reader at some zoom levels) by redrawing the line above a row after the row itself has be created. I have p-columns so I can't use David's solution here https://tex.stackexchange.com/a/129835/2388.
So I thought to use tikzmark (or some other mark) but can't figure[1] out how to find the right edge. Whatever I do the right mark is at the right side of the page:
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\renewcommand\arrayrulewidth{4pt}
\begin{tabular}{l}
abc \\\noalign{\hrule height \arrayrulewidth}
blub \\\noalign{\pgfmark{testa}\hfill\pgfmark{testb}}
abc\tikz [remember picture] \draw [overlay,->] (pic cs:testa)--(pic cs:testb);
\end{tabular}
\end{document}
Is there anyway to put the marks in the \noalign so that they respect the size of the tabular box like \hrule
does it?
[1] I naturally can find the edge by putting a mark at the right end of some cell and then calculate the intersection but this is cheating ;-).
Best Answer
As egreg said, but as you hinted you were using
colortbl
it is already putting a coloured rule under the cell, so you can just ask it to stick a tikzmark at each end of that, so you know where it is:If you want the left edge of the arrow to be the left edge of the colour rather than the cell contents, move the first
\U@tm
down a few lines after the\kern-\@tempdimb