Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel (french) clash with xcolor : Error: Undefined color #322

Open
flomine opened this issue Dec 16, 2024 · 2 comments
Open

babel (french) clash with xcolor : Error: Undefined color #322

flomine opened this issue Dec 16, 2024 · 2 comments

Comments

@flomine
Copy link

flomine commented Dec 16, 2024

When included, babel package (with french option) induced an error with xcolor.
For example, considering this working example:

\documentclass[handout]{beamer}
%\usepackage[french]{babel}%<----- When included, this line induces error
\usepackage[dvipsnames]{xcolor}
\usepackage{nicematrix}
\begin{document}

\begin{frame}{A test}
\sffamily
\renewcommand{\arraystretch}{1.4}

\begin{center}
\begin{NiceTabular}
   [
     columns-width=3cm,
     hvlines-except-borders,
     rules={color=white,width=1pt}
   ]
   {ccc}
\CodeBefore
  \rowcolor{NavyBlue}{1}
  \rowcolors{2}{NavyBlue!25}{NavyBlue!15}
\Body
  \RowStyle[color=white]{}
  First column & Second column & Third column \\
  1            & A             & E            \\
  2            & B             & F            \\
  3            & C             & G            \\
  4            & D             & H            \\
\end{NiceTabular}
\end{center}
\end{frame}
\end{document}

If you add this "\usepackage[french]{babel}", then we have the error
Package xcolor Error: Undefined color NavyBlue\penalty @m \hskip .5\fontdimen 2\font \relax '.`

@davidcarlisle
Copy link
Member

It is I think specifically withthe way nicematrix re-executes the code, you can use

  \rowcolors{2}{NavyBlue\string!25}{NavyBlue\string!15}

@u-fischer
Copy link
Member

it is a nicematrix problem. It expands the color name (imho in \__nicematrix_add_to_colors_seq:ee) without babel protection. You can try with

\CodeBefore
  \csname @safe@activestrue\endcsname
  \rowcolor{NavyBlue}{1}
  \rowcolors{2}{NavyBlue!25}{NavyBlue!15}
\Body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants