Math mode in tabular with siunitx

math-modesiunitxtables

My file compiled with siunitx 2 (TexLive 2020) but breaks with 3 (TexLive 2021). I can't find useful info in the upgrade section of the manual.

MWE: https://www.overleaf.com/read/wmgnzhqhbfpy

\documentclass{article}

\usepackage{siunitx}


\begin{document}

\begin{table}
    \begin{tabular}{ r S[table-format=2.3] }
        \(k\)  &  \(x_1^{(k)}\) \\
    \end{tabular}
\end{table}

\end{document}

Best Answer

Put curly braces around the material which is not numeric but should show up in an S type column.

So use the following instead (works in both v2 and v3):

\documentclass{article}

\usepackage{siunitx}


\begin{document}
\begin{tabular}{ r S[table-format=2.3] }
  \(k\)  &  {\(x_1^{(k)}\)} \\
\end{tabular}
\end{document}