From b24bcbaad5c6b4cbc32d5250ff6288cb536a1c89 Mon Sep 17 00:00:00 2001 From: lvjr Date: Mon, 25 Nov 2024 16:36:43 +0800 Subject: [PATCH] load tabularray libraries in external files (#532) --- tabularray.sty | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tabularray.sty b/tabularray.sty index a233cf6..d0b6ae7 100644 --- a/tabularray.sty +++ b/tabularray.sty @@ -7076,12 +7076,19 @@ \cs_new_protected:cpn { __tblr_use_lib_ #1: } {#2} } +%% Note that \cs_if_exist:NTF won't treat \prg_do_nothing: as an existing command. \NewDocumentCommand \UseTblrLibrary { m } { \clist_map_inline:nn {#1} { - \use:c { __tblr_use_lib_ ##1: } - \cs_undefine:c { __tblr_use_lib_ ##1: } + \cs_if_exist:cTF { __tblr_use_lib_ ##1: } + { + \use:c { __tblr_use_lib_ ##1: } + \cs_gset_eq:cN { __tblr_use_lib_ ##1: } \prg_do_nothing: + } + { + \RequirePackage { tabularray-library-##1 } + } } }