From 01dcf7ddc6135a87e439c254bdc44f7153eba147 Mon Sep 17 00:00:00 2001
From: FengChendian <njuzhaoyichen@gmail.com>
Date: Sun, 29 Aug 2021 15:11:51 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8xparse=E5=8C=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 njuthesis.cls               |  4 ++--
 profile/command.tex         |  7 -------
 profile/format/abstract.tex | 10 ++++++----
 profile/format/cover.tex    | 10 ++++++++--
 profile/packages.tex        |  1 +
 profile/profile.cls         |  1 -
 6 files changed, 17 insertions(+), 16 deletions(-)
 delete mode 100644 profile/command.tex

diff --git a/njuthesis.cls b/njuthesis.cls
index ae51c81..321baaf 100644
--- a/njuthesis.cls
+++ b/njuthesis.cls
@@ -39,8 +39,8 @@
 
 \ifthenelse{\equal{\Type}{thesis}}
 {
-  \newcommand{\typename}{\Degree 姣曚笟璁烘枃}
+  \NewDocumentCommand \typename {} {\Degree 姣曚笟璁烘枃}
 }
 {
-  \newcommand{\typename}{\Degree 姣曚笟璁捐}
+  \NewDocumentCommand \typename {} {\Degree 姣曚笟璁捐}
 }
\ No newline at end of file
diff --git a/profile/command.tex b/profile/command.tex
deleted file mode 100644
index af0801a..0000000
--- a/profile/command.tex
+++ /dev/null
@@ -1,7 +0,0 @@
-% 灏侀潰涓嬪垝绾�
-\cs_new:Npn \cover_underline:nn #1 #2 {
-    \tl_if_empty:nTF {#1}
-    {\tl_set:Nn #1 {\textwidth}}
-    {}
-    \uline{\makebox[#1]{#2}}
-}
diff --git a/profile/format/abstract.tex b/profile/format/abstract.tex
index 995699b..03ff46d 100644
--- a/profile/format/abstract.tex
+++ b/profile/format/abstract.tex
@@ -1,4 +1,5 @@
-\newenvironment{abstract}{%
+\NewDocumentEnvironment{abstract} {}
+{%
   \pagestyle{plain}
   \pagenumbering{Roman}
   \begin{center}
@@ -23,13 +24,14 @@
 }
 
 % 涓枃鍏抽敭璇�
-\cs_new:Npn \keywords #1 {%
+\NewDocumentCommand \keywords {m} {%
   \par\vspace{2ex}\noindent%
   {\kaishu\zihao{-4}\makebox[4em][s]{鍏抽敭璇峽锛殅}}~{#1}%
 }
 
 % 鑻辨枃鎽樿
-\newenvironment{englishabstract}{%
+\NewDocumentEnvironment{englishabstract} {}
+{%
   \pagestyle{plain}
   \begin{center}
       \kaishu\zihao{-2}{\textbf{\uuline{鍗椾含澶у鏈鐢熸瘯涓氳鏂�(璁捐銆佷綔鍝�)鑻辨枃鎽樿}}}
@@ -51,7 +53,7 @@
 }
 
 % 鑻辨枃鍏抽敭璇�
-\cs_new:Npn \englishkeywords #1 {%
+\NewDocumentCommand \englishkeywords {m} {%
   \par\vspace{2ex}\noindent%
   {KEYWORDS{:}}~~{#1}%
 }
\ No newline at end of file
diff --git a/profile/format/cover.tex b/profile/format/cover.tex
index 9ec8e38..593c0bc 100644
--- a/profile/format/cover.tex
+++ b/profile/format/cover.tex
@@ -1,3 +1,9 @@
+% 灏侀潰涓嬪垝绾�
+\cs_new:Npn \cover_underline:nn #1 #2 {
+    \uline{\makebox[#1]{#2}}
+}
+
+% 灏侀潰鏍囬
 \tl_new:N \cover_oneline_title
 \tl_set:Nn \cover_oneline_title {
   \begin{tabular}{p{4.2em}c}
@@ -39,10 +45,10 @@
   \end{tabular}
 }
 
-\tl_set:Nn \maketitle {%
+% 閲嶅畾涔塵aketitle鐢熸垚灏侀潰
+\RenewDocumentCommand \maketitle {} {%
   \thispagestyle{empty}
   \pagenumbering{Roman}
-%   \pdfbookmark[0]{\njut@cap@cover}{cover}
   % Start 
   \begin{spacing}{1.25}
   \vskip 0mm  
diff --git a/profile/packages.tex b/profile/packages.tex
index 185dd56..2867941 100644
--- a/profile/packages.tex
+++ b/profile/packages.tex
@@ -4,6 +4,7 @@
 \RequirePackage{geometry}
 \RequirePackage{ifthen}
 \RequirePackage{expl3}
+\RequirePackage{xparse}
 \RequirePackage{titlesec} 
 \RequirePackage{graphicx}
 \RequirePackage{ulem}
diff --git a/profile/profile.cls b/profile/profile.cls
index c8b355f..556c86f 100644
--- a/profile/profile.cls
+++ b/profile/profile.cls
@@ -4,7 +4,6 @@
     \input{profile/#1}
 }
 
-\profile_input{command.tex}
 \profile_input{packages.tex}
 \profile_input{format.tex}
 
-- 
GitLab