tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

Background colour and vlines are non-existent for negative rowsep

Open Aljumaily opened this issue 2 years ago • 4 comments

I understand that having a negative rowsep makes the row height smaller than anticipated and the output is expected. I want a way to show the background colour and the vlines for rows that are tightest in row height. Having rowsep=0pt is not the tightest.

image
\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}

\begin{tblr}{rowsep=0pt, vlines, hlines, row{odd}={azure9}, row{even}={gray8}}
	Alpha   & Beta  & Gamma  & Delta \\
	Epsilon & Zeta  & Eta    & Theta \\
	Iota    & Kappa & Lambda & Mu    \\
\end{tblr}
\par\vspace{2em}
\begin{tblr}{rowsep=-10pt, vlines, hlines, row{odd}={azure9}, row{even}={gray8}}
	Alpha   & Beta  & Gamma  & Delta \\
	Epsilon & Zeta  & Eta    & Theta \\
	Iota    & Kappa & Lambda & Mu    \\
\end{tblr}
\end{document}

Aljumaily avatar Aug 07 '23 02:08 Aljumaily

I want a way to show the background colour and the vlines for rows that are tightest in row height.

rowsep=0pt, stretch=0

\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}

\begin{tblr}{rowsep=0pt, vlines, hlines, row{odd}={azure9}, row{even}={gray8}}
	Alpha   & Beta  & Gamma  & Delta \\
	Epsilon & Zeta  & Eta    & Theta \\
	Iota    & Kappa & Lambda & Mu    \\
\end{tblr}
\par\vspace{2em}
\begin{tblr}{rowsep=0pt, stretch=0, vlines, hlines, row{odd}={azure9}, row{even}={gray8}}
	Alpha   & Beta  & Gamma  & Delta \\
	Epsilon & Zeta  & Eta    & Theta \\
	Iota    & Kappa & Lambda & Mu    \\
\end{tblr}
\end{document}

image

muzimuzhi avatar Aug 07 '23 12:08 muzimuzhi

About negative rowsep, I'm guessing it's caused by a negative depth and/or lower part of a row obtained by some internal calculation step.

\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}

\begin{document}
\def\testRowsep#1{%
  \leavevmode\llap{\small\texttt{\detokenize{#1}}}
  \begin{tblr}{vlines, hlines, row{odd}={azure9}, row{even}={gray8}, baseline=T, #1}
  	Alpha   & Beta  & Gamma  & Delta \\
  	Epsilon & Zeta  & Eta    & Theta \\
  	Iota    & Kappa & Lambda & Mu    \\
  \end{tblr}
  \par\medskip
}

\testRowsep{rowsep= 0pt}
\testRowsep{rowsep=-3pt}
\testRowsep{rowsep=-5pt}
\testRowsep{rowsep=-10pt}
\end{document}

image

muzimuzhi avatar Aug 07 '23 13:08 muzimuzhi

Thank you! Resolved my issue.

Aljumaily avatar Aug 19 '23 11:08 Aljumaily

The interaction of negative rowsep and background color seems problematic, so let's keep this issue open until this is resolved.

muzimuzhi avatar Aug 19 '23 11:08 muzimuzhi