josephwright/siunitx

V2 compatibility mode and \inputing pgfkeys.tex

Closed this issue · 5 comments

Hello,

Please consider the NWME below (TeXLive 2024, uptodate):

\documentclass{standalone}
\RequirePackage{siunitx}[=v2]
\input pgfkeys.tex
\begin{document}
YO
\end{document}

It fails with:

! Argument of \color has an extra }.
<inserted text> 
\par 
l.4 \begin{document}

Without the v2 compatibility option, if works fine.

That's never worked that I know of - loading v2 is there to support older docs that need to stick with v2 features, and they'd have been broken in e.g. TL 2020.

(The v2 option loads the very last v2 .sty as-is, BTW)

Ok. Thanks. Do you know why it is failing?

OK, I see why this is happening: I've got the wrong function in a test that 'protected' tokens in v2. That means that the pgf definition of \color isn't handled correctly, leading to an error. But I don't feel that this needs a back-ported fix.

(I'm only really going to address things in the v2 code that block usage due to e.g. expl3 changes.)