Skip to content

Commit

Permalink
chore: disable loading of conflicting packages
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu committed Jan 3, 2025
1 parent 07aad4f commit 069d3a3
Showing 1 changed file with 34 additions and 20 deletions.
54 changes: 34 additions & 20 deletions sjtutex/source/sjtutex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,18 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@@_disable_package_load:n}
% \begin{macrocode}
\msg_new:nnn { sjtutex } { package-disabled }
{ The~loading~of~package~'#1'~is~disabled. }
\cs_new_protected:Npn \@@_disable_package_load:n #1
{
\disable@package@load {#1}
{ \msg_warning:nnn { sjtutex } { package-disabled } {#1} }
}
% \end{macrocode}
% \end{macro}
%
% \changes{v2.0.2}{2023/03/31}{区分 \texttt{dim} 与 \texttt{skip} 类型变量。}
% \begin{macro}[int]{\@@_dim_set_to_wd:Nn,\@@_skip_add_to_wd:Nn}
% 操作长度变量的辅助函数。
Expand Down Expand Up @@ -2857,6 +2869,9 @@
\scpolint\npolint\pointint\sqint\intlarhk\intx
\intcap\intcup\upint\lowint
}
\clist_map_inline:nn
{ amsfonts, amssymb, bm, upgreek }
{ \@@_disable_package_load:n {#1} }
}
% \end{macrocode}
%
Expand Down Expand Up @@ -5493,34 +5508,33 @@
\newtheoremstyle { sjtu }
{ } { } { \SJTU@style@thm@body@font } { }
{ \SJTU@style@thm@header@font } { } { \ccwd } { }
\@@_disable_package_load:n { ntheorem }
\AddToHook { begindocument / before }
{
\theoremstyle { sjtu }
\@@_new_theorems:
}
}
% \end{macrocode}
%
% 如果用户加载了 \pkg{amsthm} 或 \pkg{ntheorem} 宏包,
% 则在导言区末尾应用预设的样式定义定理环境。
% \pkg{ntheorem} 宏包。
% \begin{macrocode}
\AddToHook { begindocument / before }
\AddToHook { package / ntheorem / after }
{
\IfPackageLoadedTF { amsthm }
\@@_disable_package_load:n { amsthm }
\AddToHook { begindocument / before }
{
\theoremstyle { sjtu }
\@@_cs_provide_eq:NN \QED \c_empty_tl
\theoremheaderfont { \SJTU@style@thm@header@font }
\theorembodyfont { \SJTU@style@thm@body@font }
\theoremseparator { \enskip }
\theoremsymbol { \ensuremath { \QED } }
\qedsymbol { \ensuremath { \QED } }
\cs_if_exist:NF \proof
{ \newtheorem* { proof } { \proofname } }
\theoremsymbol { }
\@@_new_theorems:
}
{
\IfPackageLoadedT { ntheorem }
{
\@@_cs_provide_eq:NN \QED \c_empty_tl
\theoremheaderfont { \SJTU@style@thm@header@font }
\theorembodyfont { \SJTU@style@thm@body@font }
\theoremseparator { \enskip }
\theoremsymbol { \ensuremath { \QED } }
\qedsymbol { \ensuremath { \QED } }
\cs_if_exist:NF \proof
{ \newtheorem* { proof } { \proofname } }
\theoremsymbol { }
\@@_new_theorems:
}
}
}
% \end{macrocode}
%
Expand Down

0 comments on commit 069d3a3

Please sign in to comment.