2

In the following colored table there is a color issue at the 2nd row. As you can see the curly bracket is partly covered by the row color. I tried to enclose the cell in a minipage, hoping that it will be placed in front of the color.

\documentclass[a4paper]{article}
\usepackage[lite]{mtpro2}
\usepackage[no-math,cm-default]{fontspec}
\usepackage{amsmath}
\usepackage{xunicode}
\usepackage[usenames,dvipsnames,cmyk,table]{xcolor}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont[Mapping=tex-text,Numbers=Lining,Scale=1.0,BoldFont={Times New Roman Bold}]{Times New Roman}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{hhline,longtable}

\begin{document}
\begin{center}
\setlength\arrayrulewidth{1.5pt}\arrayrulecolor{white}
\rowcolors{2}{cyan!70!gray!30}{cyan!10!gray!20}
\begin{longtable}{c|c}
\hhline{--} \rowcolor{cyan!50!gray}\rule[-2ex]{0pt}{5.5ex} \textbf{N} & \textbf{Property} \\
\hline\rule[-2ex]{0pt}{5.5ex} 3 & $ \sqrt{x^2}=|x|\;\;,\;\; x\in R $\\
\hline\rule[-2ex]{0pt}{7ex}  4 & 
$ \sqrt[\nu]{x^\nu}=\ccases{
|x|&  x\in R\textrm{ if }\nu\textrm{ even}\\x&  x\geq0\textrm{ and } \nu\in N} $
\\
\hhline{~-} \rowcolor{cyan!70!gray!30}  & $ \sqrt{x\cdot y}=\sqrt{x}\cdot\sqrt{y}\;\;,\;\; x,y\geq0 $ \rule[-2ex]{0pt}{5.5ex}\\
\rule[-2ex]{0pt}{5.5ex}\multirow{-3}{*}{5} & $ \sqrt[\nu]{x\cdot y}=\sqrt[\nu]{x}\cdot\sqrt[\nu]{y}\;\;,\;\; x,y\geq0 $ \\
\hline
\end{longtable}
\end{center}
\end{document}

enter image description here

How can I bring the text in front or the cellcolor at the back?

  • 1
    Please shorten your example. As you have a problem in row 4, row 1-3 and 5-9 are only obscuring the code. And test if you can remove mtpro2. – Ulrike Fischer Nov 7 '18 at 8:16
  • I created a shorted table with 3 line in order to show thw alternating color. But it is important to keep thw mtpro2 package. – mac Nov 7 '18 at 8:28
2

You can use \hiderowcolors in the inner tabular (the ccases):

\documentclass[a4paper]{article}
\usepackage[lite]{mtpro2}
\usepackage[no-math]{fontspec}
\usepackage{amsmath}
\usepackage[usenames,dvipsnames,cmyk,table]{xcolor}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont[Mapping=tex-text,Numbers=Lining,Scale=1.0,BoldFont={Times New Roman Bold}]{Times New Roman}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{hhline,longtable}

\begin{document}
\begin{center}
\setlength\arrayrulewidth{1.5pt}\arrayrulecolor{white}
\rowcolors{2}{cyan!70!gray!30}{cyan!10!gray!20}
\begin{longtable}{c|c}
\hhline{--} \rowcolor{cyan!50!gray}\rule[-2ex]{0pt}{5.5ex} \textbf{N} & \textbf{Property} \\
\hline\rule[-2ex]{0pt}{5.5ex} 3 & $ \sqrt{x^2}=|x|\;\;,\;\; x\in R $\\
\hline\rule[-2ex]{0pt}{7ex}  4 &
$ \sqrt[\nu]{x^\nu}=\ccases{\hiderowcolors
|x|&  x\in R\textrm{ if }\nu\textrm{ even}\\x&  x\geq0\textrm{ and } \nu\in N} $
\\
\hhline{~-} \rowcolor{cyan!70!gray!30}  & $ \sqrt{x\cdot y}=\sqrt{x}\cdot\sqrt{y}\;\;,\;\; x,y\geq0 $ \rule[-2ex]{0pt}{5.5ex}\\
\rule[-2ex]{0pt}{5.5ex}\multirow{-3}{*}{5} & $ \sqrt[\nu]{x\cdot y}=\sqrt[\nu]{x}\cdot\sqrt[\nu]{y}\;\;,\;\; x,y\geq0 $ \\
\hline
\end{longtable}
\end{center}
\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.