From 4cd17424a9dc5c755dfd28dbf2d747f945ec394d Mon Sep 17 00:00:00 2001
From: atxy <181850195@smail.nju.edu.cn>
Date: Tue, 7 Sep 2021 15:39:52 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=A8=E5=88=86=E6=94=AF=E8=AF=AD?=
 =?UTF-8?q?=E5=8F=A5=E9=87=8D=E5=86=99=E4=BA=86=E5=B0=81=E9=9D=A2=E5=A4=9A?=
 =?UTF-8?q?=E8=A1=8C=E6=A0=87=E9=A2=98=E7=9A=84=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 coverinfo.sty        |  3 ---
 njuthesis.cls        |  2 ++
 njuthesis.tex        |  2 ++
 profile/abstract.sty |  5 ++++-
 profile/cover.sty    | 33 +++++++++++++++++++--------------
 5 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/coverinfo.sty b/coverinfo.sty
index e02da3f..7c769d2 100644
--- a/coverinfo.sty
+++ b/coverinfo.sty
@@ -3,7 +3,6 @@
 \tl_const:Nn \TitleA {鏇茬巼寮曟搸鐨勭爺绌秨% 绗竴琛屾爣棰�
 \tl_const:Nn \TitleB {}% 绗簩琛屾爣棰�
 \tl_const:Nn \TitleC {}% 绗笁琛屾爣棰�
-\tl_const:Nn \Title {\TitleA\TitleB\TitleC}
 \tl_const:Nn \Title_EN {Curvature~engine~research}
 \tl_const:Nn \Grade {2017}
 \tl_const:Nn \StudentID {17184xxx}
@@ -18,5 +17,3 @@
 \tl_const:Nn \MentorTitle {鏁欐巿}
 \tl_const:Nn \MentorTitle_EN {Professor}
 \tl_const:Nn \SubmitDate {2077骞�12鏈�31鏃
-\tl_const:Nn \Degree {UG}% 瀛︿綅 鏈锛歎G
-\tl_const:Nn \Type {thesis}% thesis锛氭瘯涓氳鏂囷紝design:姣曚笟璁捐
\ No newline at end of file
diff --git a/njuthesis.cls b/njuthesis.cls
index 1db9bd8..f192162 100644
--- a/njuthesis.cls
+++ b/njuthesis.cls
@@ -21,6 +21,8 @@
   ]{ctexbook}[2018/04/01]
 
 \DeclareStringOption[1]{TitleLength}
+\DeclareStringOption[UG]{Degree}
+\DeclareStringOption[thesis]{Type}
 
 \ProcessKeyvalOptions*\relax
 
diff --git a/njuthesis.tex b/njuthesis.tex
index 56c36ee..27b88c3 100644
--- a/njuthesis.tex
+++ b/njuthesis.tex
@@ -1,5 +1,7 @@
 \documentclass[
     TitleLength=1,% 閫夋嫨鏍囬琛屾暟锛岃寖鍥存槸1~3
+    Degree=UG,% 瀛︿綅 鏈锛歎G
+    Type=thesis% thesis锛氭瘯涓氳鏂囷紝design:姣曚笟璁捐
 ]{njuthesis}
 
 \addbibresource{njuthesis.bib}
diff --git a/profile/abstract.sty b/profile/abstract.sty
index 1f6fe02..6326cbe 100644
--- a/profile/abstract.sty
+++ b/profile/abstract.sty
@@ -1,4 +1,7 @@
-\ProvidesExplPackage{profile/abstract}{2021-09-04}{0.1}{NJU Thesis Undergraduate abstract design} 
+\ProvidesExplPackage{profile/abstract}{2021-09-04}{0.1}{NJU Thesis Undergraduate abstract design}
+
+% 鎷煎悎鏍囬
+\tl_const:Nn \Title {\TitleA\TitleB\TitleC}
 
 % 鎽樿鐜
 \NewDocumentEnvironment{abstract} {}
diff --git a/profile/cover.sty b/profile/cover.sty
index c7e17f9..f51f015 100644
--- a/profile/cover.sty
+++ b/profile/cover.sty
@@ -19,20 +19,21 @@
     \coverbox:n {涓揬hfill 涓殅
     & \cover_underline:nn {250pt}{\songti\Major}\\
 
-    \coverbox:n {棰榎hfill 鐩畗
-    & \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\
-
-    \int_compare:nNnTF { \TitleLength } = { 2 }  { 
-      \coverbox:n {\hfill}
-      & \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
-    }{}
-    
-    \int_compare:nNnTF { \TitleLength } = { 3 }  { 
-      \coverbox:n {\hfill}
-      & \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
-      \coverbox:n {\hfill}
-      & \cover_underline:nn {250pt}{\textbf{\songti\TitleC}} \\
-    }{}
+    \int_case:nn {\TitleLength}
+      {
+        { 1 } { 
+          \coverbox:n {棰榎hfill 鐩畗
+          & \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\ }
+        { 2 } {
+          \coverbox:n {棰榎hfill 鐩畗
+          & \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\
+          & \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\ }
+        { 3 } { 
+          \coverbox:n {棰榎hfill 鐩畗
+          & \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\
+          & \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
+          & \cover_underline:nn {250pt}{\textbf{\songti\TitleC}} \\}
+      }
   \end{tabular}\\
 
   \begin{tabular}{p{4.2em}cp{4.2em}c}
@@ -68,6 +69,10 @@
 }
 
 % 鍒ゆ柇绫诲瀷
+\int_compare:nNnTF { \TitleLength } = { 2 }  { 
+      \coverbox:n {\hfill}
+      & \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
+    }{}
 \ifthenelse{\equal{\Degree}{UG}}
 {
   \NewDocumentCommand \Degreename {} {\hfill 鏈琝hfill 绉慭hfill }
-- 
GitLab