Skip to content

[Bug] when tabularray is loaded, \cellcolor doesn't work as expected any more in \tablenum cells #678

Description

@Mo-Gul

Tell us about the system on which the bug was produced

  • up-to-date MiKTeX
  • LuaLaTeX

Please outline the bug as you have found it

Hopefully the title says it all. If not, the MWE will.

Share a minimum working example to reproduce the bug

\documentclass[border=1pt, varwidth]{standalone}
\usepackage[table]{xcolor}
\usepackage{booktabs}
\usepackage{tabularray}
\usepackage{siunitx}
\begin{document}

\begin{table}
        \newcommand*{\mc}[1]{\multicolumn{2}{c}{\cellcolor{black!10}#1}}
    \caption{Controlling complex alignment with the \texttt{tablenum} macro.}
        \label{tab:tablenum}
    \begin{tabular}{@{}lr@{}}
            \toprule
        This is a really long Heading & Heading \\
            \midrule
        Info & More info \\
        Info & More info \\
        \mc{12.3} \\
        \mc{333} \\
        \mc{4563} \\
            \bottomrule
    \end{tabular}
\end{table}

\begin{table}
        \newcommand*{\mc}[1]{\multicolumn{2}{c}{\cellcolor{black!10}\tablenum[table-format = 4.1]{#1}}}
    \caption{Controlling complex alignment with the \texttt{tablenum} macro.}
        \label{tab:tablenum}
    \begin{tabular}{@{}lr@{}}
            \toprule
        This is a really long Heading & Heading \\
            \midrule
        Info & More info \\
        Info & More info \\
        \mc{12.3} \\
        \mc{333} \\
        \mc{4563} \\
            \bottomrule
    \end{tabular}
\end{table}

\end{document}

which results in

Image

Comment the tabularray package and it works as expected also for the bottom tabular.

Most likely that is why the same happens in a corresponding tblr environment as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions