From 75e170e6570937c8cb04c7ac9dca9fb7d91eb129 Mon Sep 17 00:00:00 2001
From: atxy-blip <181850195@smail.nju.edu.cn>
Date: Sat, 4 Dec 2021 00:47:39 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E4=BB=A3?=
 =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 source/njuthesis.dtx          | 408 ++++++++++++++++------------------
 test/chapters/FigTabCode.tex  |  20 +-
 test/chapters/Mathematics.tex |  11 +-
 3 files changed, 191 insertions(+), 248 deletions(-)

diff --git a/source/njuthesis.dtx b/source/njuthesis.dtx
index 2161bd5..457b3b2 100644
--- a/source/njuthesis.dtx
+++ b/source/njuthesis.dtx
@@ -1283,8 +1283,14 @@ through XeTeX.
 % 瀛︿綅绫诲瀷銆�
 %    \begin{macrocode}
   degree            .choices:nn   =
-  { ug, mg, mf, phd }
-  { \int_set_eq:NN \g_@@_info_degree_int \l_keys_choice_int },  
+    { ug, mg, mf, phd }
+    { \int_set_eq:NN \g_@@_info_degree_int \l_keys_choice_int  
+%    \end{macrocode}
+% 杩涜瀛︿綅鐨勫垽鏂€�
+%    \begin{macrocode}
+      \int_compare:nTF { \g_@@_info_degree_int == 1 }
+        { \tl_set:Nn \g_@@_info_diploma_tl { ug } }
+        { \tl_set:Nn \g_@@_info_diploma_tl { g  } } },
   degree            .initial:n    =   ug,
 %    \end{macrocode}
 % \end{macro}
@@ -1293,8 +1299,8 @@ through XeTeX.
 % 璁烘枃绫诲瀷銆�
 %    \begin{macrocode}
   type              .choices:nn   =
-  { thesis, design }
-  { \int_set_eq:NN \g_@@_info_type_int   \l_keys_choice_int }, 
+    { thesis, design }
+    { \int_set_eq:NN \g_@@_info_type_int   \l_keys_choice_int },
   type              .initial:n    =   thesis,
 %    \end{macrocode}
 % \end{macro}
@@ -1327,14 +1333,6 @@ through XeTeX.
 %    \end{macrocode}
 % \end{macro}
 %
-% 杩涜瀛︿綅鐨勫垽鏂€�
-%    \begin{macrocode}
-\int_compare:nTF { \g_@@_info_degree_int == 1 }
-  { \tl_set:Nn \g_@@_info_diploma_tl { ug } }
-  { \tl_set:Nn \g_@@_info_diploma_tl { g } }
-%    \end{macrocode}
-% 
-%
 %
 % \subsection{涓汉淇℃伅}
 % 杈撳叆涓汉淇℃伅鐨勫尯鍩熴€�
@@ -1500,24 +1498,24 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 %    \end{macrocode}
 %
 % \begin{macro}{\njuline}
-% 閽堝缂栬瘧寮曟搸锛屼娇鐢ㄤ笉鍚岀殑瀹忓寘鏋勫缓鍙互瀵逛腑鏂囨甯告崲琛岀殑涓嬪垝绾垮懡浠ゃ€俓pkg{lua-ul}涓渶瑕佸湪缁撳熬浣跨敤\tn{null}淇濇姢灏鹃儴绌虹櫧銆�
+% 閽堝缂栬瘧寮曟搸锛屼娇鐢ㄤ笉鍚岀殑瀹忓寘鏋勫缓鍙互瀵逛腑鏂囨甯告崲琛岀殑涓嬪垝绾垮懡浠ゃ€俓pkg{lua-ul} 涓渶瑕佸湪缁撳熬浣跨敤\tn{null}淇濇姢灏鹃儴绌虹櫧銆�
 %    \begin{macrocode}
 \sys_if_engine_xetex:T
-{
+  {
     \RequirePackage{xeCJKfntef,microtype}
-    \newcommand{\njuline}[1]{\CJKunderline{#1}}
-}
+    \NewDocumentCommand \njuline { m } { \CJKunderline{#1} }
+  }
 \sys_if_engine_luatex:T
-{
+  {
     \RequirePackage{lua-ul,dashundergaps}
-    \newcommand{\njuline}[1]{\underLine{#1}\null}
-}
+    \NewDocumentCommand \njuline { m } { \underLine{#1} \null }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% 鏁板锛孿pkg{amsmath}蹇呴』鍦╘pkg{unicode-math}鍓嶅姞杞姐€�
-% \pkg{unicode-math}鎸囧畾浜哱hologo{XeTeX}鍜孿hologo{LuaTeX}涓嬫墍浣跨敤鐨勬暟瀛﹀瓧浣撱€�
-% 鐢ㄤ簬閰嶇疆鏁板鐜鐨刓pkg{mathtools}浼氫笌\pkg{unicode-math}鍙戠敓鍐茬獊锛屾澶勬墜鍔ㄦ秷闄ゅ叾璀﹀憡銆�
+% 鏁板锛孿pkg{amsmath} 蹇呴』鍦� \pkg{unicode-math} 鍓嶅姞杞姐€�
+% \pkg{unicode-math} 鎸囧畾浜� \hologo{XeTeX} 鍜� \hologo{LuaTeX} 涓嬫墍浣跨敤鐨勬暟瀛﹀瓧浣撱€�
+% 鐢ㄤ簬閰嶇疆鏁板鐜鐨� \pkg{mathtools} 浼氫笌 \pkg{unicode-math} 鍙戠敓鍐茬獊锛屾澶勬墜鍔ㄦ秷闄ゅ叾璀﹀憡銆�
 %    \begin{macrocode}
 \RequirePackage{amsmath,amsthm,mathtools,thmtools}
 \RequirePackage[
@@ -1529,9 +1527,9 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 %
 % 閰嶇疆鍥剧墖銆佽〃鏍笺€佷唬鐮併€佸垪琛ㄧ幆澧�
 %    \begin{macrocode}
-\RequirePackage{graphicx,subcaption,wrapfig,tikz}
+\RequirePackage{graphicx,wrapfig,tikz}
 \DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png}
-\RequirePackage{booktabs,multirow,multicol,listings,enumitem}
+\RequirePackage{booktabs,multirow,listings,enumitem}
 %    \end{macrocode}
 %
 % 蹇呴』浠ヨ椤哄簭鍔犺浇浠ヤ笅涓や釜鍏充簬寮曠敤鐨勫寘銆�
@@ -1577,7 +1575,7 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 %
 % \subsection{瀛椾綋璁剧疆}
 %
-% \pkg{fontspec}宸插湪C\hologo{TeX}濂椾欢涓寘鍚紝鏃犻渶鍙﹀杞藉叆銆�
+% \pkg{fontspec} 宸插湪 C\hologo{TeX} 濂椾欢涓寘鍚紝鏃犻渶鍙﹀杞藉叆銆�
 %
 % \subsubsection{鎿嶄綔绯荤粺妫€娴媫
 %
@@ -1604,24 +1602,16 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 % 杩欎袱绉嶆儏鍐靛鐨勭郴缁熻鍒ゆ柇涓� Linux锛屼竴寰嬩娇鐢ㄨ嚜鐢卞瓧浣撱€�
 %    \begin{macrocode}
 \bool_if:NT \g_@@_load_system_fontset_bool
-{
-  \sys_if_platform_windows:TF
-  {
-    \tl_set:Nn \g_@@_latin_fontset_tl { windows }
-    \tl_set:Nn \g_@@_cjk_fontset_tl   { windows }
-  }
-  {
-    \ctex_if_platform_macos:TF
-    {
-      \tl_set:Nn \g_@@_latin_fontset_tl { macos }
-      \tl_set:Nn \g_@@_cjk_fontset_tl   { macos }
-    }
-    {
-      \tl_set:Nn \g_@@_latin_fontset_tl { gyre }
-      \tl_set:Nn \g_@@_cjk_fontset_tl { fandol }
-    }
+  { 
+    \sys_if_platform_windows:TF
+      { \tl_set:Nn \g_@@_latin_fontset_tl   { windows }
+        \tl_set:Nn \g_@@_cjk_fontset_tl     { windows } }
+      { \ctex_if_platform_macos:TF
+        { \tl_set:Nn \g_@@_latin_fontset_tl { macos   }
+          \tl_set:Nn \g_@@_cjk_fontset_tl   { macos   } }
+        { \tl_set:Nn \g_@@_latin_fontset_tl { gyre    }
+          \tl_set:Nn \g_@@_cjk_fontset_tl   { fandol  } } } 
   }
-}
 %    \end{macrocode}
 %
 % \subsubsection{瀹氫箟鑻辨枃瀛楀簱}
@@ -1632,54 +1622,52 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 % Windows 瑗挎枃瀛椾綋
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_latin_font_windows:
-{
-  \setmainfont{Times~New~Roman}
-  \setsansfont{Arial}
-  \setmonofont{Courier~New}[Scale=MatchLowercase]
-}
+  {
+    \setmainfont{Times~New~Roman}
+    \setsansfont{Arial}
+    \setmonofont{Courier~New}[Scale=MatchLowercase]
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-%
 % \begin{macro}{\@@_load_latin_font_macos:}
 % macOS 瑗挎枃瀛椾綋銆�
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_latin_font_macos:
-{
-  \setmainfont{Times~New~Roman}
-  \setsansfont{Arial}
-  \setmonofont{Menlo}[Scale=MatchLowercase]
-}
+  {
+    \setmainfont{Times~New~Roman}
+    \setsansfont{Arial}
+    \setmonofont{Menlo}[Scale=MatchLowercase]
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-%
 % \begin{macro}{\@@_load_latin_font_gyre:}
 % 寮€婧愮殑 gyre 瑗挎枃瀛椾綋銆�
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_latin_font_gyre:
-{
-  \setmainfont{texgyretermes}[
-    Extension=.otf,
-    UprightFont=*-regular,
-    BoldFont=*-bold,
-    ItalicFont=*-italic,
-    BoldItalicFont=*-bolditalic]
-  \setsansfont{texgyreheros}[
-    Extension=.otf,
-    UprightFont=*-regular,
-    BoldFont=*-bold,
-    ItalicFont=*-italic,
-    BoldItalicFont=*-bolditalic]
-  \setmonofont{texgyrecursor}[
-    Extension=.otf,
-    UprightFont=*-regular,
-    BoldFont=*-bold,
-    ItalicFont=*-italic,
-    BoldItalicFont=*-bolditalic,
-    Scale=MatchLowercase,
-    Ligatures=CommonOff]
-}
+  {
+    \setmainfont{texgyretermes}[
+      Extension=.otf,
+      UprightFont=*-regular,
+      BoldFont=*-bold,
+      ItalicFont=*-italic,
+      BoldItalicFont=*-bolditalic]
+    \setsansfont{texgyreheros}[
+      Extension=.otf,
+      UprightFont=*-regular,
+      BoldFont=*-bold,
+      ItalicFont=*-italic,
+      BoldItalicFont=*-bolditalic]
+    \setmonofont{texgyrecursor}[
+      Extension=.otf,
+      UprightFont=*-regular,
+      BoldFont=*-bold,
+      ItalicFont=*-italic,
+      BoldItalicFont=*-bolditalic,
+      Scale=MatchLowercase,
+      Ligatures=CommonOff]
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1689,116 +1677,109 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 % Windows 涓枃瀛椾綋銆�
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_cjk_font_windows:
-{
-  \setCJKmainfont{SimSun}[
-    AutoFakeBold=2.17, 
-    ItalicFont=KaiTi]
-  \setCJKsansfont{SimHei}
-  \setCJKmonofont{FangSong}
-  \setCJKfamilyfont{zhsong}{SimSun}[AutoFakeBold=2.17]
-  \setCJKfamilyfont{zhhei}{SimHei}
-  \setCJKfamilyfont{zhfs}{FangSong}
-  \setCJKfamilyfont{zhkai}{KaiTi}[AutoFakeBold=2.17]
-  % \setCJKfamilyfont{zhnewhei}{Microsoft~YaHei}[
-  %   BoldFont=Microsoft~YaHei~Bold]
-}
+  {
+    \setCJKmainfont{SimSun}[
+      AutoFakeBold=2.17, 
+      ItalicFont=KaiTi]
+    \setCJKsansfont{SimHei}
+    \setCJKmonofont{FangSong}
+    \setCJKfamilyfont{zhsong}{SimSun}[AutoFakeBold=2.17]
+    \setCJKfamilyfont{zhhei}{SimHei}
+    \setCJKfamilyfont{zhfs}{FangSong}
+    \setCJKfamilyfont{zhkai}{KaiTi}[AutoFakeBold=2.17]
+  }
 %    \end{macrocode}
 % \end{macro}
 %
 %
 % \begin{macro}{\@@_load_cjk_font_macos:}
 % macOS 瀛椾綋銆�
-% TODO: 鍙傝€僀TeX鎵嬪唽绗�9鑺� LuaLATEX 涓嬬殑涓枃鏀寔鏂瑰紡瑙e喅 issue \#5 闂銆�
+% TODO: 淇 macOS 瀛椾綋鏀寔锛屽疄鐜板紑绠卞嵆鐢ㄣ€�
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_cjk_font_macos:
-{
-  % 绉婚櫎 does not contain script "CJK" 璀﹀憡
-  \msg_redirect_name:nnn {fontspec} {no-script} {info} 
-  \setCJKmainfont{Songti~SC~Light}[
-    BoldFont=Songti~SC~Bold,
-    ItalicFont=Kaiti~SC,
-    BoldItalicFont=Kaiti~SC~Bold]
-  \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
-  \setCJKmonofont{STFangsong}
-  \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
-  \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
-  \setCJKfamilyfont{zhfs}{STFangsong}
-  \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
-  \setCJKfamilyfont{zhnewhei}{PingFang~SC}
-}
+  {
+    % 绉婚櫎 does not contain script "CJK" 璀﹀憡
+    \msg_redirect_name:nnn {fontspec} {no-script} {info} 
+    \setCJKmainfont{Songti~SC~Light}[
+      BoldFont=Songti~SC~Bold,
+      ItalicFont=Kaiti~SC,
+      BoldItalicFont=Kaiti~SC~Bold]
+    \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
+    \setCJKmonofont{STFangsong}
+    \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
+    \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
+    \setCJKfamilyfont{zhfs}{STFangsong}
+    \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
+    \setCJKfamilyfont{zhnewhei}{PingFang~SC}
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-%
 % \begin{macro}{\@@_load_cjk_font_fandol:}
 % Fandol 瀛椾綋
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_cjk_font_fandol:
-{
-  % 绉婚櫎 does not contain script "CJK" 璀﹀憡
-  \msg_redirect_name:nnn {fontspec} {no-script} {info} 
-  \setCJKmainfont{FandolSong-Regular}[
-    Extension=.otf,
-    BoldFont=FandolSong-Bold,
-    ItalicFont=FandolKai-Regular]
-  \setCJKsansfont{FandolHei-Regular}[
-    Extension=.otf,
-    BoldFont=FandolHei-Bold]
-  \setCJKmonofont{FandolFang-Regular}[Extension=.otf]
-  \setCJKfamilyfont{zhsong}{FandolSong-Regular}[
-    Extension=.otf,
-    BoldFont=FandolSong-Bold]
-  \setCJKfamilyfont{zhhei}{FandolHei-Regular}[
-    Extension=.otf,
-    BoldFont=FandolHei-Bold]
-  \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf]
-  \setCJKfamilyfont{zhkai}{FandolKai-Regular}[
-    Extension=.otf,
-    AutoFakeBold=2.17]
-}
+  {
+    % 绉婚櫎 does not contain script "CJK" 璀﹀憡
+    \msg_redirect_name:nnn {fontspec} {no-script} {info} 
+    \setCJKmainfont{FandolSong-Regular}[
+      Extension=.otf,
+      BoldFont=FandolSong-Bold,
+      ItalicFont=FandolKai-Regular]
+    \setCJKsansfont{FandolHei-Regular}[
+      Extension=.otf,
+      BoldFont=FandolHei-Bold]
+    \setCJKmonofont{FandolFang-Regular}[Extension=.otf]
+    \setCJKfamilyfont{zhsong}{FandolSong-Regular}[
+      Extension=.otf,
+      BoldFont=FandolSong-Bold]
+    \setCJKfamilyfont{zhhei}{FandolHei-Regular}[
+      Extension=.otf,
+      BoldFont=FandolHei-Bold]
+    \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf]
+    \setCJKfamilyfont{zhkai}{FandolKai-Regular}[
+      Extension=.otf,
+      AutoFakeBold=2.17]
+  }
 %    \end{macrocode}
 % \end{macro}
 %
 %
 % \begin{macro}{\@@_load_cjk_font_founder:}
 % 鏂规瀛楀簱锛堢畝绻佹墿灞曪級
-% FZYouHK_508R \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{鏂规鎮犻粦508R} 璁捐甯堥潪鍟嗗厤璐癸紝
-% FZYouHK_511M \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{鏂规鎮犻粦511M} 璁捐甯堥潪鍟嗗厤璐�
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_cjk_font_founder:
-{
-  \sys_if_engine_luatex:T
   {
-    % 鍦� LuaTeX 涓皟鏁存柟姝e瓧浣撴嫭鍙蜂綅缃�
-    % XeTeX 鏆傛棤濂界殑瑙e喅鏂规硶
-    \defaultCJKfontfeatures{JFM={zh_CN/{quanjiao,fzpr}}}
-  }
-  \setCJKmainfont{FZSSK}[% 鏂规涔﹀畫
-    Extension=.ttf,
-    BoldFont=FZXBSK,% 鏂规灏忔爣瀹�
-    ItalicFont=FZKTK]% 鏂规妤蜂綋
-  \setCJKsansfont{FZXH1K}[% 鏂规缁嗛粦涓€
-    Extension=.ttf,
-    BoldFont=FZHTK]% FZHTK 鏂规榛戜綋
-  \setCJKmonofont{FZFSK}[Extension=.ttf]% 鏂规浠垮畫
-  \setCJKfamilyfont{zhsong}
-    {FZSSK}[
+    \sys_if_engine_luatex:T
+    {
+%    \end{macrocode}
+% 鍦� LuaTeX 涓皟鏁存柟姝e瓧浣撴嫭鍙蜂綅缃�
+% XeTeX 鏆傛棤濂界殑瑙e喅鏂规硶
+%    \begin{macrocode}
+      \defaultCJKfontfeatures{JFM={zh_CN/{quanjiao,fzpr}}}
+    }
+    \setCJKmainfont{FZSSK}[% 鏂规涔﹀畫
       Extension=.ttf,
-      BoldFont=FZXBSK]
-  \setCJKfamilyfont{zhhei}
-    {FZHTK}[
+      BoldFont=FZXBSK,% 鏂规灏忔爣瀹�
+      ItalicFont=FZKTK]% 鏂规妤蜂綋
+    \setCJKsansfont{FZXH1K}[% 鏂规缁嗛粦涓€
       Extension=.ttf,
-      AutoFakeBold=2.17]
-  \setCJKfamilyfont{zhfs}
-    {FZFSK}[Extension=.ttf]
-  \setCJKfamilyfont{zhkai}
-    {FZKTK}[Extension=.ttf]
-  % \setCJKfamilyfont{zhnewhei}
-  %   {FZYouHK_508R}[% 鏂规鎮犻粦508R
-  %     Extension=.ttf,
-  %     BoldFont=FZYouHK_511M]% 鏂规鎮犻粦511M
-  \defaultCJKfontfeatures{}
-}
+      BoldFont=FZHTK]% FZHTK 鏂规榛戜綋
+    \setCJKmonofont{FZFSK}[Extension=.ttf]% 鏂规浠垮畫
+    \setCJKfamilyfont{zhsong}
+      {FZSSK}[
+        Extension=.ttf,
+        BoldFont=FZXBSK]
+    \setCJKfamilyfont{zhhei}
+      {FZHTK}[
+        Extension=.ttf,
+        AutoFakeBold=2.17]
+    \setCJKfamilyfont{zhfs}
+      {FZFSK}[Extension=.ttf]
+    \setCJKfamilyfont{zhkai}
+      {FZKTK}[Extension=.ttf]
+    \defaultCJKfontfeatures{}
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1807,34 +1788,34 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 % 鎬濇簮瀛椾綋銆�
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_cjk_font_noto:
-{
-  % 鎬濇簮瀹嬩綋
-  \setCJKmainfont[
-    UprightFont=NotoSerifSC-Regular,
-    BoldFont=NotoSerifSC-Bold,
-    ItalicFont=NotoSerifSC-Regular,
-    BoldItalicFont=NotoSerifSC-Bold,
-    ItalicFeatures=FakeSlant,
-    BoldItalicFeatures=FakeSlant]{Noto~Serif~SC}
+  {
+    % 鎬濇簮瀹嬩綋
+    \setCJKmainfont[
+      UprightFont=NotoSerifSC-Regular,
+      BoldFont=NotoSerifSC-Bold,
+      ItalicFont=NotoSerifSC-Regular,
+      BoldItalicFont=NotoSerifSC-Bold,
+      ItalicFeatures=FakeSlant,
+      BoldItalicFeatures=FakeSlant]{Noto~Serif~SC}
 
-  % 鎬濇簮榛戜綋
-  \setCJKsansfont[
-    UprightFont=NotoSansSC-Regular,
-    BoldFont=NotoSansSC-Bold,
-    ItalicFont=NotoSansSC-Regular,
-    BoldItalicFont=NotoSansSC-Bold,
-    ItalicFeatures=FakeSlant,
-    BoldItalicFeatures=FakeSlant]{Noto~Sans~SC}
+    % 鎬濇簮榛戜綋
+    \setCJKsansfont[
+      UprightFont=NotoSansSC-Regular,
+      BoldFont=NotoSansSC-Bold,
+      ItalicFont=NotoSansSC-Regular,
+      BoldItalicFont=NotoSansSC-Bold,
+      ItalicFeatures=FakeSlant,
+      BoldItalicFeatures=FakeSlant]{Noto~Sans~SC}
 
-  \setCJKmonofont{FZFSK}[Extension=.ttf]% 鏂规浠垮畫
+    \setCJKmonofont{FZFSK}[Extension=.ttf]% 鏂规浠垮畫
 
-  \setCJKfamilyfont{zhsong}{Noto~Serif~SC}
-  \setCJKfamilyfont{zhhei}{Noto~Sans~SC}
-  \setCJKfamilyfont{zhfs}
-    {FZFSK}[Extension=.ttf]
-  \setCJKfamilyfont{zhkai}
-    {FZKTK}[Extension=.ttf]
-}
+    \setCJKfamilyfont{zhsong}{Noto~Serif~SC}
+    \setCJKfamilyfont{zhhei}{Noto~Sans~SC}
+    \setCJKfamilyfont{zhfs}
+      {FZFSK}[Extension=.ttf]
+    \setCJKfamilyfont{zhkai}
+      {FZKTK}[Extension=.ttf]
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1843,17 +1824,17 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 % 杞藉叆瀛椾綋鍛戒护銆�
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_load_font:
-{
-  \use:c { @@_load_latin_font_ \g_@@_latin_fontset_tl : }
-  \use:c { @@_load_cjk_font_   \g_@@_cjk_fontset_tl   : }
+  {
+    \use:c { @@_load_latin_font_ \g_@@_latin_fontset_tl : }
+    \use:c { @@_load_cjk_font_   \g_@@_cjk_fontset_tl   : }
 %    \end{macrocode}
 % 鑷瀹氫箟C\hologo{TeX}涓殑鍥涚被瀛椾綋鍛戒护銆�
 %    \begin{macrocode}
-  \NewDocumentCommand\songti{}{\CJKfamily{zhsong}}
-  \NewDocumentCommand\heiti{}{\CJKfamily{zhhei}}
-  \NewDocumentCommand\fangsong{}{\CJKfamily{zhfs}}
-  \NewDocumentCommand\kaishu{}{\CJKfamily{zhkai}}
-}
+    \NewDocumentCommand \songti   { } { \CJKfamily{zhsong} }
+    \NewDocumentCommand \heiti    { } { \CJKfamily{zhhei}  }
+    \NewDocumentCommand \fangsong { } { \CJKfamily{zhfs}   }
+    \NewDocumentCommand \kaishu   { } { \CJKfamily{zhkai}  }
+  }
 %    \end{macrocode}
 %
 % 杞藉叆璁剧疆鐨勫瓧浣撱€�
@@ -1933,8 +1914,7 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
   {
     \cleardoublepage
     \int_compare:nTF { \g_@@_info_degree_int == 1 } 
-    { \pagestyle{plain} }
-    { \pagestyle{headings} }
+      { \pagestyle{plain} } { \pagestyle{headings} }
     \pagenumbering{arabic}
     \normalfont\normalsize
   }
@@ -2003,7 +1983,7 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
     \group_begin:
       \ctexset{
         chapter/format = {\centering\songti\bf\zihao{3}\selectfont},
-      }%
+      }
       \chapter*{\listfigurename}
     \group_end:
     \addcontentsline{toc}{chapter}{\listfigurename}
@@ -2149,21 +2129,21 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 % \changes{v0.11}{2021/10/01}{鍐欏叆PDF鍏冩暟鎹€倉
 %    \begin{macrocode}
 \ctex_at_end_preamble:n
-{
-  \hypersetup
-    {
-      bookmarksnumbered = true,
-      psdextra          = true,
-      unicode           = true,
+  {
+    \hypersetup
+      {
+        bookmarksnumbered = true,
+        psdextra          = true,
+        unicode           = true,
 %    \end{macrocode}
 % 濉啓 PDF 鍏冧俊鎭€�
 %    \begin{macrocode}
-      pdftitle    = \l_@@_info_title_tl,
-      pdfauthor   = \l_@@_info_author_tl,
-      pdfkeywords = \l_@@_info_keywords_clist,
-      pdfcreator  = \c_@@_name_pdf_creator_tl
-    }
-}
+        pdftitle    = \l_@@_info_title_tl,
+        pdfauthor   = \l_@@_info_author_tl,
+        pdfkeywords = \l_@@_info_keywords_clist,
+        pdfcreator  = \c_@@_name_pdf_creator_tl
+      }
+  }
 %    \end{macrocode}
 %
 %
@@ -2228,17 +2208,6 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 	xleftmargin=2em,xrightmargin=2em,% set the width of the code environment
 }
 %    \end{macrocode}
-%
-% 
-%    \begin{macrocode}
-\lstdefinestyle{LaTeX}{
-  language=TeX,
-  morekeywords={
-    begin, caption, label, mathrm, frac, 
-    toprule, midrule, bottomrule, includegraphics}
-}
-%    \end{macrocode}
-%
 % 
 % \subsubsection{鍒楄〃}
 % 
@@ -2246,7 +2215,6 @@ keywords*        .clist_set:N = \l_@@_info_keywords_en_clist,
 %    \begin{macrocode}
 \renewcommand{\labelitemi}{\tiny$\blacktriangleright$}
 \renewcommand{\labelitemii}{\textbullet}
-
 \setlist[itemize]{noitemsep}
 \setlist[enumerate]{noitemsep}
 \setlist[description]{noitemsep}
diff --git a/test/chapters/FigTabCode.tex b/test/chapters/FigTabCode.tex
index 1e394db..0fd5d7f 100644
--- a/test/chapters/FigTabCode.tex
+++ b/test/chapters/FigTabCode.tex
@@ -2,7 +2,6 @@
 
 \section{鍥剧墖绀轰緥}
 
-鎵€鏈夊浘鐗囬粯璁ゅ瓨鏀惧湪涓荤洰褰曚笅鐨刓texttt{figure/}鏂囦欢澶瑰唴
 
 % \begin{figure}[htbp]
 %     % \includegraphics[width=0.5\textwidth]{njuname}
@@ -11,7 +10,7 @@
 %     \label{fig:njuname}
 % \end{figure}
 % 浣犲彲浠ヤ娇鐢╘lstinline|figure|鐜鎻掑叆鍥剧墖锛屽\cref{fig:njuname}锛屼唬鐮佸涓�:
-% \begin{lstlisting}[style=LaTeX]
+% \begin{lstlisting}
 % \begin{figure}
 %     % \includegraphics[width=0.5\textwidth]{njuname}
 %     \resizebox{0.5\textwidth}{!}{\input{njuname.tikz}}
@@ -70,23 +69,6 @@
     \end{tabular}
 \end{table}
 浣犲彲浠ヤ娇鐢╘lstinline|table|鐜鎻掑叆鏍囧噯涓夌嚎琛紝濡俓cref{tab:testtab}鎵€绀猴紝浠g爜濡備笅:
-\begin{lstlisting}[style=LaTeX]
-\begin{table}[htbp]
-    \caption{缁忚繃娴嬭瘯鐨勭幆澧儅
-    \begin{tabular}{ccc}
-        \toprule
-        OS & TeX & 娴嬭瘯鎯呭喌 \\
-        \midrule
-        Windows 10 & TeXLive 2021 & 鈭� \\
-        Windows 10 & MiKTeX & 鈭� \\
-        Windows 10 & TeXLive 2020 & 脳 \\
-        Ubuntu 20.04 & TeXLive 2021 & 鈭� \\
-        鍗楀ぇTeX & Overleaf & 鈭� \\
-        \bottomrule
-    \end{tabular}
-\end{table}}
-\end{lstlisting}
-
 
 
 \section{浠g爜绀轰緥}
diff --git a/test/chapters/Mathematics.tex b/test/chapters/Mathematics.tex
index 732644e..97d1f2f 100644
--- a/test/chapters/Mathematics.tex
+++ b/test/chapters/Mathematics.tex
@@ -28,8 +28,8 @@ Math bold italic letters: $\mathbi{A}$
   \end{dcases}
 \end{equation}
 
-浣犲彲浠ヤ娇鐢╘lstinline|equation|鐜鎻掑叆鍏紡锛屽\cref{eq:dewitt}锛屼唬鐮佸涓�:
-\begin{lstlisting}[style=LaTeX]
+浣犲彲浠ヤ娇鐢╘verb|equation|鐜鎻掑叆鍏紡锛屽\cref{eq:dewitt}锛屼唬鐮佸涓�:
+\begin{lstlisting}
 \begin{equation}
     \int \mathrm{e}^{ax} \tanh {bx} \, \mathrm{d}x =
     \begin{dcases}
@@ -44,13 +44,6 @@ Math bold italic letters: $\mathbi{A}$
 \end{equation}
 \end{lstlisting}
 
-浣跨敤mathtools鍖呬細涓巙nicode-math鍖呬骇鐢熶竴浜涘懡浠ょ殑鍐茬獊锛岀洿鎺ュ紩鐢ㄤ細杈撳嚭浠ヤ笅涓ゆ潯璀﹀憡
-\begin{lstlisting}
-Using \overbracket and \underbracket from `mathtools' package. Use \Uoverbracket and \Uunderbracket for original `unicode-math' definition.
-I'm going to overwrite the following commands from the `mathtools' package: \dblcolon, \coloneqq, \Coloneqq, \eqqcolon.
-\end{lstlisting}
-杩欎簺璀﹀憡宸茶鎵嬪姩鎶戝埗銆�
-
 \section{瀹氱悊鐜}
 
 \begin{proof}
-- 
GitLab