lvjr / tabularray

Typeset tabulars and arrays with LaTeX3
https://ctan.org/pkg/tabularray
247 stars 22 forks source link

User-defined variable bug? #283

Closed FruitSausage closed 1 year ago

FruitSausage commented 1 year ago

I've had trouble getting user-defined variables to work sometimes. For instance, the following does not work:

\documentclass[letterpaper,11pt,oneside]{article}
\usepackage{tabularray}

\newcommand{\userVarA}{0.1}

\begin{document}

\begin{longtblr}{
   colspec = {| X[\userVarA,l] X |},
}
   alpha & beta \\
\end{longtblr}

\end{document}

But this does:

\documentclass[letterpaper,11pt,oneside]{article}
\usepackage{tabularray}

\begin{document}

\begin{longtblr}{
   colspec = {| X[0.1,l] X |},
}
   alpha & beta \\
\end{longtblr}

\end{document}
lvjr commented 1 year ago

When you write Q[0.1], tabularray correctly guesses it is Q[co=0.1], but when you write Q[\userVarA], tabularray wrongly guesses it is Q[wd=\userVarA]. Therefore you can not omit co= in this case.