diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls | 1530 |
1 files changed, 1090 insertions, 440 deletions
diff --git a/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls b/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls index ea7170ad6d1..ef40653f444 100644 --- a/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls +++ b/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls @@ -8,22 +8,22 @@ %% %% This is a generated file. %% -%% Copyright (C) 2005-2020 by Ruini Xue <xueruini@gmail.com> +%% Copyright (C) 2005-2021 by Tsinghua University TUNA Association <tuna@tsinghua.edu.cn> %% %% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 +%% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. %% %% To produce the documentation run the original source files ending with `.dtx' %% through LaTeX. %% \NeedsTeXFormat{LaTeX2e}[2017/04/15] \ProvidesClass{thuthesis} -[2020/10/14 7.1.0 Tsinghua University Thesis Template] +[2021/03/12 7.2.0 Tsinghua University Thesis Template] \newcommand\thu@error[1]{% \ClassError{thuthesis}{#1}{}% } @@ -56,7 +56,7 @@ } \hyphenation{Thu-Thesis} \def\thuthesis{ThuThesis} -\def\version{7.1.0} +\def\version{7.2.0} \RequirePackage{kvdefinekeys} \RequirePackage{kvsetkeys} \RequirePackage{kvoptions} @@ -64,8 +64,12 @@ family=thu, prefix=thu@, setkeys=\kvsetkeys} +\let\thu@setup@hook\@empty \newcommand\thusetup[1]{% + \let\thu@setup@hook\@empty \kvsetkeys{thu}{#1}% + \thu@setup@hook + \thu@setup@hook } \newcommand\thu@define@key[1]{% \kvsetkeys{thu@key}{#1}% @@ -121,6 +125,14 @@ \expandafter\g@addto@macro\csname thu@#1@@code\endcsname{#2}% } \thu@define@key{ + thesis-type = { + name = thesis@type, + choices = { + thesis, + proposal, + }, + default = thesis, + }, degree = { choices = { bachelor, @@ -150,33 +162,37 @@ english, }, }, + system = { + choices = { + auto, + mac, + unix, + windows, + }, + default = auto, + }, fontset = { choices = { + auto, windows, mac, ubuntu, fandol, none, }, - default = none, - }, - system = { - choices = { - mac, - unix, - windows, - auto, - }, default = auto, }, font = { choices = { + auto, times, termes, + stix, xits, libertinus, + newcm, lm, - auto, + newtx, none, }, default = auto, @@ -184,11 +200,11 @@ cjk-font = { name = cjk@font, choices = { + auto, windows, mac, noto, fandol, - auto, none, }, default = auto, @@ -196,13 +212,65 @@ math-font = { name = math@font, choices = { + auto, xits, stix, libertinus, + newcm, lm, + newtx, none, }, - default = xits, + default = auto, + }, + math-style = { + name = math@style, + choices = { + GB, + ISO, + TeX, + }, + }, + uppercase-greek = { + name = uppercase@greek, + choices = { + italic, + upright, + }, + }, + less-than-or-equal = { + name = leq, + choices = { + slanted, + horizontal, + }, + }, + integral = { + choices = { + upright, + slanted, + }, + }, + integral-limits = { + name = integral@limits, + choices = { + true, + false, + }, + }, + partial = { + choices = { + upright, + italic, + }, + }, + math-ellipsis = { + name = math@ellipsis, + choices = { + centered, + lower, + AMS, + }, }, output = { choices = { @@ -236,7 +304,7 @@ \else \PassOptionsToClass{openany}{book} \fi -\PassOptionsToPackage{quiet}{fontspec} +\PassOptionsToPackage{no-math}{fontspec} \LoadClass[a4paper,UTF8,zihao=-4,scheme=plain,fontset=none]{ctexbook}[2017/04/01] \RequirePackage{etoolbox} \RequirePackage{filehook} @@ -246,7 +314,6 @@ \RequirePackage{titletoc} \RequirePackage{notoccite} \RequirePackage{amsmath} -\RequirePackage{unicode-math} \RequirePackage{graphicx} \RequirePackage[labelformat=simple]{subcaption} \RequirePackage{pdfpages} @@ -276,11 +343,23 @@ \RequirePackage{bibunits} } } -\newcommand\thu@package@conflict[2]{ - \AtBeginOfPackageFile*{#2}{ - \thu@error{The "#2" package is incompatible with required "#1"} +\newcommand\thu@package@conflict[2]{% + \AtEndOfPackageFile*{#1}{% + \AtBeginOfPackageFile*{#2}{% + \thu@error{The "#2" package is incompatible with "#1"}% + }% + }% } -} +\thu@package@conflict{biblatex}{bibunits} +\thu@package@conflict{biblatex}{chapterbib} +\thu@package@conflict{biblatex}{cite} +\thu@package@conflict{biblatex}{multibib} +\thu@package@conflict{biblatex}{natbib} + +\thu@package@conflict{bibunits}{biblatex} +\thu@package@conflict{bibunits}{chapterbib} +\thu@package@conflict{bibunits}{multibib} + \thu@package@conflict{unicode-math}{amscd} \thu@package@conflict{unicode-math}{amsfonts} \thu@package@conflict{unicode-math}{amssymb} @@ -289,6 +368,16 @@ \thu@package@conflict{unicode-math}{eucal} \thu@package@conflict{unicode-math}{eufrak} \thu@package@conflict{unicode-math}{mathrsfs} +\thu@package@conflict{unicode-math}{newtxmath} +\thu@package@conflict{unicode-math}{upgreek} + +\thu@package@conflict{natbib}{biblatex} +\thu@package@conflict{natbib}{cite} + +\thu@package@conflict{newtxmath}{amsfonts} +\thu@package@conflict{newtxmath}{amssymb} +\thu@package@conflict{newtxmath}{unicode-math} +\thu@package@conflict{newtxmath}{upgreek} \geometry{ paper = a4paper, % 210 * 297mm marginparwidth = 2cm, @@ -327,68 +416,156 @@ \thu@set@geometry \thu@option@hook{degree}{\thu@set@geometry} \thu@option@hook{output}{\thu@set@geometry} -\def\cleardoublepage{% - \clearpage - \if@twoside - \ifthu@output@print - \ifodd\c@page +\thusetup{main-language=\thu@language}% +\let\thu@main@language\thu@language +\thu@option@hook{language}{% + \ifx\@begindocumenthook\@undefined\else + \thusetup{main-language=\thu@language}% + \let\thu@main@language\thu@language + \fi +} +\newcommand\thu@reset@main@language{% + \thusetup{language = \thu@main@language}% + \let\thu@language\thu@main@language +} +\newcommand\thu@set@chapter@names{% + \ifthu@main@language@chinese + \def\thu@comments@name{指导教师学术评语}% + \def\bibname{参考文献}% + \def\appendixname{附录}% + \def\indexname{索引}% + \def\thu@resolution@name{答辩委员会决议书}% + \ifthu@degree@bachelor + \def\contentsname{目\qquad 录}% + \def\listfigurename{插图索引}% + \def\listtablename{表格索引}% + \def\thu@list@figure@table@name{插图和附表索引}% + \def\thu@list@algorithm@name{算法索引}% + \def\thu@acknowledgements@name{致\qquad 谢}% + \def\listequationname{公式索引}% + \def\thu@denotation@name{主要符号对照表}% + \def\thu@resume@name{在学期间参加课题的研究成果}% + \else + \def\listfigurename{插图清单}% + \def\listtablename{附表清单}% + \def\thu@list@figure@table@name{插图和附表清单}% + \def\thu@list@algorithm@name{算法清单}% + \def\listequationname{公式清单}% + \def\thu@acknowledgements@name{致\quad 谢}% + \ifthu@degree@graduate + \def\contentsname{目\quad 录}% + \def\thu@denotation@name{符号和缩略语说明}% + \def\thu@resume@name{个人简历、在学期间完成的相关学术成果}% + \else % degree = postdoc + \def\contentsname{目\qquad 次}% + \def\thu@denotation@name{符号表}% + \def\thu@resume@name{个人简历、发表的学术论文与科研成果}% + \fi + \fi + \else + \ifthu@main@language@english + \def\thu@comments@name{Comments from Thesis Supervisor}% + \def\thu@resolution@name{Resolution of Thesis Defense Committee}% + \def\indexname{Index}% + \ifthu@degree@bachelor + \def\contentsname{CONTENTS}% + \def\listfigurename{FIGURES}% + \def\listtablename{TABLES}% + \def\thu@list@figure@table@name{FIGURES AND TABLES}% + \def\thu@list@algorithm@name{ALGORITHMS}% + \def\listequationname{EQUATIONS}% + \def\thu@denotation@name{ABBREVIATIONS}% + \def\bibname{REFERENCES}% + \def\appendixname{APPENDIX}% + \def\thu@acknowledgements@name{ACKNOWLEDGEMENTS}% + \def\thu@resume@name{PUBLICATIONS}% \else - \thispagestyle{empty}% - \hbox{}% - \newpage - \if@twocolumn - \hbox{}\newpage - \fi + \def\contentsname{Table of Contents}% + \def\listfigurename{List of Figures}% + \def\listtablename{List of Tables}% + \def\thu@list@figure@table@name{List of Figures and Tables}% + \def\thu@list@algorithm@name{List of Algorithms}% + \def\listequationname{List of Equations}% + \def\thu@denotation@name{List of Symbols and Acronyms}% + \def\bibname{References}% + \def\appendixname{Appendix}% + \def\thu@acknowledgements@name{Acknowledgements}% + \def\thu@resume@name{Resume}% \fi \fi \fi } -\renewcommand\frontmatter{% - \cleardoublepage - \@mainmatterfalse - \pagenumbering{Roman}% -} -\renewcommand\mainmatter{% - \cleardoublepage - \@mainmattertrue - \pagenumbering{arabic}% -} -\renewcommand\backmatter{% - \if@openright - \cleardoublepage +\thu@set@chapter@names +\thu@option@hook{degree}{\thu@set@chapter@names} +\thu@option@hook{main-language}{\thu@set@chapter@names} +\newcommand\thu@set@names{% + \ifthu@language@chinese + \ctexset{ + figurename = 图, + tablename = 表, + }% + \def\thu@algorithm@name{算法}% + \def\thu@equation@name{公式}% + \def\thu@assumption@name{假设}% + \def\thu@definition@name{定义}% + \def\thu@proposition@name{命题}% + \def\thu@lemma@name{引理}% + \def\thu@theorem@name{定理}% + \def\thu@axiom@name{公理}% + \def\thu@corollary@name{推论}% + \def\thu@exercise@name{练习}% + \def\thu@example@name{例}% + \def\thu@remark@name{注释}% + \def\thu@problem@name{问题}% + \def\thu@conjecture@name{猜想}% + \def\thu@proof@name{证明}% + \def\thu@theorem@separator{:}% \else - \clearpage + \ifthu@language@english + \ctexset{ + figurename = {Figure}, + tablename = {Table}, + }% + \def\thu@algorithm@name{Algorithm}% + \def\thu@equation@name{Equation}% + \def\thu@assumption@name{Assumption}% + \def\thu@definition@name{Definition}% + \def\thu@proposition@name{Proposition}% + \def\thu@lemma@name{Lemma}% + \def\thu@theorem@name{Theorem}% + \def\thu@axiom@name{Axiom}% + \def\thu@corollary@name{Corollary}% + \def\thu@exercise@name{Exercise}% + \def\thu@example@name{Example}% + \def\thu@remark@name{Remark}% + \def\thu@problem@name{Problem}% + \def\thu@conjecture@name{Conjecture}% + \def\thu@proof@name{Proof}% + \def\thu@theorem@separator{: }% + \fi \fi - \@mainmatterfalse - \thusetup{toc-depth = 0}% } -\ifthu@fontset@mac - \thusetup{ - font = times, - cjk-font = mac, - } -\else - \ifthu@fontset@windows - \thusetup{ - font = times, - cjk-font = windows, - } +\thu@set@names +\thu@option@hook{language}{\thu@set@names} +\xeCJKDeclareCharClass{CJK}{"2460 -> "2473} +\xeCJKDeclareCharClass{CJK}{"2605} +\newcommand\thu@set@punctuations{% + \ifthu@language@chinese + \xeCJKDeclareCharClass{FullLeft}{"2018, "201C}% + \xeCJKDeclareCharClass{FullRight}{ + "00B7, "2019, "201D, "2013, "2014, "2025, "2026, "2E3A, + }% \else - \ifthu@fontset@fandol - \thusetup{ - font = termes, - cjk-font = fandol, - } - \else - \ifthu@fontset@ubuntu - \thusetup{ - font = termes, - cjk-font = noto, - } - \fi + \ifthu@language@english + \xeCJKDeclareCharClass{HalfLeft}{"2018, "201C}% + \xeCJKDeclareCharClass{HalfRight}{ + "00B7, "2019, "201D, "2013, "2014, "2025, "2026, "2E3A, + }% \fi \fi -\fi +} +\thu@set@punctuations +\thu@option@hook{language}{\thu@set@punctuations} \ifthu@system@auto \IfFileExists{/System/Library/Fonts/Menlo.ttc}{ \thusetup{system = mac} @@ -404,6 +581,48 @@ } } \fi +\ifthu@fontset@auto + \ifthu@system@windows + \thusetup{fontset = windows} + \else + \IfFontExistsTF{SimSun}{ + \thusetup{fontset = windows} + }{ + \ifthu@system@mac + \thusetup{fontset = mac} + \else + \IfFontExistsTF{Noto Serif CJK SC}{ + \thusetup{fontset = ubuntu} + }{ + \thusetup{fontset = fandol} + } + \fi + } + \fi +\fi +\ifthu@font@auto + \ifthu@fontset@windows + \thusetup{font=times} + \else + \ifthu@fontset@mac + \thusetup{font=times} + \else + \thusetup{font=termes} + \fi + \fi +\fi +\let\thu@font@family@stix\@empty +\newcommand\thu@set@stix@names{% + \ifx\thu@font@family@stix\@empty + \IfFontExistsTF{STIXTwoText-Regular.otf}{% + \gdef\thu@font@family@stix{STIXTwoText}% + \gdef\thu@font@name@stix@math{STIXTwoMath-Regular}% + }{% + \gdef\thu@font@family@stix{STIX2Text}% + \gdef\thu@font@name@stix@math{STIX2Math}% + }% + \fi +} \let\thu@font@family@xits\@empty \newcommand\thu@set@xits@names{% \ifx\thu@font@family@xits\@empty @@ -413,16 +632,14 @@ \gdef\thu@font@style@xits@bf{Bold}% \gdef\thu@font@style@xits@it{Italic}% \gdef\thu@font@style@xits@bfit{BoldItalic}% - \gdef\thu@font@name@xits@math@rm{XITSMath-Regular}% - \gdef\thu@font@name@xits@math@bf{XITSMath-Bold}% + \gdef\thu@font@name@xits@math{XITSMath-Regular}% }{% \gdef\thu@font@family@xits{xits}% \gdef\thu@font@style@xits@rm{regular}% \gdef\thu@font@style@xits@bf{bold}% \gdef\thu@font@style@xits@it{italic}% \gdef\thu@font@style@xits@bfit{bolditalic}% - \gdef\thu@font@name@xits@math@rm{xits-math}% - \gdef\thu@font@name@xits@math@bf{xits-mathbold}% + \gdef\thu@font@name@xits@math{xits-math}% }% \fi } @@ -448,14 +665,7 @@ }% \fi } -\ifthu@font@auto - \ifthu@system@unix - \thusetup{font=termes} - \else - \thusetup{font=times} - \fi -\fi -\newcommand\thu@load@font@times{% +\newcommand\thu@set@font@times{% \setmainfont{Times New Roman}% \setsansfont{Arial}% \ifthu@system@mac @@ -464,7 +674,7 @@ \setmonofont{Courier New}[Scale = MatchLowercase]% \fi } -\newcommand\thu@load@font@termes{% +\newcommand\thu@set@font@termes{% \setmainfont{texgyretermes}[ Extension = .otf, UprightFont = *-regular, @@ -472,9 +682,9 @@ ItalicFont = *-italic, BoldItalicFont = *-bolditalic, ]% - \thu@load@texgyre@sans@mono + \thu@set@texgyre@sans@mono } -\newcommand\thu@load@texgyre@sans@mono{% +\newcommand\thu@set@texgyre@sans@mono{% \setsansfont{texgyreheros}[ Extension = .otf, UprightFont = *-regular, @@ -491,7 +701,18 @@ Ligatures = CommonOff, ]% } -\newcommand\thu@load@font@xits{% +\newcommand\thu@set@font@stix{% + \thu@set@stix@names + \setmainfont{\thu@font@family@stix}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic, + ]% + \thu@set@texgyre@sans@mono +} +\newcommand\thu@set@font@xits{% \thu@set@xits@names \setmainfont{\thu@font@family@xits}[ Extension = .otf, @@ -500,9 +721,9 @@ ItalicFont = *-\thu@font@style@xits@it, BoldItalicFont = *-\thu@font@style@xits@bfit, ]% - \thu@load@texgyre@sans@mono + \thu@set@texgyre@sans@mono } -\newcommand\thu@load@font@libertinus{% +\newcommand\thu@set@font@libertinus{% \thu@set@libertinus@names \setmainfont{\thu@font@family@libertinus@serif}[ Extension = .otf, @@ -525,7 +746,30 @@ BoldItalicFont = *-boldoblique, ]% } -\@namedef{thu@load@font@lm}{% +\newcommand\thu@set@font@newcm{% + \setmathrm{NewCM10}[ + Extension = .otf, + UprightFont = *-Book, + BoldFont = *-Bold, + ItalicFont = *-BookItalic, + BoldItalicFont = *-BoldItalic, + ]% + \setmathsf{NewCMSans10}[ + Extension = .otf, + UprightFont = *-Book, + BoldFont = *-Bold, + ItalicFont = *-BookOblique, + BoldItalicFont = *-BoldOblique, + ]% + \setmathtt{NewCMMono10}[ + Extension = .otf, + UprightFont = *-Book, + ItalicFont = *-BookItalic, + BoldFont = *-Bold, + BoldItalicFont = *-BoldOblique, + ]% +} +\newcommand\thu@set@font@lm{% \setmainfont{lmroman10}[ Extension = .otf, UprightFont = *-regular, @@ -548,69 +792,31 @@ BoldItalicFont = *-boldoblique, ]% } -\newcommand\thu@load@font{% - \@nameuse{thu@load@font@\thu@font}% -} -\thu@load@font -\thu@option@hook{font}{\thu@load@font} -\unimathsetup{ - math-style = ISO, - bold-style = ISO, - nabla = upright, - partial = upright, -} -\newcommand\thu@load@math@font@xits{% - \thu@set@xits@names - \setmathfont{\thu@font@name@xits@math@rm}[ - Extension = .otf, - BoldFont = \thu@font@name@xits@math@bf, - StylisticSet = 8, - ]% - \setmathfont{\thu@font@name@xits@math@rm}[ - Extension = .otf, - StylisticSet = 1, - range = {cal,bfcal}, - ]% -} -\newcommand\thu@load@math@font@stix{% - \setmathfont{STIX2Math}[ - Extension = .otf, - StylisticSet = 8, - ]% - \setmathfont{STIX2Math}[ - Extension = .otf, - StylisticSet = 1, - range = {cal,bfcal}, - ]% -} -\newcommand\thu@load@math@font@libertinus{% - \thu@set@libertinus@names - \setmathfont{\thu@font@name@libertinus@math .otf}% -} -\newcommand\thu@load@math@font@lm{% - \setmathfont{latinmodern-math.otf}% +\newcommand\thu@set@font@newtx{% + \RequirePackage{newtxtext}% } -\newcommand\thu@load@math@font{% - \@nameuse{thu@load@math@font@\thu@math@font} +\newcommand\thu@set@font{% + \@nameuse{thu@set@font@\thu@font}% } -\thu@load@math@font -\thu@option@hook{math-font}{\thu@load@math@font} +\thu@set@font +\thu@option@hook{font}{\thu@set@font} \ifthu@cjk@font@auto - \ifthu@system@mac + \ifthu@fontset@mac \thusetup{cjk-font = mac} \else - \ifthu@system@windows + \ifthu@fontset@windows \thusetup{cjk-font = windows} \else - \IfFontExistsTF{Noto Serif CJK SC}{ + \ifthu@fontset@ubuntu \thusetup{cjk-font = noto} - }{ + \else \thusetup{cjk-font = fandol} - } + \fi \fi \fi \fi -\newcommand\thu@load@cjk@font@windows{% +\newcommand\thu@set@cjk@font@windows{% + \defaultCJKfontfeatures{Script=CJK}% \xeCJKsetup{EmboldenFactor=3}% \setCJKmainfont{SimSun}[ AutoFakeBold = true, @@ -623,7 +829,8 @@ \setCJKfamilyfont{zhkai}{KaiTi}% \setCJKfamilyfont{zhfs}{FangSong}% } -\newcommand\thu@load@cjk@font@mac{% +\newcommand\thu@set@cjk@font@mac{% + \defaultCJKfontfeatures{}% \setCJKmainfont{Songti SC}[ UprightFont = * Light, BoldFont = * Bold, @@ -648,34 +855,42 @@ BoldFont = * Bold, ]% } -\newcommand\thu@load@cjk@font@noto{% +\newcommand\thu@set@cjk@font@noto{% + \defaultCJKfontfeatures{}% \setCJKmainfont{Noto Serif CJK SC}[ UprightFont = * Light, BoldFont = * Bold, ItalicFont = FandolKai-Regular, ItalicFeatures = {Extension = .otf}, + Script = CJK, ]% \setCJKsansfont{Noto Sans CJK SC}[ - BoldFont = * Medium, + BoldFont = * Medium, + Script = CJK, + ]% + \setCJKmonofont{Noto Sans Mono CJK SC}[ + Script = CJK, ]% - \setCJKmonofont{Noto Sans Mono CJK SC}% \setCJKfamilyfont{zhsong}{Noto Serif CJK SC}[ - UprightFont = * Light, - UprightFont = * Bold, + UprightFont = * Light, + UprightFont = * Bold, + Script = CJK, ]% \setCJKfamilyfont{zhhei}{Noto Sans CJK SC}[ - BoldFont = * Medium, + BoldFont = * Medium, + Script = CJK, ]% \setCJKfamilyfont{zhfs}{FandolFang}[ - Extension = .otf, - UprightFont = *-Regular, + Extension = .otf, + UprightFont = *-Regular, ]% \setCJKfamilyfont{zhkai}{FandolKai}[ - Extension = .otf, - UprightFont = *-Regular, + Extension = .otf, + UprightFont = *-Regular, ]% } -\newcommand\thu@load@cjk@font@fandol{% +\newcommand\thu@set@cjk@font@fandol{% + \defaultCJKfontfeatures{}% \setCJKmainfont{FandolSong}[ Extension = .otf, UprightFont = *-Regular, @@ -716,11 +931,326 @@ \providecommand\fangsong{\CJKfamily{zhfs}} \providecommand\kaishu{\CJKfamily{zhkai}} \fi -\newcommand\thu@load@cjk@font{% - \@nameuse{thu@load@cjk@font@\thu@cjk@font}% +\newcommand\thu@set@cjk@font{% + \@nameuse{thu@set@cjk@font@\thu@cjk@font}% +} +\thu@set@cjk@font +\thu@option@hook{cjk-font}{\thu@set@cjk@font} +\newcommand\thu@set@math@style{% + \ifthu@math@style@TeX + \thusetup{ + uppercase-greek = upright, + less-than-or-equal = horizontal, + integral = slanted, + integral-limits = false, + partial = italic, + math-ellipsis = AMS, + }% + \else + \thusetup{ + uppercase-greek = italic, + integral = upright, + integral-limits = true, + partial = upright, + }% + \ifthu@math@style@ISO + \thusetup{ + less-than-or-equal = horizontal, + math-ellipsis = lower, + }% + \else + \ifthu@math@style@GB + \thusetup{ + less-than-or-equal = slanted, + math-ellipsis = centered, + }% + \fi + \fi + \fi +} +\ifthu@main@language@chinese + \thusetup{math-style=GB}% +\else + \thusetup{math-style=TeX}% +\fi +\thu@set@math@style +\thu@option@hook{math-style}{\thu@set@math@style} +\thu@option@hook{main-language}{% + \ifthu@main@language@chinese + \thusetup{math-style=GB}% + \else + \thusetup{math-style=TeX}% + \fi +} +\newcommand\thu@set@unimath@leq{% + \ifthu@leq@horizontal + \ifx\@begindocumenthook\@undefined + \let\le\thu@save@leq + \let\ge\thu@save@geq + \let\leq\thu@save@leq + \let\geq\thu@save@geq + \else + \AtBeginDocument{% + \let\le\thu@save@leq + \let\ge\thu@save@geq + \let\leq\thu@save@leq + \let\geq\thu@save@geq + }% + \fi + \else + \ifthu@leq@slanted + \ifx\@begindocumenthook\@undefined + \let\le\leqslant + \let\ge\geqslant + \let\leq\leqslant + \let\geq\geqslant + \else + \AtBeginDocument{% + \let\le\leqslant + \let\ge\geqslant + \let\leq\leqslant + \let\geq\geqslant + }% + \fi + \fi + \fi +} +\newcommand\thu@set@unimath@integral@limits{% + \ifthu@integral@limits@true + \removenolimits{% + \int\iint\iiint\iiiint\oint\oiint\oiiint + \intclockwise\varointclockwise\ointctrclockwise\sumint + \intbar\intBar\fint\cirfnint\awint\rppolint + \scpolint\npolint\pointint\sqint\intlarhk\intx + \intcap\intcup\upint\lowint + }% + \else + \addnolimits{% + \int\iint\iiint\iiiint\oint\oiint\oiiint + \intclockwise\varointclockwise\ointctrclockwise\sumint + \intbar\intBar\fint\cirfnint\awint\rppolint + \scpolint\npolint\pointint\sqint\intlarhk\intx + \intcap\intcup\upint\lowint + }% + \fi +} +\newcommand\thu@set@unimath@ellipsis{% + \ifthu@math@ellipsis@centered + \DeclareRobustCommand\mathellipsis{\mathinner{\unicodecdots}}% + \else + \DeclareRobustCommand\mathellipsis{\mathinner{\unicodeellipsis}}% + \fi +} +\newcommand\thu@set@unimath@style{% + \ifthu@uppercase@greek@upright + \unimathsetup{math-style = TeX}% + \else + \ifthu@uppercase@greek@italic + \unimathsetup{math-style = ISO}% + \fi + \fi + \ifthu@math@style@TeX + \unimathsetup{bold-style = TeX}% + \else + \unimathsetup{bold-style = ISO}% + \fi + \thu@set@unimath@leq + \thu@set@unimath@integral@limits + \ifthu@partial@upright + \unimathsetup{partial = upright}% + \else + \ifthu@partial@italic + \unimathsetup{partial = italic}% + \fi + \fi + \thu@set@unimath@ellipsis +} +\newcommand\thu@qed{\rule{1ex}{1ex}} +\newcommand\thu@load@unimath{% + \@ifpackageloaded{unicode-math}{}{% + \RequirePackage{unicode-math}% + \AtBeginDocument{% + \let\thu@save@leq\leq + \let\thu@save@geq\geq + }% + \DeclareRobustCommand\bm[1]{{\symbfit{##1}}}% + \DeclareRobustCommand\boldsymbol[1]{{\symbfit{##1}}}% + \newcommand\square{\mdlgwhtsquare}% + \newcommand\blacksquare{\mdlgblksquare}% + \AtBeginDocument{% + \renewcommand\checkmark{\ensuremath{✓}}% + }% + \renewcommand\thu@qed{\ensuremath{\QED}}% + }% +} +\newcommand\thu@xits@integral@stylistic@set{% + \ifthu@integral@upright + 8% + \fi +} +\newcommand\thu@set@math@font@xits{% + \thu@set@xits@names + \setmathfont{\thu@font@name@xits@math}[ + Extension = .otf, + StylisticSet = \thu@xits@integral@stylistic@set, + ]% + \setmathfont{\thu@font@name@xits@math}[ + Extension = .otf, + StylisticSet = 1, + range = {cal,bfcal}, + ]% +} +\newcommand\thu@set@math@font@stix{% + \thu@set@stix@names + \setmathfont{\thu@font@name@stix@math}[ + Extension = .otf, + StylisticSet = \thu@xits@integral@stylistic@set, + ]% + \setmathfont{\thu@font@name@stix@math}[ + Extension = .otf, + StylisticSet = 1, + range = {scr,bfscr}, + ]% +} +\newcommand\thu@libertinus@integral@stylistic@set{% + \ifthu@integral@italic + 8% + \fi } -\thu@load@cjk@font -\thu@option@hook{cjk-font}{\thu@load@cjk@font} +\newcommand\thu@set@math@font@libertinus{% + \thu@set@libertinus@names + \setmathfont{\thu@font@name@libertinus@math .otf}% +} +\newcommand\thu@set@math@font@lm{% + \setmathfont{latinmodern-math}[Extension=.otf]% + \setmathrm{lmroman10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + ]% + \setmathsf{lmsans10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique, + ]% + \setmathtt{lmmonolt10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique, + ]% +} +\newcommand\thu@newcm@integral@stylistic@set{% + \ifthu@integral@upright + 2% + \fi +} +\newcommand\thu@set@math@font@newcm{% + \setmathfont{NewCMMath-Book}[ + Extension = .otf, + StylisticSet = \thu@newcm@integral@stylistic@set, + ]% + \setmathfont{NewCMMath-Book}[ + Extension = .otf, + StylisticSet = 1, + range = {scr,bfscr}, + ]% + \setmathrm{NewCM10}[ + Extension = .otf, + UprightFont = *-Book, + BoldFont = *-Bold, + ItalicFont = *-BookItalic, + BoldItalicFont = *-BoldItalic, + ]% + \setmathsf{NewCMSans10}[ + Extension = .otf, + UprightFont = *-Book, + BoldFont = *-Bold, + ItalicFont = *-BookOblique, + BoldItalicFont = *-BoldOblique, + ]% + \setmathtt{NewCMMono10}[ + Extension = .otf, + UprightFont = *-Book, + ItalicFont = *-BookItalic, + BoldFont = *-Bold, + BoldItalicFont = *-BoldOblique, + ]% +} +\newcommand\thu@set@math@font@newtx{% + \ifthu@font@newtx\else + \let\thu@save@encodingdefault\encodingdefault + \let\thu@save@rmdefault\rmdefault + \let\thu@save@sfdefault\sfdefault + \let\thu@save@ttdefault\ttdefault + \RequirePackage[T1]{fontenc}% + \renewcommand{\rmdefault}{ntxtlf}% + \renewcommand{\sfdefault}{qhv}% + \renewcommand{\ttdefault}{ntxtt}% + \fi + \ifthu@uppercase@greek@italic + \PassOptionsToPackage{slantedGreek}{newtxmath}% + \fi + \ifthu@integral@upright + \PassOptionsToPackage{upint}{newtxmath}% + \fi + \RequirePackage{newtxmath} + \let\thu@save@leq\leq + \let\thu@save@geq\geq + \ifthu@leq@slanted + \let\le\leqslant + \let\ge\geqslant + \let\leq\leqslant + \let\geq\geqslant + \fi + \ifthu@integral@limits@true + \let\ilimits@\displaylimits + \fi + \let\thu@save@partial\partial + \ifthu@partial@upright + \let\partial\uppartial + \fi + \ifthu@math@ellipsis@centered + \DeclareRobustCommand\mathellipsis{\mathinner{\cdotp\cdotp\cdotp}}% + \else + \DeclareRobustCommand\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}}% + \fi + \RequirePackage{bm}% + \ifthu@font@newtx\else + \let\encodingdefault\thu@save@encodingdefault + \let\rmdefault\thu@save@rmdefault + \let\sfdefault\thu@save@sfdefault + \let\ttdefault\thu@save@ttdefault + \fi + \DeclareRobustCommand\symup[1]{{\mathrm{##1}}}% + \DeclareRobustCommand\symbf[1]{{\bm{##1}}}% + \let\increment\upDelta% + \renewcommand\thu@qed{\openbox}% +} +\newcommand\thu@set@math@font{% + \ifthu@math@font@none\else + \ifthu@math@font@newtx + \thu@set@math@font@newtx + \else + \thu@load@unimath + \thu@set@unimath@style + \@nameuse{thu@set@math@font@\thu@math@font}% + \fi + \fi +} +\thu@option@hook{math-font}{\g@addto@macro\thu@setup@hook{\thu@set@math@font}} +\newcommand\thu@set@math@font@auto{% + \ifthu@math@font@auto + \thusetup{math-font=xits}% + \fi +} +\AtBeginOfPackageFile*{siunitx}{\thu@set@math@font@auto} +\AtEndPreamble{\thu@set@math@font@auto} \renewcommand\normalsize{% \@setfontsize\normalsize{12bp}{20bp}% \abovedisplayskip 6bp% @@ -780,157 +1310,41 @@ \thu@def@fontsize{xiaoliu}{6.5bp} \thu@def@fontsize{qihao}{5.5bp} \thu@def@fontsize{bahao}{5bp} -\thusetup{main-language=\thu@language}% -\let\thu@main@language\thu@language -\thu@option@hook{language}{% - \ifx\@begindocumenthook\@undefined\else - \thusetup{main-language=\thu@language}% - \let\thu@main@language\thu@language - \fi -} -\newcommand\thu@reset@main@language{% - \thusetup{language = \thu@main@language}% - \let\thu@language\thu@main@language -} -\newcommand\thu@set@chapter@names{% - \ifthu@main@language@chinese - \ctexset{ - chapter/name = {第,章}, - }% - \def\bibname{参考文献}% - \def\appendixname{附录}% - \def\indexname{索引}% - \def\thu@acknowledgements@name{致\quad 谢}% - \ifthu@degree@bachelor - \def\contentsname{目\quad 录}% - \def\listfigurename{插图索引}% - \def\listtablename{表格索引}% - \def\thu@list@figure@table@name{插图和附表索引}% - \def\thu@list@algorithm@name{算法索引}% - \def\listequationname{公式索引}% - \def\thu@denotation@name{主要符号对照表}% - \def\thu@resume@name{在学期间参加课题的研究成果}% - \else - \def\listfigurename{插图清单}% - \def\listtablename{附表清单}% - \def\thu@list@figure@table@name{插图和附表清单}% - \def\thu@list@algorithm@name{算法清单}% - \def\listequationname{公式清单}% - \ifthu@degree@graduate - \def\contentsname{目\quad 录}% - \def\thu@denotation@name{符号和缩略语说明}% - \def\thu@resume@name{个人简历、在学期间完成的相关学术成果}% - \else % degree = postdoc - \def\contentsname{目\qquad 次}% - \def\thu@denotation@name{符号表}% - \def\thu@resume@name{个人简历、发表的学术论文与科研成果}% - \fi - \fi - \else - \ifthu@main@language@english - \ctexset{ - chapter/name = \chaptername\space, - }% - \def\indexname{Index}% - \ifthu@degree@bachelor - \def\contentsname{CONTENTS}% - \def\listfigurename{FIGURES}% - \def\listtablename{TABLES}% - \def\thu@list@figure@table@name{FIGURES AND TABLES}% - \def\thu@list@algorithm@name{ALGORITHMS}% - \def\listequationname{EQUATIONS}% - \def\thu@denotation@name{ABBREVIATIONS}% - \def\bibname{REFERENCES}% - \def\appendixname{APPENDIX}% - \def\thu@acknowledgements@name{ACKNOWLEDGEMENTS}% - \def\thu@resume@name{PUBLICATIONS}% +\def\cleardoublepage{% + \clearpage + \if@twoside + \ifthu@output@print + \ifodd\c@page \else - \def\contentsname{Contents}% - \def\listfigurename{List of Figures}% - \def\listtablename{List of Tables}% - \def\thu@list@figure@table@name{List of Figures and Tables}% - \def\thu@list@algorithm@name{List of Algorithms}% - \def\listequationname{List of Equations}% - \def\thu@denotation@name{Nomenclature}% - \def\bibname{Bibliography}% - \def\appendixname{Appendix}% - \def\thu@acknowledgements@name{Acknowledgements}% - \def\thu@resume@name{Resume and Academic Achievements}% + \thispagestyle{empty}% + \hbox{}% + \newpage + \if@twocolumn + \hbox{}\newpage + \fi \fi \fi \fi } -\thu@set@chapter@names -\thu@option@hook{degree}{\thu@set@chapter@names} -\thu@option@hook{main-language}{\thu@set@chapter@names} -\newcommand\thu@set@names{% - \ifthu@language@chinese - \ctexset{ - figurename = 图, - tablename = 表, - }% - \def\thu@algorithm@name{算法}% - \def\thu@equation@name{公式}% - \def\thu@assumption@name{假设}% - \def\thu@definition@name{定义}% - \def\thu@proposition@name{命题}% - \def\thu@lemma@name{引理}% - \def\thu@theorem@name{定理}% - \def\thu@axiom@name{公理}% - \def\thu@corollary@name{推论}% - \def\thu@exercise@name{练习}% - \def\thu@example@name{例}% - \def\thu@remark@name{注释}% - \def\thu@problem@name{问题}% - \def\thu@conjecture@name{猜想}% - \def\thu@proof@name{证明}% - \def\thu@theorem@separator{:}% - \else - \ifthu@language@english - \ctexset{ - figurename = {Figure}, - tablename = {Table}, - }% - \def\thu@algorithm@name{Algorithm}% - \def\thu@equation@name{Equation}% - \def\thu@assumption@name{Assumption}% - \def\thu@definition@name{Definition}% - \def\thu@proposition@name{Proposition}% - \def\thu@lemma@name{Lemma}% - \def\thu@theorem@name{Theorem}% - \def\thu@axiom@name{Axiom}% - \def\thu@corollary@name{Corollary}% - \def\thu@exercise@name{Exercise}% - \def\thu@example@name{Example}% - \def\thu@remark@name{Remark}% - \def\thu@problem@name{Problem}% - \def\thu@conjecture@name{Conjecture}% - \def\thu@proof@name{Proof}% - \def\thu@theorem@separator{: }% - \fi - \fi +\renewcommand\frontmatter{% + \cleardoublepage + \@mainmatterfalse + \pagenumbering{Roman}% } -\thu@set@names -\thu@option@hook{language}{\thu@set@names} -\xeCJKDeclareCharClass{CJK}{"2460 -> "2473} -\xeCJKDeclareCharClass{CJK}{"2605} -\newcommand\thu@set@punctuations{% - \ifthu@language@chinese - \xeCJKDeclareCharClass{FullLeft}{"2018, "201C}% - \xeCJKDeclareCharClass{FullRight}{ - "00B7, "2019, "201D, "2013, "2014, "2025, "2026, "2E3A, - }% +\renewcommand\mainmatter{% + \cleardoublepage + \@mainmattertrue + \pagenumbering{arabic}% +} +\renewcommand\backmatter{% + \if@openright + \cleardoublepage \else - \ifthu@language@english - \xeCJKDeclareCharClass{HalfLeft}{"2018, "201C}% - \xeCJKDeclareCharClass{HalfRight}{ - "00B7, "2019, "201D, "2013, "2014, "2025, "2026, "2E3A, - }% - \fi + \clearpage \fi + \@mainmatterfalse + \thusetup{toc-depth = 0}% } -\thu@set@punctuations -\thu@option@hook{language}{\thu@set@punctuations} \pagestyle{fancy} \fancypagestyle{plain}{% \fancyhf{}% @@ -949,30 +1363,47 @@ \let\chaptermark\@gobble \else \renewcommand\headrulewidth{0.75bp}% - \fancyhead[C]{\wuhao\leftmark}% + \fancyhead[C]{% + \wuhao + \ifthu@main@language@chinese + \leftmark + \else + \MakeUppercase{\leftmark}% + \fi + }% \fancyfoot[C]{\wuhao\thepage}% \let\@mkboth\markboth \def\chaptermark##1{% - \markboth{\CTEXifname{\CTEXthechapter\quad}{}##1}{}% + \markboth{% + \CTEXifname{% + \CTEXthechapter + \ifthu@main@language@chinese + \quad + \else + \space + \fi + }{}##1% + }{}% }% \fi \let\sectionmark\@gobble } \pagestyle{plain} -\ctexset{chapter/pagestyle = plain} +\def\ps@chapter{} +\ctexset{chapter/pagestyle = chapter} \ctexset{% punct=quanjiao, space=auto, } \newcommand\thu@set@indent{% - \ifthu@main@language@english + \ifthu@main@language@chinese + \ctexset{autoindent=2}% + \else \ifthu@degree@bachelor \ctexset{autoindent=0.8cm}% \else - \ctexset{autoindent=2}% + \ctexset{autoindent=0.74cm}% \fi - \else - \ctexset{autoindent=2}% \fi } \thu@set@indent @@ -1066,45 +1497,7 @@ \fi \endgroup } -\newcommand\thu@set@math@ellipsis{% - \ifthu@language@chinese - \DeclareRobustCommand\mathellipsis{\mathinner{\unicodecdots}}% - \else - \ifthu@language@english - \DeclareRobustCommand\mathellipsis{\mathinner{\unicodeellipsis}}% - \fi - \fi -} -\thu@set@math@ellipsis -\thu@option@hook{language}{\thu@set@math@ellipsis} -\protected\def\le{\leqslant} -\protected\def\ge{\geqslant} -\AtBeginDocument{% - \renewcommand\leq{\leqslant}% - \renewcommand\geq{\geqslant}% -} -\removenolimits{% - \int\iint\iiint\iiiint\oint\oiint\oiiint - \intclockwise\varointclockwise\ointctrclockwise\sumint - \intbar\intBar\fint\cirfnint\awint\rppolint - \scpolint\npolint\pointint\sqint\intlarhk\intx - \intcap\intcup\upint\lowint -} -\AtBeginDocument{% - \renewcommand{\Re}{\operatorname{Re}}% - \renewcommand{\Im}{\operatorname{Im}}% -} -\AtBeginDocument{% - \renewcommand\nabla{\mbfnabla}% -} -\DeclareRobustCommand\bm[1]{{\symbf{#1}}} -\DeclareRobustCommand\boldsymbol[1]{{\symbf{#1}}} -\newcommand\square{\mdlgwhtsquare} -\AtBeginDocument{% - \renewcommand\checkmark{\ensuremath{✓}}% -} \allowdisplaybreaks[4] -\renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} \def\fps@figure{h} \def\fps@table{h} \setlength{\floatsep}{6bp} @@ -1117,31 +1510,77 @@ \renewcommand{\topfraction}{0.85} \renewcommand{\bottomfraction}{0.65} \renewcommand{\floatpagefraction}{0.60} +\thu@define@key{ + figure-number-separator = { + name = figure@number@separator, + default = {.}, + }, + table-number-separator = { + name = table@number@separator, + default = {.}, + }, + equation-number-separator = { + name = equation@number@separator, + default = {.}, + }, + number-separator = { + name = number@separator, + default = {.}, + }, +} +\renewcommand\thefigure{% + \ifnum\c@chapter>\z@ + \thechapter + \thu@figure@number@separator + \fi + \@arabic\c@figure +} +\renewcommand\thetable{% + \ifnum\c@chapter>\z@ + \thechapter + \thu@table@number@separator + \fi + \@arabic\c@table +} +\renewcommand\theequation{% + \ifnum\c@chapter>\z@ + \thechapter + \thu@equation@number@separator + \fi + \@arabic\c@equation +} +\newcommand\thu@set@number@separator{% + \let\thu@figure@number@separator\thu@number@separator + \let\thu@table@number@separator\thu@number@separator + \let\thu@equation@number@separator\thu@number@separator +} +\thu@option@hook{number-separator}{\thu@set@number@separator} \patchcmd\@floatboxreset{% \normalsize }{% - \fontsize{11bp}{14.3bp}\selectfont - \renewcommand\arraystretch{1.4}% + \ifthu@language@chinese + \fontsize{11bp}{20.3bp}\selectfont + \else + \fontsize{11bp}{18.65bp}\selectfont + \fi }{}{\thu@patch@error{\@floatboxreset}} -\ifthu@degree@bachelor - \AtBeginDocument{% delay the check until all packages are loaded - \g@addto@macro\appendix{\renewcommand*{\thefigure}{\thechapter-\arabic{figure}}} - \g@addto@macro\appendix{\renewcommand*{\thetable}{\thechapter-\arabic{table}}} +\AtEndOfPackageFile*{longtable}{ + \AtBeginEnvironment{longtable}{% + \ifthu@language@chinese + \fontsize{11bp}{20.3bp}\selectfont + \else + \fontsize{11bp}{18.65bp}\selectfont + \fi } -\fi -\newcommand\thu@caption@font{} -\newcommand\thu@set@caption@font{% +} +\DeclareCaptionFont{thu}{% \ifthu@degree@bachelor - \renewcommand\thu@caption@font{\fontsize{11bp}{15bp}\selectfont}% + \fontsize{11bp}{15bp}\selectfont \else - \renewcommand\thu@caption@font{\fontsize{11bp}{14.3bp}\selectfont}% + \fontsize{11bp}{14.3bp}\selectfont \fi } -\thu@set@caption@font -\thu@option@hook{degree}{\thu@set@caption@font} -\DeclareCaptionFont{thu}{\thu@caption@font} \captionsetup{ - format = hang, font = thu, labelsep = quad, aboveskip = 6bp, @@ -1169,8 +1608,8 @@ nameformat = {}, numberformat = {}, titleformat = {}, - aftername = \quad, fixskip = true, + aftername = \quad, afterindent = true, lofskip = 0pt, lotskip = 0pt, @@ -1215,29 +1654,73 @@ }, }% \ifthu@main@language@chinese - \ctexset{chapter/number = \thechapter}% + \ctexset{ + chapter = { + name = {第,章}, + number = \thechapter, + }, + }% \else - \ctexset{chapter/number = \thu@english@number{chapter}}% + \ctexset{ + chapter = { + name = \chaptername\space, + number = \thu@english@number{chapter}, + }, + }% \fi \else + \ifthu@main@language@chinese + \ctexset{% + chapter = { + format = \centering\sffamily\sanhao, + nameformat = {}, + titleformat = {}, + name = {第,章}, + }, + section = { + format = \sffamily\fontsize{14bp}{20bp}\selectfont, + }, + subsection = { + format = \sffamily\fontsize{13bp}{20bp}\selectfont, + }, + subsubsection = { + format = \sffamily\fontsize{12bp}{20bp}\selectfont, + }, + }% + \else + \ctexset{% + chapter = { + format = \centering\sffamily\bfseries\fontsize{16bp}{20bp}\selectfont, + nameformat = \MakeUppercase, + titleformat = \MakeUppercase, + name = \chaptername\space, + }, + section = { + format = \sffamily\bfseries\fontsize{14bp}{20bp}\selectfont, + }, + subsection = { + format = \sffamily\bfseries\fontsize{13bp}{20bp}\selectfont, + }, + subsubsection = { + format = \sffamily\bfseries\fontsize{12bp}{20bp}\selectfont, + }, + }% + \fi \ctexset{% chapter = { - format = \centering\sffamily\sanhao, beforeskip = 27bp, afterskip = 27bp, + number = \thechapter, }, section = { - format = \sffamily\fontsize{14bp}{20bp}\selectfont, beforeskip = 24bp, afterskip = 6bp, }, subsection = { - format = \sffamily\fontsize{13bp}{20bp}\selectfont, beforeskip = 12bp, afterskip = 6bp, }, subsubsection = { - format = \sffamily\fontsize{12bp}{20bp}\selectfont, beforeskip = 12bp, afterskip = 6bp, }, @@ -1246,6 +1729,7 @@ } \thu@set@section@format \thu@option@hook{degree}{\thu@set@section@format} +\thu@option@hook{main-language}{\thu@set@section@format} \newcommand\thu@english@number[1]{% \expandafter\ifcase\csname c@#1\endcsname Zero\or @@ -1363,22 +1847,38 @@ \fi \fi \else - \titlecontents{chapter} - [\z@]{\addvspace{6bp}\sffamily} - {\contentspush{\thecontentslabel\quad}}{} - {\rmfamily\thu@leaders\thecontentspage}% - \titlecontents{section} - [1em]{} - {\contentspush{\thecontentslabel\quad}}{} - {\thu@leaders\thecontentspage}% - \titlecontents{subsection} - [2em]{} - {\contentspush{\thecontentslabel\quad}}{} - {\thu@leaders\thecontentspage}% + \ifthu@main@language@chinese + \titlecontents{chapter} + [\z@]{\addvspace{6bp}\sffamily} + {\contentspush{\thecontentslabel\quad}}{} + {\rmfamily\thu@leaders\thecontentspage}% + \titlecontents{section} + [1em]{} + {\contentspush{\thecontentslabel\quad}}{} + {\thu@leaders\thecontentspage}% + \titlecontents{subsection} + [2em]{} + {\contentspush{\thecontentslabel\quad}}{} + {\thu@leaders\thecontentspage}% + \else + \titlecontents{chapter} + [\z@]{\addvspace{6bp}\heiti} + {\contentspush{\MakeUppercase{\thecontentslabel}\quad}\MakeUppercase}{\MakeUppercase} + {\rmfamily\thu@leaders\thecontentspage}% + \titlecontents{section} + [1em]{} + {\contentspush{\thecontentslabel\space}}{} + {\thu@leaders\thecontentspage}% + \titlecontents{subsection} + [2em]{} + {\contentspush{\thecontentslabel\space}}{} + {\thu@leaders\thecontentspage}% + \fi \fi } \thu@set@toc@format \thu@option@hook{degree}{\thu@set@toc@format} +\thu@option@hook{main-language}{\thu@set@toc@format} \thu@define@key{ secret-level = { name = secret@level, @@ -1400,6 +1900,9 @@ default = {Name of author}, name = author@en, }, + student-id = { + name = student@id, + }, supervisor = { default = {导师姓名}, }, @@ -1413,11 +1916,18 @@ associate-supervisor* = { name = associate@supervisor@en, }, + co-supervisor = { + name = co@supervisor, + }, + co-supervisor* = { + name = co@supervisor@en, + }, + % Reserved for compatibility joint-supervisor = { - name = joint@supervisor, + name = co@supervisor, }, joint-supervisor* = { - name = joint@supervisor@en, + name = co@supervisor@en, }, degree-name = { default = {工学博士}, @@ -1543,21 +2053,29 @@ \thu@spine \fi \ifthu@degree@graduate - \cleardoublepage - \thu@titlepage@en + \ifthu@thesis@type@thesis + \cleardoublepage + \thu@titlepage@en + \fi \fi \clearpage } \newcommand\thu@titlepage{% \thusetup{language = chinese}% \ifthu@degree@graduate - \ifthu@degree@type@academic - \thu@titlepage@graduate@academic - \else - \ifx\thu@discipline\@empty - \thu@titlepage@graduate@professional - \else + \ifthu@thesis@type@thesis + \ifthu@degree@type@academic \thu@titlepage@graduate@academic + \else + \ifx\thu@discipline\@empty + \thu@titlepage@graduate@professional + \else + \thu@titlepage@graduate@academic + \fi + \fi + \else + \ifthu@thesis@type@proposal + \thu@titlepage@proposal \fi \fi \else @@ -1580,19 +2098,33 @@ hmargin = 3.5cm, }% \thispagestyle{empty}% - \null\vskip 0.2cm% + \null\vskip 8.1pt% \begingroup \centering \parbox[t][2cm][t]{\textwidth}{% - \hskip -0.69cm% + \hskip -21.5pt% \thu@titlepage@secret }\par - \vskip 1.5cm% - {\thu@titlepage@title}% - \vskip 0.85cm% + \vskip 40.5pt% + \begingroup + \sffamily\fontsize{26bp}{46.8bp}\selectfont + \thu@title\par + \endgroup + \ifthu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \thu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 24.1pt% \thu@titlepage@degree \vfill - \parbox[t][7.25cm][t]{\textwidth}{\centering\thu@titlepage@info}\par + \parbox[t][7.25cm][t]{\textwidth}{% + \centering\fangsong\fontsize{16bp}{31.2bp}\selectfont + \thu@titlepage@info + }\par \parbox[t][1.03cm][t]{\textwidth}{\centering\thu@titlepage@date}\par \endgroup \clearpage @@ -1613,16 +2145,70 @@ \thu@titlepage@secret }\par \vskip 1.5cm% - {\sffamily\yihao[1.575]\thu@title\par}% - \vskip 0.9cm% + \begingroup + % 1.21 倍行距,无网格 + \sffamily\fontsize{26bp}{40.9bp}\selectfont + \thu@title\par + \endgroup + \ifthu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \thu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 25.5pt% \thu@titlepage@degree \vfill - \parbox[t][5.28cm][t]{\textwidth}{\centering\thu@titlepage@info}\par + \parbox[t][5.24cm][t]{\textwidth}{% + \centering\fangsong\fontsize{16bp}{1cm}\selectfont + \thu@titlepage@info + }\par \parbox[t][1.25cm][t]{\textwidth}{\centering\thu@titlepage@date}\par \endgroup \clearpage \restoregeometry } +\newcommand\thu@titlepage@proposal{% + \newgeometry{ + top = 5cm, + bottom = 3.25cm, + hmargin = 3.17cm, + }% + \thispagestyle{empty}% + \begingroup + % \vspace*{0.1cm}% + \centering + % {\thu@titlepage@title}% + \parbox[t][3cm]{\textwidth}{% + \vskip 0.1cm% + \centering + \sffamily\fontsize{26bp}{46.8bp}\selectfont + \thu@title\par + }% + \vskip 0.85cm% + \thu@titlepage@degree + \vfill + \parbox[t][8.5cm][t]{\textwidth}{% + \centering\CJKfamily+{}% + \centering\fangsong\sanhao[1.95]% + \thu@titlepage@info + }\par + \parbox[t][2.5cm][t]{\textwidth}{\centering\thu@titlepage@date}\par + \endgroup + \clearpage + \restoregeometry +} +\newcommand\thu@set@student@id{% + \ifthu@thesis@type@proposal + \ifx\thu@student@id\@empty + \thusetup{student-id=2000310000}% + \fi + \fi +} +\thu@set@student@id +\thu@option@hook{thesis-type}{\thu@set@student@id} \newcommand\thu@titlepage@secret{% \sffamily\sanhao \ifx\thu@secret@level\@empty @@ -1631,14 +2217,30 @@ \thu@secret@level★\makebox[3em][c]{\thu@secret@year}年% \fi\par } -\newcommand\thu@titlepage@title{% - \sffamily\yihao[1.8]\thu@title\par -} \newcommand\thu@titlepage@degree{% \begingroup - \def\CJKglue{\hskip 1bp}% \CJKfamily+{}\xiaoer - (申请清华大学\thu@degree@name\ifthu@degree@type@professional 专业\fi 学位论文)\par + \def\CJKglue{\hskip 1bp}% + \ifthu@thesis@type@thesis + (申请清华大学\thu@degree@name + \ifthu@degree@type@professional + 专业% + \fi + 学位论文)% + \else + \ifthu@thesis@type@proposal + (清华大学% + \ifthu@degree@doctor + 博士% + \else + \ifthu@degree@master + 硕士% + \fi + \fi + 学位论文选题报告)% + \fi + \fi + \par \endgroup } \newcommand\thu@titlepage@info{% @@ -1668,8 +2270,8 @@ ##2{##3}\\ \fi }% - \fangsong\sanhao[1.95]% \begin{tabular}{l}% + \renewcommand\arraystretch{1}% #4% \end{tabular}% } @@ -1678,18 +2280,20 @@ \thu@info@item{培养单位}{}{\thu@department}% \thu@info@item{学科}{}{\thu@discipline}% \thu@info@item{研究生}{\thu@name@title}{\thu@author}% + \thu@info@item{学号}{}{\thu@student@id}% \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合导师}{\thu@name@title}{\thu@joint@supervisor}% + \thu@info@item{联合导师}{\thu@name@title}{\thu@co@supervisor}% }\par } \newcommand\thu@titlepage@info@doctor@professional{% \thu@titlepage@info@tabular{3.03cm}{5em}{1.52cm}{% \thu@info@item{培养单位}{}{\thu@department}% \thu@info@item{申请人}{\thu@name@title}{\thu@author}% + \thu@info@item{学号}{}{\thu@student@id}% \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合导师}{\thu@name@title}{\thu@joint@supervisor}% + \thu@info@item{联合导师}{\thu@name@title}{\thu@co@supervisor}% }\par } \newcommand\thu@titlepage@info@master@academic{% @@ -1697,9 +2301,10 @@ \thu@info@item{培养单位}{}{\thu@department}% \thu@info@item{学科}{}{\thu@discipline}% \thu@info@item{研究生}{\thu@name@title}{\thu@author}% + \thu@info@item{学号}{}{\thu@student@id}% \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@joint@supervisor}% + \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% }\par } \newcommand\thu@titlepage@info@master@engineer{% @@ -1707,24 +2312,27 @@ \thu@info@item{培养单位}{}{\thu@department}% \thu@info@item{工程领域}{}{\thu@discipline}% \thu@info@item{申请人}{\thu@name@title}{\thu@author}% + \thu@info@item{学号}{}{\thu@student@id}% \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@joint@supervisor}% + \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% }\par } \newcommand\thu@titlepage@info@master@other{% \thu@titlepage@info@tabular{3.28cm}{5em}{1.52cm}{% \thu@info@item{培养单位}{}{\thu@department}% \thu@info@item{申请人}{\thu@name@title}{\thu@author}% + \thu@info@item{学号}{}{\thu@student@id}% \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@joint@supervisor}% + \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% }\par } \newcommand\thu@titlepage@date{% \begingroup + \sanhao \def\CJKglue{\hskip 1bp}% - \sanhao\thu@format@date{\thu@date@zh@short}{\thu@date}\par + \thu@format@date{\thu@date@zh@short}{\thu@date}\par \endgroup } \newcommand{\thu@titlepage@en}{% @@ -1822,12 +2430,13 @@ } \newcommand\thu@titlepage@en@supervisor{% \begin{tabular}{r@{\makebox[0.71cm][l]{:}}l}% - \thu@thesis@name@en{} Supervisor & \thu@supervisor@en \\ + \renewcommand\arraystretch{1}% + \thu@thesis@name@en{} Supervisor & \thu@supervisor@en \\ \ifx\thu@associate@supervisor@en\@empty\else - Associate Supervisor & \thu@associate@supervisor@en \\ + Associate Supervisor & \thu@associate@supervisor@en \\ \fi - \ifx\thu@joint@supervisor@en\@empty\else - Cooperate Supervisor & \thu@joint@supervisor@en \\ + \ifx\thu@co@supervisor@en\@empty\else + Co-supervisor & \thu@co@supervisor@en \\ \fi \end{tabular}% } @@ -1888,7 +2497,7 @@ \def\thu@info@item##1##2##3{% \ifx##3\@empty\else \thu@fixed@box{% - \ifx\thu@joint@supervisor\@empty + \ifx\thu@co@supervisor\@empty 4em% \else 5.5em% @@ -1904,7 +2513,7 @@ \thu@info@item{姓名}{\thu@name@title}{\thu@author}% \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% \thu@info@item{辅导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@joint@supervisor}% + \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% \endgroup \vskip 1.4cm% \begingroup @@ -1968,6 +2577,7 @@ \vskip 0.4cm% {\xiaosi[2.6]% \begin{tabular}{l@{\quad}l}% + \renewcommand\arraystretch{1}% \thu@stretch{11em}{博士后姓名} & \thu@author \\ \thu@stretch{11em}{流动站(一级学科)名称} & \thu@discipline@level@i \\ \thu@stretch{11em}{专\quad{}业(二级学科)名称} & \thu@discipline@level@ii \\ @@ -1980,7 +2590,7 @@ 研究工作期满时间\quad\thu@format@date{\thu@date@zh@digit}{\thu@end@date}\par }% \vskip 2.1cm% - {\xiaosi[2.6]清华大学人事部(北京)\par}% + {\xiaosi[2.6]清华大学人事处(北京)\par}% \vskip 0.6cm% {\wuhao\thu@format@date{\thu@date@zh@digit@short}{\thu@date}\par}% \end{center}% @@ -2000,7 +2610,12 @@ }% \kvsetkeys{thu@committee}{#1}% \ifx\thu@committee@file\@empty - \thu@chapter*[]{\thu@committee@name}% + \begingroup + \ifthu@main@language@english + \ctexset{chapter/format=\centering\sffamily\fontsize{16bp}{20bp}\selectfont} + \fi + \thu@chapter*[]{\thu@committee@name}% + \endgroup \else \thu@pdfbookmark{0}{\thu@committee@name}% \includepdf{\thu@committee@file}% @@ -2013,21 +2628,25 @@ afterindent = false, }, }% + \thusetup{language=chinese} }{% + \thu@reset@main@language } \newcommand\copyrightpage[1][]{% + \cleardoublepage \ifthu@degree@postdoc\relax\else \def\thu@@tmp{#1} \ifx\thu@@tmp\@empty + \thusetup{language=chinese}% \ifthu@degree@bachelor \thu@copyright@page@bachelor \else \thu@copyright@page@graduate \fi + \thu@reset@main@language \else - \cleardoublepage \thispagestyle{empty}% - \thu@pdfbookmark{0}{\thu@authorization@title}% + \thu@pdfbookmark{0}{关于学位论文使用授权的说明}% \thu@phantomsection \kv@define@key{thu@copyright}{file}{\includepdf{\kv@value}}% \kv@set@family@handler{thu@copyright}{% @@ -2044,7 +2663,6 @@ \newcommand{\thu@authorization@frontdate}{% 日\ifthu@degree@bachelor\hspace{1em}\else\hspace{2em}\fi 期:} \newcommand\thu@copyright@page@graduate{% - \cleardoublepage \newgeometry{ vmargin = 3.8cm, hmargin = 3.2cm, @@ -2093,7 +2711,6 @@ \restoregeometry } \newcommand\thu@copyright@page@bachelor{% - \cleardoublepage \begingroup \ctexset{ chapter = { @@ -2143,7 +2760,14 @@ \fi \thusetup{language = chinese}% \ifthu@degree@graduate - \thu@chapter*{\thu@abstract@name}% + \begingroup + \ifthu@main@language@english + \ctexset{% + chapter/format = \centering\sffamily\fontsize{16bp}{20bp}\selectfont, + }% + \fi + \thu@chapter*{\thu@abstract@name}% + \endgroup \else \thu@chapter*[]{\thu@abstract@name}% \fi @@ -2278,8 +2902,20 @@ }% \kvsetkeys{thu@statement}{#1}% \ifx\thu@statement@file\@empty - \thu@chapter*{\thu@statement@name}% - \thispagestyle{\thu@statement@page@style}% + \thusetup{language=chinese}% + \begingroup + \ifthu@degree@graduate + \ifthu@main@language@english + \ctexset{% + chapter/format = \centering\sffamily\fontsize{16bp}{20bp}\selectfont, + }% + \fi + \fi + \thu@chapter*{\thu@statement@name}% + \endgroup + \ifthu@degree@bachelor + \thispagestyle{\thu@statement@page@style}% + \fi \thu@statement@text\par \ifthu@degree@graduate \vskip 2cm% @@ -2288,11 +2924,15 @@ \fi {\hfill\thu@signature\thu@underline[2.5cm]\relax \thu@backdate\thu@underline[2.5cm]\relax}% + \thu@reset@main@language \else \includepdf[pagecommand={% \markboth{\thu@statement@name}{}% \thu@phantomsection \addcontentsline{toc}{chapter}{\thu@statement@name}% + \ifthu@degree@bachelor\else + \thispagestyle{empty}% + \fi }]{\thu@statement@file}% \fi \ifthu@degree@bachelor @@ -2822,6 +3462,24 @@ \newcommand\publicationskip{% \thu@error{The "\protect\publicationskip" is obsolete. Do not use it}% } +\newenvironment{comments}[1][]{% + \@mainmatterfalse + \kv@define@key{thu@comments}{name}{\let\thu@comments@name\kv@value}% + \kv@set@family@handler{thu@comments}{% + \ifx\kv@value\relax + \let\thu@comments@name\kv@key + \else + \kv@handled@false + \fi + }% + \kvsetkeys{thu@comments}{#1}% + \chapter{\thu@comments@name}% +}{% +} +\newenvironment{resolution}{% + \@mainmatterfalse + \chapter{\thu@resolution@name}% +}{} \newcommand{\record}[1]{% \let\thu@record@file\@empty \kv@define@key{thu@record}{file}{\let\thu@record@file\kv@value}% @@ -2906,12 +3564,6 @@ \def\thenomenclature{\begin{denotation}[\nom@tempdim]} \def\endthenomenclature{\end{denotation}} } -\AtEndOfPackageFile*{longtable}{ - \pretocmd\LT@array{% - \fontsize{11bp}{14.3bp}\selectfont - \renewcommand\arraystretch{1.4}% - }{}{\thu@patch@error{\LT@array}} -} \AtEndOfPackageFile*{siunitx}{% \sisetup{ group-minimum-digits = 4, @@ -2928,7 +3580,7 @@ \else \ifthu@language@english \sisetup{ - list-final-separator = { and }, + list-final-separator = {, and }, list-pair-separator = { and }, range-phrase = { to }, }% @@ -2970,12 +3622,12 @@ }{% \popQED\endtrivlist\@endpefalse } - \renewcommand\qedsymbol{\ensuremath{\QED}} + \renewcommand\qedsymbol{\thu@qed} } \AtEndOfPackageFile*{ntheorem}{% \theorembodyfont{\normalfont}% \theoremheaderfont{\normalfont\sffamily}% - \theoremsymbol{\ensuremath{\QED}}% + \theoremsymbol{\thu@qed}% \newtheorem*{proof}{\thu@proof@name}% \theoremstyle{plain}% \theoremsymbol{}% @@ -2996,7 +3648,6 @@ \PassOptionsToPackage{chapter}{algorithm} \AtEndOfPackageFile*{algorithm}{ \floatname{algorithm}{\thu@algorithm@name} - \g@addto@macro\appendix{\renewcommand*{\thealgorithm}{\thechapter-\arabic{algorithm}}} \renewcommand\listofalgorithms{% \thu@listof{algorithm}% } @@ -3027,7 +3678,6 @@ {\thu@leaders\thecontentspage} } \AtEndOfPackageFile*{minted}{ - \g@addto@macro\appendix{\renewcommand*{\thelisting}{\thechapter-\arabic{listing}}}% \newcommand\thu@set@listing@language{% \ifthu@language@chinese \floatname{listing}{代码}% |