texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Align in tblr environment from tabularray package

Open sergiokapone opened this issue 3 years ago • 12 comments

I found very progressive and modern analogue of old tabular/tabularx packages - a tabularray package. It is possible to add a cwl for it? Also it is necessary to add alignment behaviour on TXS button "Align Colums" for tblr environment.

\documentclass[]{article}
\usepackage{tabularray}

\begin{document}

\begin{tblr}{|l|l|l|l|}
\hline
\SetCell[r=4]{h,1.5cm} Multirow Cell One & Alpha & \SetCell[r=4]{f,1.5cm} Multirow Cell Two & Alpha \\
                                         & Beta                             &                                                                 & Beta \\
                                         & Gamma                       &                                                                 & Gamma \\
                                         & Delta                           &                                                                 & Delta \\
\hline
\end{tblr}

\end{document}

I think it would be nice if the Wizard could also work with this package. Because it's written in LaTeX3, it's more flexible and more intuitive in terms of alignment, I think it will push old tabular packages out of use.

sergiokapone avatar May 06 '22 06:05 sergiokapone

In my TeXStudio, that cwl is already in there (although automatically generated, but it's there!). image

You might need to activate it manually: image

foreachthing avatar May 06 '22 07:05 foreachthing

Yes, thank you. But the question about TXS button "Align Colums" for tblr environment still left yet. Also signs "&" does not highligted inside tblr environment.

sergiokapone avatar May 06 '22 07:05 sergiokapone

But the question about TXS button "Align Colums" for tblr environment still left yet. Also signs "&" does not highligted inside tblr environment.

Ah, I see. No, this does not work - yet. I don't know where to edit what to make that work. I guess you could write a custom macro to rename {tblr} to {tabular}, align and rename back again ;-)

foreachthing avatar May 06 '22 08:05 foreachthing

There is no need to activate tabularray by hand as txs scan usepackages. The cwl for that package is part of txs. However the interface (column definition) has changed, so it probably will take a while until all things work.

sunderme avatar May 06 '22 15:05 sunderme

fixed column detection and table manipulation for tblr&co. Advanced column definition does not work.

sunderme avatar May 26 '22 17:05 sunderme