For the MWE below, \sisetup{mode = match} throws the following error only if \square or \squared is used with a unit:

Missing $ inserted.

So, why does this happen?

\usepackage{tabularray, siunitx}

\sisetup{mode = match} % results in an error only if \square or \squared is used

\NewColumnType{s}[1][]{Q[l, cmd=\sisetup{#1}\unit]}

        caption = {The Caption},
            width = 0.7\linewidth, 
            colspec = {
                table-format = 4.3e-1,
                parse-numbers = true,
                table-alignment-mode = none,
                table-number-alignment = right,
                exponent-mode = input,
                exponent-product = \times,
                round-mode = none,
                round-precision = 3,
                tight-spacing = true,
                per-mode = symbol,
            }, % <<<<<<<<<
            rowhead = 1,
            row{even} = {gray9},
            cell{1}{3} = {c=2}{c}, % multicolumn

        Parameter & Symbol & {{{Value}}} &     \\
        two       & a      & 1.6         & \m\squared \\
  • I have fixed this bug. Please see my updated answer.
    – L.J.R.
    Sep 15, 2021 at 8:49

1 Answer 1


Updated on 2021-09-15: This bug has been fixed. You may download the latest package file from https://github.com/lvjr/tabularray/raw/main/tabularray.sty or wait for version 2021P scheduled on 2021-10-01.

enter image description here

This is a bug of tabularray package. The following is a minimal example showing this bug:

(By the way, the s column is predefined in siunitx library since version 2021M. You don't need to and are not allowed to define s column again.)



\sisetup{mode = match}



This issue is related to the current limitation of cmd option (see #57). I will update this answer after I have fixed the issue.

  • If s is predefined in siunitx, why does its manual still say I have to manually define it? I tried myself to not define it, and I always get an error.
    – Diaa
    Sep 15, 2021 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .