1

I found out that all the colors that are used in the examples of tabularray are not defined by xcolor. I can use these colors in the document, but not in the preamble.

What exactly does tabularray do and how can I make these colors available also before the document.

This fails

\documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \colorlet{newcolor}{azure3} \begin{document} \color{azure3} Hello. \end{document} 

with

! Package xcolor Error: Undefined color `azure3'. l.5 \colorlet{newcolor}{azure3} 
3
  • 1
    \usepackage[x11names]{xcolor} and I think it's Azure3, not azure3. (Not checked) Commented Dec 17, 2022 at 19:52
  • @Rmano I have verified it is perfect your comment. Commented Dec 17, 2022 at 20:00
  • 2
    Azure3 is definey by xcolor, but that is a completely different color than the one defined by tabularray. Commented Dec 17, 2022 at 20:01

1 Answer 1

2

Tabularray checks at the start of the document if the xcolor package is loaded and if yes it will automatically load the ninecolors package, which defines azure3 (amongst others).

According to the tabularray documentation, this is done for proper color contrast.

Here the relevant part of the tabularray source:

\AtBeginDocument{ \@ifpackageloaded{xcolor}{\RequirePackage{ninecolors}}{} \@ifpackageloaded{hyperref}{ \newenvironment{tblrNoHyper}{\NoHyper}{\endNoHyper} }{ \newenvironment{tblrNoHyper}{}{} } } 
2
  • So the solution is to load package ninecolors in the preamble to have the colors available directly. Commented Dec 18, 2022 at 7:37
  • @MatthiasPospiech yes Commented Dec 18, 2022 at 10:06

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.