fpantigny / nicematrix

The LaTeX package nicematrix
3 stars 1 forks source link

Error with Siunitx S column type #9

Closed Fourthbus closed 3 weeks ago

Fourthbus commented 3 weeks ago

I tried to use S column type with options but returns an error. Latex version: Texlive2024 LuaLaTeX (It was working in Texlive2023)

Minimum working example

    \footnotesize\begin{NiceTabularX}{\linewidth}{cSX}
        \toprule
        ... & 100 & ...\\
        ... & {-} & ...\\
        \bottomrule
    \end{NiceTabularX}

However, this will produce unwanted alignment given the non-number presented in row 2, normally in a tabular environment one will approach by using S[table-format=3]. However, using the following, my compiler will output an error

    \footnotesize\begin{NiceTabularX}{\linewidth}{cS[table-format=3]X}
        \toprule
        ... & 100 & ...\\
        ... & {-} & ...\\
        \bottomrule
    \end{NiceTabularX}

error:

atal Package nicematrix Error: Bad column type.
(nicematrix)                      The column type 't' in your environment
(nicematrix)                      {NiceTabularX} is unknown.
(nicematrix)                      This error is fatal.

I suspect there is something parsing the leading t in S[table-format=3] incorrectedly.

fpantigny commented 3 weeks ago

You are right. That's a bug. I have corrected it in commit 6d1cb68. Of course, it will be in the next version on CTAN.

I have tested with:

\documentclass{article}
\usepackage{nicematrix,booktabs,siunitx}
\begin{document}
\begin{NiceTabular}{cS[table-format=3]X}
\toprule
... & 100 & ...\\
... & {-} & ...\\
\bottomrule
\end{NiceTabular}
\end{document}