Siunitx 3 and amsmath : compilation time out on Overleaf with TeX Live 2020

When using version 3.0.23 of siunitx on Overleaf with TeX Live 2020, I get compilation time out when running the code

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{siunitx}

\begin{document}

This is a test : \qty{5}{\percent}

\end{document}


Changing the order of the package loading doesn't change the end result.

Removing amsmath allows the file to compile normally, and so is reverting to siunitx 2.8 included in TeX Live 2020 on Overleaf while keeping amsmath. Also, in the packages I use daily, only nicematrix has the same time out problem, but it has amsmath as a required package.

Any chance someone here encountered that problem before?

• Can you provide a log file? I have no issues using the frozen TL20 I have on disk with an added siunitx v3 Jul 28 at 14:29
• You've manually installed v3? At present you'll need to force-load xparse: I've uploaded a fix for that, but it's not on CTAN just yet. Jul 28 at 14:31
• @JosephWright, the xparse problem is solved in 3.0.23 which is the one I used. I am the person who asked the question about it here.
– Zork
Jul 28 at 14:32
• @JosephWright make sense as the frozen TL20 have xparse in the kernel but I don't think Overleaf uses the frozen version Jul 28 at 14:32
• @Zork Well I've checked with TL'20 with siunitx v3.0.23, and all is well. I'm going to need some kind of log to get further. Jul 28 at 14:46

This is caused by a non-robust definition of \, with older set-ups, which means that there is an internal error when trying to expand and replace \, (needed internally for input-ignore). The easiest work-around it to make \, robust, for example

\usepackage{etoolbox}
\robustify\,


before loading siunitx v3.

• I'm not sure this counts as a bug: I need to think about it a bit. Jul 28 at 15:30

My answer is relative to nicematrix since I'm the author of that package. A drawback of nicematrix is that it requires several compilations, with informations written on the aux file between the compilations (for use in the next run). As far as I know, Overleaf uses latexmk which does the compilations until the aux file has not changed between two compilations.

However, when Overleaf stops the cycle of compilations because of time-out, it does not delete the aux file and, usually, when a new cycle of compilations is required (by clicking on the corresponding button), the job is done even if you have had a time-out when cliking the first time...