diff --git a/docs/njuthesis-sample.tex b/docs/njuthesis-sample.tex index a5a368cca4b4c89a81bcd96e69954ea64e9eb4e0..a594fb42b301bb428d3ae00cf84e79d5a0c99036 100644 --- a/docs/njuthesis-sample.tex +++ b/docs/njuthesis-sample.tex @@ -32,8 +32,8 @@ % type = thesis|design, % 鏂囨。绫诲瀷锛岄粯璁や负姣曚笟璁烘枃 % nlcover = true|false, % 鏄惁闇€瑕佸浗瀹跺浘涔﹂灏侀潰锛岄粯璁ゅ叧闂� % 浠ヤ笅涓ら」涓哄瓧浣撹缃紝涓嶆敼鍔ㄥ垯鑷姩璋冪敤绯荤粺棰勮瀛椾綋 - % customlatinfont=windows|macos|linux|gyre|none, - % customchinesefont=windows|macos|linux|fandol|founder|noto|none, + % latin-font=win|mac|linux|gyre|none, + % cjk-font=win|mac|linux|fandol|founder|noto|none, ]{njuthesis} \njusetup { diff --git a/source/njuthesis.dtx b/source/njuthesis.dtx index 08e528586340ae164a65fd201997d9fca6339ff1..d9e9bcd60c60bd333bd15cd20dd6a055fec90d38 100644 --- a/source/njuthesis.dtx +++ b/source/njuthesis.dtx @@ -197,7 +197,7 @@ through XeTeX. % \changes{v0.12}{2021/11/29}{鏇存柊浜嗚鏄庢枃妗e皝闈㈣璁°€倉 % \changes{v0.12}{2021/11/30}{鍖哄垎娴嬭瘯鏂囦欢鍜岀┖鐧芥ā鏉裤€倉 % \changes{v0.12}{2021/12/06}{淇敼浜嗚鏄庢枃妗g殑浠g爜鍛堢幇鏍峰紡銆倉 -% \changes{v0.13}{2021/12/12}{鏄捐憲鎻愬崌缂栬瘧閫熷害銆倉 +% \changes{v0.13}{2021/12/12}{浼樺寲浜嗙紪璇戦€熷害銆倉 % % \maketitle % @@ -599,10 +599,10 @@ through XeTeX. % % 濡傛灉甯屾湜鏇存敼鏈ā鏉夸娇鐢ㄧ殑瀛椾綋锛岃濉啓浠ヤ笅涓や釜閫夐」浠ヨ鐩栨搷浣滅郴缁熸娴嬪緱鍒扮殑璁剧疆銆� % -% \begin{function}[added=2021-09-07]{customchinesefont,customlatinfont} +% \begin{function}[added=2021-09-07,updated=2021-12-12]{cjk-font,latin-font} % \begin{syntax} -% customchinesefont = <(windows)|macos|fandol|founder|noto|none> -% customlatinfont = <(windows)|macos|gyre|none> +% cjk-font = <(win)|mac|fandol|founder|noto|none> +% latin-font = <(win)|mac|gyre|none> % \end{syntax} % 鎵嬪姩鎸囧畾瀛椾綋銆� % \end{function} @@ -1377,18 +1377,18 @@ through XeTeX. % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_load_system_fontset_bool} +% \begin{variable}{\g_@@_load_sys_font_bool} % 瀹氫箟鐢ㄤ簬鍒ゆ柇鏄惁闇€瑕佽浇鍏ョ郴缁熼瑁呭瓧浣撶殑鍙橀噺銆� % \begin{macrocode} -\bool_new:N \g_@@_load_system_fontset_bool +\bool_new:N \g_@@_load_sys_font_bool % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_latin_fontset_tl,\g_@@_cjk_fontset_tl} +% \begin{variable}{\g_@@_latin_font_tl,\g_@@_cjk_font_tl} % 鐢ㄤ簬瀛樺偍鎵€浣跨敤瀛椾綋鍚嶇О鐨勫叏灞€鍙橀噺 % \begin{macrocode} -\tl_new:N \g_@@_latin_fontset_tl -\tl_new:N \g_@@_cjk_fontset_tl +\tl_new:N \g_@@_latin_font_tl +\tl_new:N \g_@@_cjk_font_tl % \end{macrocode} % \end{variable} % @@ -1619,7 +1619,7 @@ through XeTeX. % \begin{macro}{degree} % 瀛︿綅绫诲瀷銆� % \begin{macrocode} - degree .choices:nn = { ug, mg, mf, phd } + degree .choices:nn = { ug, mg, mf, phd } { \int_set_eq:NN \g_@@_info_degree_int \l_keys_choice_int \tl_set:Nn \l_@@_info_degree_tl { \clist_item:Nn \c_@@_name_degree_clist { \g_@@_info_degree_int } } @@ -1629,20 +1629,20 @@ through XeTeX. \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, + degree .initial:n = ug, % \end{macrocode} % \end{macro} % % \begin{macro}{type} % 璁烘枃绫诲瀷銆俓cs{l_keys_choice_int} 闇€瑕佽灞曞紑浠ヨ幏鍙栨纭殑搴忓彿銆� % \begin{macrocode} - type .choices:nn = { thesis, design } + type .choices:nn = { thesis, design } { \int_set_eq:NN \l_@@_info_type_int \l_keys_choice_int \tl_set:Nn \l_@@_info_type_tl { \clist_item:Nn \c_@@_name_type_clist { \l_@@_info_type_int } } \tl_put_left:Nn \l_@@_info_type_tl { \tl_use:c { c_@@_name_ \g_@@_info_diploma_tl _tl } } }, - type .initial:n = thesis, + type .initial:n = thesis, % \end{macrocode} % \end{macro} % @@ -1654,15 +1654,16 @@ through XeTeX. % \end{macrocode} % \end{macro} % -% \begin{macro}{customlatinfont,customchinesefont} +% \begin{macro}{latin-font,cjk-font} +% \changes{v0.13}{2021/12/12}{绠€鍖栧瓧浣撻€夐」鍚嶇О銆倉 % 瀹氫箟瀛椾綋閫夐」 % \begin{macrocode} - customlatinfont .choices:nn = - { gyre, macos, windows, none } - { \tl_set_eq:NN \g_@@_latin_fontset_tl \l_keys_choice_tl }, - customchinesefont .choices:nn = - { fandol, founder, macos, noto, windows, none } - { \tl_set_eq:NN \g_@@_cjk_fontset_tl \l_keys_choice_tl }, + latin-font .choices:nn = + { gyre, mac, win, none } + { \tl_set_eq:NN \g_@@_latin_font_tl \l_keys_choice_tl }, + cjk-font .choices:nn = + { fandol, founder, mac, noto, win, none } + { \tl_set_eq:NN \g_@@_cjk_font_tl \l_keys_choice_tl }, } % \end{macrocode} % \end{macro} @@ -2050,7 +2051,7 @@ through XeTeX. % \begin{macrocode} \sys_if_engine_luatex:T { - \RequirePackage{lua-ul,dashundergaps} + \RequirePackage{lua-ul} \NewDocumentCommand \njuline { m } { \underLine{#1} \null } } % \end{macrocode} @@ -2091,11 +2092,11 @@ through XeTeX. % 鍒ゆ柇鐢ㄦ埛鏄惁鑷畾涔変簡涓嫳鏂囧瓧浣撱€傚鏋滃叾涓换鎰忎竴绉嶆湭琚畾涔夛紝 % 鍒欎娇鐢ㄧ郴缁熼瑁呭瓧浣撹鐩栧瓧浣撻€夐」銆� % \begin{macrocode} -\tl_if_empty:NTF \g_@@_latin_fontset_tl - { \bool_gset_true:N \g_@@_load_system_fontset_bool } +\tl_if_empty:NTF \g_@@_latin_font_tl + { \bool_gset_true:N \g_@@_load_sys_font_bool } { - \tl_if_empty:NT \g_@@_cjk_fontset_tl - { \bool_gset_true:N \g_@@_load_system_fontset_bool } + \tl_if_empty:NT \g_@@_cjk_font_tl + { \bool_gset_true:N \g_@@_load_sys_font_bool } } % \end{macrocode} % @@ -2104,16 +2105,16 @@ through XeTeX. % 妫€娴� macOS 鐨勫懡浠ょ敱\pkg{ctex}鎻愪緵锛� % 杩欎袱绉嶆儏鍐靛鐨勭郴缁熻鍒ゆ柇涓� Linux锛屼竴寰嬩娇鐢ㄨ嚜鐢卞瓧浣撱€� % \begin{macrocode} -\bool_if:NT \g_@@_load_system_fontset_bool +\bool_if:NT \g_@@_load_sys_font_bool { \sys_if_platform_windows:TF - { \tl_set:Nn \g_@@_latin_fontset_tl { windows } - \tl_set:Nn \g_@@_cjk_fontset_tl { windows } } + { \tl_set:Nn \g_@@_latin_font_tl { win } + \tl_set:Nn \g_@@_cjk_font_tl { win } } { \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 } } } + { \tl_set:Nn \g_@@_latin_font_tl { mac } + \tl_set:Nn \g_@@_cjk_font_tl { mac } } + { \tl_set:Nn \g_@@_latin_font_tl { gyre } + \tl_set:Nn \g_@@_cjk_font_tl { fandol } } } } % \end{macrocode} % @@ -2122,10 +2123,10 @@ through XeTeX. % % 鎺ヤ笅鏉ラ€愪釜瀹氫箟鎵€闇€瑕佷娇鐢ㄧ殑瀛楀簱銆� % -% \begin{macro}{\@@_load_latin_font_windows:} +% \begin{macro}{\@@_load_latin_font_win:} % Windows 瑗挎枃瀛椾綋 % \begin{macrocode} -\cs_new_protected:Npn \@@_load_latin_font_windows: +\cs_new_protected:Npn \@@_load_latin_font_win: { \setmainfont{Times~New~Roman} \setsansfont{Arial} @@ -2134,10 +2135,10 @@ through XeTeX. % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_load_latin_font_macos:} +% \begin{macro}{\@@_load_latin_font_mac:} % macOS 瑗挎枃瀛椾綋銆� % \begin{macrocode} -\cs_new_protected:Npn \@@_load_latin_font_macos: +\cs_new_protected:Npn \@@_load_latin_font_mac: { \setmainfont{Times~New~Roman} \setsansfont{Arial} @@ -2177,10 +2178,10 @@ through XeTeX. % % \subsubsection{瀹氫箟涓枃瀛楀簱} % -% \begin{macro}{\@@_load_cjk_font_windows:} +% \begin{macro}{\@@_load_cjk_font_win:} % Windows 涓枃瀛椾綋銆� % \begin{macrocode} -\cs_new_protected:Npn \@@_load_cjk_font_windows: +\cs_new_protected:Npn \@@_load_cjk_font_win: { \setCJKmainfont{SimSun}[ AutoFakeBold=2.17, @@ -2196,11 +2197,11 @@ through XeTeX. % \end{macro} % % -% \begin{macro}{\@@_load_cjk_font_macos:} +% \begin{macro}{\@@_load_cjk_font_mac:} % macOS 瀛椾綋銆� % TODO: 淇 macOS 瀛椾綋鏀寔锛屽疄鐜板紑绠卞嵆鐢ㄣ€� % \begin{macrocode} -\cs_new_protected:Npn \@@_load_cjk_font_macos: +\cs_new_protected:Npn \@@_load_cjk_font_mac: { % 绉婚櫎 does not contain script "CJK" 璀﹀憡 \msg_redirect_name:nnn {fontspec} {no-script} {info} @@ -2327,8 +2328,8 @@ through XeTeX. % \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_font_tl : } + \use:c { @@_load_cjk_font_ \g_@@_cjk_font_tl : } % \end{macrocode} % 鑷瀹氫箟C\hologo{TeX}涓殑鍥涚被瀛椾綋鍛戒护銆� % \begin{macrocode} @@ -3115,8 +3116,8 @@ through XeTeX. \c_@@_orig_decl_text_tl \vfil \begin{flushright} - { \c_@@_name_orig_sign_tl } \@@_uline:n { 7 em } \@@_vskip: - { \c_@@_name_orig_date_tl } \@@_uline:n { 7 em } + \@@_name:n { orig_sign } \@@_uline:n { 7 em } \@@_vskip: + \@@_name:n { orig_date } \@@_uline:n { 7 em } \end{flushright} \vfil } @@ -3310,7 +3311,8 @@ through XeTeX. % \begin{macrocode} { \@@_full_uline:NV \l_@@_tmp_dim - { \clist_item:cn { c_@@_name_type #1 _clist } { \l_@@_info_type_int } # 2 } + { \clist_item:cn { c_@@_name_type #1 _clist } + { \l_@@_info_type_int } # 2 } \@@_ulined_center_box:nn { \l_@@_tmp_dim } { \tl_range:Nnn \l_@@_info_title_en_tl { 1 } { 40 } } \\ \@@_uline:n { \textwidth } \@@_qquad: