lvjr / tabularray

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

Vline and hline specs with macros #413

Closed cpierquet closed 1 year ago

cpierquet commented 1 year ago

Hi- I want to create a tabular with options for thickness and color rules, but with color it's not working :

\documentclass{article}
\usepackage{tabularray}

\def\MPMThick{2pt}
\def\MPMLargBoite{0.65cm}
\def\MPMFont{\scriptsize\sffamily}
\def\MPMColor{orange}

With this code, it's working (thickness is OK) :

\begin{tblr}{rowsep=1pt,colsep=1pt,%
    hlines={\MPMThick},vlines={\MPMThick},%
    colspec={Q[\MPMLargBoite,m,c]Q[\MPMLargBoite,m,c]},
    cells={font=\MPMFont},
    row{1}={font=\bfseries\MPMFont}
    }
    \SetCell[c=2]{c} {Début} & \\
    {0} & {0} \\
\end{tblr}

image

With this code, it's not working :

\begin{tblr}{rowsep=1pt,colsep=1pt,%
    hlines={\MPMColor},vlines={\MPMColor},%
    colspec={Q[\MPMLargBoite,m,c]Q[\MPMLargBoite,m,c]},
    cells={font=\MPMFont},
    row{1}={font=\bfseries\MPMFont}
    }
    \SetCell[c=2]{c} {Début} & \\
    {0} & {0} \\
\end{tblr}

image

I'm a wrong with the syntax ?

note286 commented 1 year ago
hlines={wd=\MPMThick,fg=\MPMColor},
vlines={wd=\MPMThick,fg=\MPMColor},
cpierquet commented 1 year ago
hlines={wd=\MPMThick,fg=\MPMColor},
vlines={wd=\MPMThick,fg=\MPMColor},

It's perfect !!