Skip to content

Commit eda6692

Browse files
committed
Fix missing commands
1 parent 39b3ca3 commit eda6692

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

ustcthesis.cls

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,13 +1612,16 @@
16121612
{ \cs_generate_variant:Nn \tl_set:Nn { Ne } }
16131613

16141614
% `\regex_if_match:nnTF` was not available until 2025-05-19.
1615-
\cs_if_exist:NF \regex_if_match:nnTF
1616-
{ \cs_new_protected:Npn \regex_if_match:nnTF { \regex_match:nnTF } }
1615+
\cs_if_exist:NF \regex_if_match:nVTF
1616+
{ \cs_new_protected:Npn \regex_if_match:nVTF { \regex_match:nVTF } }
1617+
1618+
\cs_if_exist:NF \regex_match:nVTF
1619+
{ \prg_generate_conditional_variant:Nnn \regex_match:Nn { nV } { TF } }
16171620

16181621
\cs_new:Npn \__ustc_set_date:n #1
16191622
{
16201623
\tl_set:Nx \l_tmpa_tl {#1}
1621-
\exp_args:NnV \regex_if_match:nnTF { ^ \d + - \d + - \d + $ } \l_tmpa_tl
1624+
\regex_if_match:nVTF { ^ \d + - \d + - \d + $ } \l_tmpa_tl
16221625
{
16231626
\seq_set_split:NnV \l_tmpa_seq { - } \l_tmpa_tl
16241627
\int_set:Nn \l__ustc_year_int { \seq_item:Nn \l_tmpa_seq { 1 } }
@@ -3155,6 +3158,10 @@
31553158
31563159
\clist_new:N \g__ustc_bib_files_clist
31573160
3161+
% \str_set:Ne was not available until 2023-06-05.
3162+
\cs_if_exist:NF \str_set:Ne
3163+
{ \cs_generate_variant:Nn \str_set:Nn { Ne } }
3164+
31583165
\NewDocumentCommand \addbibresource { O { } m }
31593166
{
31603167
\tl_if_blank:nF {#1}
@@ -3163,8 +3170,10 @@
31633170
{ \msg_error:nn { ustcthesis } { multi-bib-files } }
31643171
\clist_map_inline:nn {#2}
31653172
{
3166-
\str_set:Nx \l_tmpa_str {##1}
3167-
\regex_replace_once:nnNF { \. bib $ } { } \l_tmpa_str
3173+
\str_set:Ne \l_tmpa_str {##1}
3174+
\str_set:Ne \l_tmpb_str { \str_range:Nnn \l_tmpa_str { -4 } { -1 } }
3175+
\str_if_eq:VnTF \l_tmpb_str { .bib }
3176+
{ \str_set:Ne \l_tmpa_str { \str_range:Nnn \l_tmpa_str { 1 } { -5 } } }
31683177
{ \msg_warning:nn { ustcthesis } { bib-file-extension } }
31693178
\clist_gput_right:NV \g__ustc_bib_files_clist \l_tmpa_str
31703179
}

0 commit comments

Comments
 (0)