diff --git a/njuthesis.cls b/njuthesis.cls index 1b0c306d65c997cc872bdcd89ec3e6cbabbbe48b..8a847e43fdf85ba36a54b5d07d48782ec89a72ec 100644 --- a/njuthesis.cls +++ b/njuthesis.cls @@ -1,12 +1,12 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{njuthesis} +\ProvidesClass{njuthesis}[2021/09/10 NJU Thesis Undergraduate LaTeX Template] \RequirePackage{kvoptions} \SetupKeyvalOptions{ family=njuthesis, - prefix=,% 鏁呮剰鐣欑┖闃叉鍑虹幇澶ч噺@锛屼絾浼拌瑕佸彂甯僀TAN杩樺緱鍔犲洖鍘� + prefix=nju@,% 鏁呮剰鐣欑┖闃叉鍑虹幇澶ч噺@锛屼絾浼拌瑕佸彂甯僀TAN杩樺緱鍔犲洖nju@銆� setkeys=\kvsetkeys } @@ -20,12 +20,12 @@ zihao=-4 ]{ctexbook}[2018/04/01] -\DeclareStringOption[1]{TitleLength} -\DeclareStringOption[UG]{Degree} -\DeclareStringOption[thesis]{Type} -\DeclareBoolOption[true]{UseSysFont} -\DeclareStringOption[windows]{CustomEnFont} -\DeclareStringOption[windows]{CustomZhFont} +\DeclareStringOption[1]{titlelength} +\DeclareStringOption[UG]{degree} +\DeclareStringOption[thesis]{type} +\DeclareBoolOption[true]{systemfont} +\DeclareStringOption[windows]{customlatinfont} +\DeclareStringOption[windows]{customchinesefont} \ProcessKeyvalOptions*\relax diff --git a/njuthesis.tex b/njuthesis.tex index 64dc5b8d690b07050993b4d8852ff701dbff7e32..83718ee8240772ea47802e16b6af76ad77db2402 100644 --- a/njuthesis.tex +++ b/njuthesis.tex @@ -1,7 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NJU Thesis Undergraduate % 鍗椾含澶у鏈鐢熸瘯涓氳鏂嘗aTeX妯℃澘 -% Version 0.4.0 (2021-09-10) +% Version 0.4.1 (2021-09-10) % % 璇峰叧娉ㄩ」鐩湴鍧€浠ヨ幏鍙栨渶鏂板彉鍖� % https://github.com/nju-lug/NJUThesisUndergraduate @@ -16,12 +16,12 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[ - TitleLength=2,% 閫夋嫨鏍囬琛屾暟锛岃寖鍥存槸1~3 - Degree=UG,% UG: 鏈 - Type=thesis,% thesis: 姣曚笟璁烘枃锛宒esign: 姣曚笟璁捐 - % UseSysFont=false,% 鑷畾涔夊瓧浣撹鍙嶆敞閲婃椤� - % CustomEnFont=windows,% 璁剧疆鑻辨枃瀛楃闆� - % CustomZhFont=windows,% 璁剧疆涓枃瀛楃闆� + titlelength=2,% 閫夋嫨鏍囬琛屾暟锛岃寖鍥存槸1~3 + % degree=UG,% UG: 鏈 + type=thesis,% thesis: 姣曚笟璁烘枃锛宒esign: 姣曚笟璁捐 + systemfont=false,% 鑷畾涔夊瓧浣撹鍙嶆敞閲婃椤� + customlatinfont=windows,% 璁剧疆鑻辨枃瀛楃闆� + customchinesefont=windows,% 璁剧疆涓枃瀛楃闆� ]{njuthesis} % 杈撳叆涓汉淇℃伅 diff --git a/profile/cover.sty b/profile/cover.sty index 7e1d4021f08d80d57efa94220e1cb7fe68e6f485..424c178f076e6503aa583f87ac9ebb5c33f10213 100644 --- a/profile/cover.sty +++ b/profile/cover.sty @@ -41,7 +41,7 @@ \coverbox:n {涓揬hfill 涓殅 & \cover_underline:nn {250pt}{\songti\Major}\\ - \int_case:nn {\TitleLength} + \int_case:nn {\nju@titlelength} { { 1 } { \coverbox:n {棰榎hfill 鐩畗 @@ -91,10 +91,10 @@ } % 鍒ゆ柇绫诲瀷 -\str_if_eq:eeTF {\Degree} {UG} +\str_if_eq:eeTF {\nju@degree} {UG} {\tl_const:Nn \Degreename {鏈琝hfill 绉慭hfill }}{} -\str_if_eq:eeTF {\Type} {thesis} +\str_if_eq:eeTF {\nju@type} {thesis} {\tl_const:Nn \typename {\Degreename 姣昞hfill 涓歕hfill 璁篭hfill 鏂噠} {\tl_const:Nn \typename {\Degreename 姣昞hfill 涓歕hfill 璁綷hfill 璁} diff --git a/profile/font.sty b/profile/font.sty index 8836a08c61087bf52a6f1b435d7c16d70f3e2d93..6e1751ee952e27703c9412d412b38ab670e967ef 100644 --- a/profile/font.sty +++ b/profile/font.sty @@ -152,7 +152,7 @@ } % 鏍规嵁鎿嶄綔绯荤粺閫夋嫨鐩稿簲瀛椾綋 -\ifUseSysFont +\ifnju@systemfont % 妫€娴嬫槸鍚︽槸 Windows \sys_if_platform_windows:TF { @@ -173,29 +173,22 @@ } } \else% 濡傛灉鐢ㄦ埛闇€瑕佽嚜瀹氫箟 -% tl_case:Nn 鍙兘瀹炵幇瀹忓拰瀹忎箣闂寸殑姣旇緝锛屼笉鑳界洿鎺ュ疄鐜板瓧绗︿覆鍜屽畯鐨勬瘮杈冿紝鏃犲鍑烘涓嬬瓥锛屽笇鏈涗箣鍚庤兘鎵惧埌鏇翠紭闆呯殑鍐欐硶 -\tl_const:Nn \usingwindows {windows} -\tl_const:Nn \usingmacos {macos} -\tl_const:Nn \usingfandol {fandol} -\tl_const:Nn \usinggyre {gyre} -\tl_const:Nn \usingfounder {founder} -\tl_const:Nn \usingnoto {noto} -\tl_const:Nn \usingnull {null} -\tl_case:Nn {\CustomEnFont} +% 姝ゅ闇€瑕佷娇鐢╘str_case_e鑰屼笉鏄痋str_case浣垮畯灞曞紑涓哄瓧绗︿覆 +\str_case_e:nn { \nju@customlatinfont } { - \usingwindows{\set_latin_fontset_windows} - \usingmacos{\set_latin_fontset_macos} - \usinggyre{\set_latin_fontset_gyre} - \usingnull{} + { windows } { \set_latin_fontset_windows } + { macos} { \set_latin_fontset_macos } + { gyre } { \set_latin_fontset_gyre } + { null } {} } -\tl_case:Nn {\CustomZhFont} +\str_case_e:nn { \nju@customchinesefont } { - \usingwindows{\set_chinese_fontset_windows} - \usingmacos{\set_chinese_fontset_macos} - \usingfandol{\set_chinese_fontset_fandol} - \usingfounder{\set_chinese_fontset_founder}% 浣跨敤鏂规瀛椾綋 - \usingnoto{\set_chinese_fontset_noto}% 浣跨敤鎬濇簮瀹嬩綋+鎬濇簮榛戜綋 - \usingnull{} + { windows } { \set_chinese_fontset_windows } + { macos} { \set_chinese_fontset_macos } + { gyre } { \set_chinese_fontset_gyre } + { founder } { \set_chinese_fontset_founder } + { noto } { \set_chinese_fontset_noto } + { null } {} } \fi % 鎴戞槸 Linux 鐢ㄦ埛锛屼絾鎴戠敤 Windows 瀛椾綋锛堣鎮ㄨ刀蹇潗鍒颁富甯彴涓婃潵锛�