josephwright / siunitx

A comprehensive (SI) units package for LaTeX
LaTeX Project Public License v1.3c
350 stars 25 forks source link

Test to not expand cell content fails with current version of array.sty #737

Open TeXhackse opened 3 weeks ago

TeXhackse commented 3 weeks ago

I faced an issue concerning the use of \unit{\bar} in an S-column.

It is caused by the change of array which makes the cell content ended by \onlytext@unskip instead of unskip.

MWE:

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit{\bar}{bar}% because \bar is now deprecated.
\begin{document}

\begin{tabular}{S}
{\unit{\bar}}
\end{tabular}

\end{document}

Should be able to resolve this by adding \onlytext@unskip to the special tokens and treat it the same way like \unskip.

I am going to provide a PR, not sure if it's helpful, but I had to discover if I'd rather report here or at array so had to have a look anyway.