Skip to content

Commit

Permalink
移除本科吞参数处理
Browse files Browse the repository at this point in the history
  • Loading branch information
SwitWu committed May 2, 2024
1 parent 1018aec commit 4b17a7d
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions whu-thesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2230,51 +2230,6 @@
}

%region 目录
%tag 本科吞参数
% 目录标题和正文标题相同(即不能输入 \chapter[]{} 只能输入 \chapter{})
% 下面采用的是“吞参数”的方法:让 [] 的参数不起作用(被忽略)从而起到吞掉参数的效果
\__whu_msg_new:nn { bachelor-no-optional-argument }
{
#1~shouldn't~be~used~with~optional~argument~in~bachelor's~thesis.\\
The~optional~argument~of~#1~is~ignored.
}
\cs_new:Npn \__whu_bachelor_chapter_cmds_no_optional_argument:
{
\NewCommandCopy { \bachelorchapter } { \chapter }
\NewCommandCopy { \bachelorsection } { \section }
\NewCommandCopy { \bachelorsubsection } { \subsection }
\RenewDocumentCommand \chapter { s o m }
{
\IfBooleanTF {##1}
{ \bachelorchapter* {##3} }
{ \bachelorchapter {##3} } % ]
\IfNoValueF {##2}
{ \__whu_warning:nn { bachelor-no-optional-argument } { \chapter } }
}
\RenewDocumentCommand \section { s o m }
{
\IfBooleanTF {##1}
{ \bachelorsection* {##3} }
{ \bachelorsection {##3} } % ]
\IfNoValueF {##2}
{ \__whu_warning:nn { bachelor-no-optional-argument } { \section } }
}
\RenewDocumentCommand \subsection { s o m }
{
\IfBooleanTF {##1}
{ \bachelorsubsection* {##3} }
{ \bachelorsubsection {##3} } % ]
\IfNoValueF {##2}
{ \__whu_warning:nn { bachelor-no-optional-argument } { \subsection } }
}
}
\AddToHook { begindocument }
{
\tl_if_eq:NnT \g__whu_thesis_type_tl { bachelor }
{
\__whu_bachelor_chapter_cmds_no_optional_argument:
}
}
%tag 本科设置
\cs_new:Npn \__whu_bachelor_set_tocline:
{
Expand Down

0 comments on commit 4b17a7d

Please sign in to comment.