0

I wrote a document with colored cells using \cellcolor with tabu. Unfortunately, it does not work any more. Here is an MWE:

\documentclass{scrartcl}
\usepackage{tabu}
\usepackage[table]{xcolor}
%\usepackage{colortbl}

\begin{document}
Colored table:

\begin{tabular}{l}
    \hline
    \cellcolor{green}Colored\\
    \hline
\end{tabular}

Uncolored table although it should be green, too:

\begin{tabu} to \columnwidth {l}
    \hline
    \cellcolor{green}Colored\\
    \hline
\end{tabu}
\end{document}

Result of the MWE

I'm using the following LuaTeX version:

This is LuaTeX, Version 1.10.0 (TeX Live 2019/W32TeX)  (format=lualatex 2020.1.30)  4 FEB 2020 12:20

and tested it additionaly with pdflatex:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex 2020.1.30)  4 FEB 2020 12:12

Any ideas, how to fix this?

3
  • 3
    Read the readme and the issues here: github.com/tabu-issues-for-future-maintainer/tabu Feb 4 '20 at 11:31
  • 3
    The simplest way to fix this is to not using tabu. It was a promising package, but unfortunately, the author lost interest in it.
    – Sveinung
    Feb 4 '20 at 11:36
  • Thanks to both of you, I didn't realise this state of development.
    – Dirk
    Feb 4 '20 at 12:09
1

The new LaTeX3 package tabularray is an alternative to the outdated tabu package. You can easily set colors for cells, rows or columns with tblr environment:

\documentclass{scrartcl}

\usepackage{xcolor}
\usepackage{tabularray}

\begin{document}

\begin{tblr}{
  width = 0.5\linewidth,
  colspec = {|X|X|},
}
  \hline
  \SetCell{teal8} Colored & \SetCell{blue8} Colored \\
  \hline
  \SetRow{purple8} Colored & Colored                \\
  \hline
\end{tblr}

\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.