lvjr / tabularray

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

Only load the same library once #364

Closed lvjr closed 4 months ago

lvjr commented 1 year ago

When loading the same library twice, tabularray may throw errors:

\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\UseTblrLibrary{siunitx}
\begin{document}
Test
\end{document}

Adding a \cs_undefine:c line should fix this issue:

\RenewDocumentCommand \UseTblrLibrary { m }
  {
    \clist_map_inline:nn {#1}
      {
        \use:c { __tblr_use_lib_ ##1: }
        \cs_undefine:c { __tblr_use_lib_ ##1: }
      }
  }