1

Adding \color{<value>} inside the rightmost cell of a 2x1 table creates a vertical offset relative to the leftmost cell. Why, and how to remedy it?

\documentclass{report}
\usepackage{xcolor} 

%geometry----------------------------------------------------------
\usepackage[a6paper]{geometry}
\savegeometry{default}

\usepackage{xparse}%----------------------------------------------
\NewDocumentCommand{\thisdoc}{}
{abcdefghijklmnopqrs}

\usepackage{tabularx}%---------------------------------------------
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\NewDocumentCommand{\myheaderii}
{+mm}
{%
  \begin{tabularx}{\textwidth}{@{}lR@{}}#1&#2\end{tabularx}
}  

\begin{document}
\pagestyle{empty}
\begin{titlepage}TITLE\end{titlepage}
% ---------------------------------
\newpage
\pagecolor{white}

   \myheaderii{%
      \thisdoc
    }
    {%
      1/2
    }

    \myheaderii{%
      \thisdoc
    }
    {%
      \color{red}% CULPRIT
      1/2
    }

\end{document}

Shot

Erwann
  • 2,100

0 Answers0