1

I want to recreate this answer but with tabularray. As said in documentation

A style may inherit from an existing style by starting 〈definitions〉with \setglossary-style and then just redefine the commands that are different from the inherited style.

I don't like the longtable style but when I try to change the environment to longtblr from tabularray, it doesn't work saying tab characters are misplaced.

Is it even possible, since there are predefined styles?

MWE

\documentclass{article}                           
\usepackage{siunitx}
\usepackage{tabularray}
\usepackage{glossaries}

\newglossary[slg]{symbolslist}{syi}{syg}{Symbolslist}

\glsaddkey{unit}{\glsentrytext{\glslabel}}{\glsentryunit}{\GLsentryunit}{\glsunit}{\Glsunit}{\GLSunit} \glssetnoexpandfield{unit}

\makeglossaries

\newglossaryentry{symb:Pi}{name=\ensuremath{\pi}, description={Geometrical value}, unit={}, type=symbolslist}

\newglossaryentry{height}{name=\ensuremath{h}, description={Height of tower}, unit={\unit{\m}}, type=symbolslist}

\newglossarystyle{symbolunittable}{ \setglossarystyle{long3colheader} \renewenvironment{theglossary}{ \begin{longtblr}{ p{2cm} p{5cm} p{2cm} } } { \end{longtblr} }

\renewcommand*{\glossaryheader}{
    \bfseries Símbolo & \bfseries Descripción & \bfseries Unidades \\ \hline\endhead
}
\renewcommand*{\glossentry}[2]{
    \glstarget{##1}{\glossentryname{##1}}
        & \glossentrydesc{##1}
        & \glsunit{##1}\\
}
\ifglsnogroupskip
    \renewcommand*{\glsgroupskip}{}%
\else
    \renewcommand*{\glsgroupskip}{}%
\fi

}

\begin{document} \glsaddall \printglossary[type=symbolslist,style=symbolunittable] \end{document}

Please see: How to use DTLforeach (datatool) within a tabularray table?

0 Answers0