diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-21 21:44:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-21 21:44:49 +0000 |
commit | be19a973422c106c368feba7f09be5809fefe13f (patch) | |
tree | 9508be13061c79946d5677efe6ad5ab5206a7c61 /Master/texmf-dist/source | |
parent | 3bc8fda089714cc77da9c8a0fe9e06050e9de3b1 (diff) |
thuthesis (21mar21) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58600 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx | 627 |
1 files changed, 377 insertions, 250 deletions
diff --git a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx index b98322fd500..061749cc9a1 100644 --- a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx +++ b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx @@ -14,7 +14,7 @@ % % \iffalse %<*driver> -\ProvidesFile{thuthesis.dtx}[2021/03/12 7.2.0 Tsinghua University Thesis Template] +\ProvidesFile{thuthesis.dtx}[2021/03/21 7.2.1 Tsinghua University Thesis Template] \documentclass{ltxdoc} \usepackage{dtx-style} @@ -773,8 +773,9 @@ % % \subsubsection{数学符号} % \label{sec:math} -% 中文论文的数学符号默认遵循 GB/T 3102.11—1993《物理科学和技术中使用的数学符号》。 -% 该标准参照采纳 ISO 31-11:1992, +% 中文论文的数学符号默认遵循 GB/T 3102.11—1993《物理科学和技术中使用的数学符号》 +% \footnote{原 GB 3102.11—1993,自 2017 年 3 月 23 日起,该标准转为推荐性标准。}。 +% 该标准参照采纳 ISO 31-11:1992 \footnote{目前已更新为 ISO 80000-2:2019。}, % 但是与 \TeX{} 默认的美国数学学会(AMS)的习惯有许多差异。 % 这将在下文详细论述。 % @@ -810,6 +811,8 @@ % 省略号 \cs{dots} 的样式,可选:\option{centered}(按照中文的习惯固定居中)、 % \option{lower} 和 \option{AMS}(取决于前后符号的位置)。 % 其他的省略号命令如 \cs{lots}、\cs{cdots} 则不受影响。 +% \item \DescribeOption{real-part} +% 实部 \cs{Re} 和虚部 \cs{Im} 的字体,可选:\option{roman} 和 \option{fraktur}。 % \end{enumerate} % % 如果数学符号选择国标样式 |math-style = GB|,相当于设置了 @@ -821,6 +824,7 @@ % integral-limits = true, % partial = upright, % math-ellipsis = centered, +% real-part = roman, % } % \end{latex} % @@ -1082,8 +1086,7 @@ % \end{latex} % 注意,本科生插入扫描页时总是会加页码,不受该选项控制。 % -% 研究生不存在空白页的问题,所以在编译声明页时总是会加上页眉和页脚, -% 而在插入扫描页时则不再添加,不受 \option{page-style} 的控制。 +% 研究生不存在空白页的问题,但是为了灵活性也允许用户选择是否添加页眉和页脚。 % % \subsubsection{附录} % @@ -1243,7 +1246,7 @@ % \begin{macrocode} %<cls>\NeedsTeXFormat{LaTeX2e}[2017/04/15] %<cls>\ProvidesClass{thuthesis} -%<cls>[2021/03/12 7.2.0 Tsinghua University Thesis Template] +%<cls>[2021/03/21 7.2.1 Tsinghua University Thesis Template] % \end{macrocode} % % 报错 @@ -1299,7 +1302,7 @@ %<*cls> \hyphenation{Thu-Thesis} \def\thuthesis{ThuThesis} -\def\version{7.2.0} +\def\version{7.2.1} \RequirePackage{kvdefinekeys} \RequirePackage{kvsetkeys} \RequirePackage{kvoptions} @@ -1317,7 +1320,6 @@ \let\thu@setup@hook\@empty \kvsetkeys{thu}{#1}% \thu@setup@hook - \thu@setup@hook } % \end{macrocode} % \end{macro} @@ -1545,8 +1547,8 @@ name = math@font, choices = { auto, - xits, stix, + xits, libertinus, newcm, lm, @@ -1604,6 +1606,13 @@ AMS, }, }, + real-part = { + name = real@part, + choices = { + roman, + fraktur, + }, + }, % \end{macrocode} % % 选择打印版还是用于上传的电子版。 @@ -1785,7 +1794,7 @@ \thu@error{The "#2" package is incompatible with "#1"}% }% }% - } +} \thu@package@conflict{biblatex}{bibunits} \thu@package@conflict{biblatex}{chapterbib} \thu@package@conflict{biblatex}{cite} @@ -1816,6 +1825,25 @@ \thu@package@conflict{newtxmath}{upgreek} % \end{macrocode} % +% \pkg{mathtools} 需要在 \pkg{unicode-math} 前载入, +% 参考 \url{https://tex.stackexchange.com/q/521394/82731}。 +% \begin{macrocode} +\AtBeginOfPackageFile*{mathtools}{ + \@ifpackageloaded{unicode-math}{ + \thu@error{The "mathtools" package should be loaded before setting "math-font"} + }{} +}% +% \end{macrocode} +% +% \pkg{amsthm} 需要在 \pkg{newtx} 前载入,参考 \pkg{newtx} 的文档。 +% \begin{macrocode} +\AtBeginOfPackageFile*{amsthm}{ + \@ifpackageloaded{newtxmath}{ + \thu@error{The "amsthm" package should be loaded before setting "newtxmath"} + }{} +}% +% \end{macrocode} +% % \subsection{页面设置} % \label{sec:layout} % @@ -2062,6 +2090,116 @@ % % \subsection{字体} % \label{sec:font} +% +% \subsubsection{字号} +% +% \begin{macro}{\normalsize} +% 正文小四号(12bp)字,行距为固定值 20 bp。 +% 其他字号的行距按照相同的比例设置。 +% +% 注意重定义 \cs{normalsize} 应在 \pkg{unicode-math} 的 \cs{setmathfont} 前。 +% +% 表达式行的行距为单倍行距,段前空 6 磅,段后空 6 磅。 +% \begin{macrocode} +\renewcommand\normalsize{% + \@setfontsize\normalsize{12bp}{20bp}% + \abovedisplayskip 6bp% + \abovedisplayshortskip 6bp% + \belowdisplayshortskip 6bp% + \belowdisplayskip \abovedisplayskip +} +\normalsize +\ifx\MakeRobust\@undefined \else + \MakeRobust\normalsize +\fi +\DeclareRobustCommand\small{% + \@setfontsize\small{10.5bp}{17.5bp}% + \abovedisplayskip 6bp% + \abovedisplayshortskip 6bp% + \belowdisplayshortskip 6bp% + \def\@listi{\leftmargin\leftmargini + \topsep \z@skip + \parsep \z@skip + \itemsep \z@skip}% + \belowdisplayskip \abovedisplayskip +} +\DeclareRobustCommand\footnotesize{% + \@setfontsize\footnotesize{9bp}{15bp}% + \abovedisplayskip 6bp% + \abovedisplayshortskip 6bp% + \belowdisplayshortskip 6bp% + \def\@listi{\leftmargin\leftmargini + \topsep \z@skip + \parsep \z@skip + \itemsep \z@skip}% + \belowdisplayskip \abovedisplayskip +} +\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize{7.5bp}{12.5bp}} +\DeclareRobustCommand\tiny{\@setfontsize\tiny{6.5bp}{10.83bp}} +\DeclareRobustCommand\large{\@setfontsize\large{15bp}{25bp}} +\DeclareRobustCommand\Large{\@setfontsize\Large{18bp}{30bp}} +\DeclareRobustCommand\LARGE{\@setfontsize\LARGE{22bp}{36.67bp}} +\DeclareRobustCommand\huge{\@setfontsize\huge{24bp}{40bp}} +\DeclareRobustCommand\Huge{\@setfontsize\Huge{26bp}{43.33bp}} +% \end{macrocode} +% \end{macro} +% +% WORD 中的字号对应该关系如下(1bp = 72.27/72 pt): +% \begin{center} +% \begin{longtable}{llll} +% \toprule +% 初号 & 42bp & 14.82mm & 42.1575pt \\ +% 小初 & 36bp & 12.70mm & 36.135 pt \\ +% 一号 & 26bp & 9.17mm & 26.0975pt \\ +% 小一 & 24bp & 8.47mm & 24.09pt \\ +% 二号 & 22bp & 7.76mm & 22.0825pt \\ +% 小二 & 18bp & 6.35mm & 18.0675pt \\ +% 三号 & 16bp & 5.64mm & 16.06pt \\ +% 小三 & 15bp & 5.29mm & 15.05625pt \\ +% 四号 & 14bp & 4.94mm & 14.0525pt \\ +% 小四 & 12bp & 4.23mm & 12.045pt \\ +% 五号 & 10.5bp & 3.70mm & 10.59375pt \\ +% 小五 & 9bp & 3.18mm & 9.03375pt \\ +% 六号 & 7.5bp & 2.56mm & \\ +% 小六 & 6.5bp & 2.29mm & \\ +% 七号 & 5.5bp & 1.94mm & \\ +% 八号 & 5bp & 1.76mm & \\\bottomrule +% \end{longtable} +% \end{center} +% +% \begin{macro}{\thu@def@fontsize} +% 根据习惯定义字号。用法: +% +% \cs{thu@def@fontsize}\marg{字号名称}\marg{磅数} +% +% 避免了字号选择和行距的紧耦合。所有字号定义时为单倍行距,并提供选项指定行距倍数。 +% \begin{macrocode} +\def\thu@def@fontsize#1#2{% + \expandafter\newcommand\csname #1\endcsname[1][1.3]{% + \fontsize{#2}{##1\dimexpr #2}\selectfont}} +% \end{macrocode} +% \end{macro} +% +% 一组字号定义。 +% \begin{macrocode} +\thu@def@fontsize{chuhao}{42bp} +\thu@def@fontsize{xiaochu}{36bp} +\thu@def@fontsize{yihao}{26bp} +\thu@def@fontsize{xiaoyi}{24bp} +\thu@def@fontsize{erhao}{22bp} +\thu@def@fontsize{xiaoer}{18bp} +\thu@def@fontsize{sanhao}{16bp} +\thu@def@fontsize{xiaosan}{15bp} +\thu@def@fontsize{sihao}{14bp} +\thu@def@fontsize{xiaosi}{12bp} +\thu@def@fontsize{wuhao}{10.5bp} +\thu@def@fontsize{xiaowu}{9bp} +\thu@def@fontsize{liuhao}{7.5bp} +\thu@def@fontsize{xiaoliu}{6.5bp} +\thu@def@fontsize{qihao}{5.5bp} +\thu@def@fontsize{bahao}{5bp} +% \end{macrocode} +% % 检测系统。 % \begin{macrocode} \ifthu@system@auto @@ -2123,74 +2261,7 @@ \fi % \end{macrocode} % -% STIX 字体的文件名在 v2.10 2020-12-19 从 -% \file{STIXTwoText-Regular.otf}、\file{STIX2Math.otf} 分别改为 -% \file{STIXTwoText-Regular.otf}、\file{STIXTwoMath-Regular.otf}。 -% 需要进行判断。 -% -% XITS 字体的文件名在 v1.109 2018-09-30 -% 从 \file{xits-regular.otf}、\file{xits-math.otf} 分别改为 -% \file{XITS-Regular.otf}、\file{XITSMath-Regular.otf}。 -% -% Libertinus 的文件名在 v6.7 2019-04-03 从小写改为驼峰式, -% 在大小写敏感的平台上需要进行判断。 -% \begin{macrocode} -\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 - \IfFontExistsTF{XITSMath-Regular.otf}{% - \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{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{xits-math}% - }% - \fi -} -\let\thu@font@family@libertinus\@empty -\newcommand\thu@set@libertinus@names{% - \ifx\thu@font@family@libertinus\@empty - \IfFontExistsTF{LibertinusSerif-Regular.otf}{% - \gdef\thu@font@family@libertinus@serif{LibertinusSerif}% - \gdef\thu@font@family@libertinus@sans{LibertinusSans}% - \gdef\thu@font@name@libertinus@math{LibertinusMath-Regular}% - \gdef\thu@font@style@libertinus@rm{Regular}% - \gdef\thu@font@style@libertinus@bf{Bold}% - \gdef\thu@font@style@libertinus@it{Italic}% - \gdef\thu@font@style@libertinus@bfit{BoldItalic}% - }{% - \gdef\thu@font@family@libertinus@serif{libertinusserif}% - \gdef\thu@font@family@libertinus@sans{libertinussans}% - \gdef\thu@font@name@libertinus@math{libertinusmath-regular}% - \gdef\thu@font@style@libertinus@rm{regular}% - \gdef\thu@font@style@libertinus@bf{bold}% - \gdef\thu@font@style@libertinus@it{italic}% - \gdef\thu@font@style@libertinus@bfit{bolditalic}% - }% - \fi -} -% \end{macrocode} -% +% Times New Roman + Arial % \begin{macrocode} \newcommand\thu@set@font@times{% \setmainfont{Times New Roman}% @@ -2201,6 +2272,10 @@ \setmonofont{Courier New}[Scale = MatchLowercase]% \fi } +% \end{macrocode} +% +% TeX Gyre Termes +% \begin{macrocode} \newcommand\thu@set@font@termes{% \setmainfont{texgyretermes}[ Extension = .otf, @@ -2225,9 +2300,29 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, + Scale = MatchLowercase, Ligatures = CommonOff, ]% } +% \end{macrocode} +% +% STIX Two 字体。 +% STIX 文件名在 v2.10 2020-12-19 从 +% \file{STIX2Text-Regular.otf}、\file{STIX2Math.otf} 分别改为 +% \file{STIXTwoText-Regular.otf}、\file{STIXTwoMath-Regular.otf}。 +% \begin{macrocode} +\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 +} \newcommand\thu@set@font@stix{% \thu@set@stix@names \setmainfont{\thu@font@family@stix}[ @@ -2239,6 +2334,33 @@ ]% \thu@set@texgyre@sans@mono } +% \end{macrocode} +% +% XITS 字体。 +% XITS 的文件名在 v1.109 2018-09-30 +% 从 \file{xits-regular.otf}、\file{xits-math.otf} 分别改为 +% \file{XITS-Regular.otf}、\file{XITSMath-Regular.otf}。 +% \begin{macrocode} +\let\thu@font@family@xits\@empty +\newcommand\thu@set@xits@names{% + \ifx\thu@font@family@xits\@empty + \IfFontExistsTF{XITSMath-Regular.otf}{% + \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{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{xits-math}% + }% + \fi +} \newcommand\thu@set@font@xits{% \thu@set@xits@names \setmainfont{\thu@font@family@xits}[ @@ -2250,6 +2372,34 @@ ]% \thu@set@texgyre@sans@mono } +% \end{macrocode} +% +% Libertinus 字体。 +% Libertinus 的文件名在 v6.7 2019-04-03 从小写改为驼峰式, +% 在大小写敏感的平台上需要进行判断。 +% \begin{macrocode} +\let\thu@font@family@libertinus\@empty +\newcommand\thu@set@libertinus@names{% + \ifx\thu@font@family@libertinus\@empty + \IfFontExistsTF{LibertinusSerif-Regular.otf}{% + \gdef\thu@font@family@libertinus@serif{LibertinusSerif}% + \gdef\thu@font@family@libertinus@sans{LibertinusSans}% + \gdef\thu@font@name@libertinus@math{LibertinusMath-Regular}% + \gdef\thu@font@style@libertinus@rm{Regular}% + \gdef\thu@font@style@libertinus@bf{Bold}% + \gdef\thu@font@style@libertinus@it{Italic}% + \gdef\thu@font@style@libertinus@bfit{BoldItalic}% + }{% + \gdef\thu@font@family@libertinus@serif{libertinusserif}% + \gdef\thu@font@family@libertinus@sans{libertinussans}% + \gdef\thu@font@name@libertinus@math{libertinusmath-regular}% + \gdef\thu@font@style@libertinus@rm{regular}% + \gdef\thu@font@style@libertinus@bf{bold}% + \gdef\thu@font@style@libertinus@it{italic}% + \gdef\thu@font@style@libertinus@bfit{bolditalic}% + }% + \fi +} \newcommand\thu@set@font@libertinus{% \thu@set@libertinus@names \setmainfont{\thu@font@family@libertinus@serif}[ @@ -2273,22 +2423,26 @@ BoldItalicFont = *-boldoblique, ]% } +% \end{macrocode} +% +% New Computer Modern +% \begin{macrocode} \newcommand\thu@set@font@newcm{% - \setmathrm{NewCM10}[ + \setmainfont{NewCM10}[ Extension = .otf, UprightFont = *-Book, BoldFont = *-Bold, ItalicFont = *-BookItalic, BoldItalicFont = *-BoldItalic, ]% - \setmathsf{NewCMSans10}[ + \setsansfont{NewCMSans10}[ Extension = .otf, UprightFont = *-Book, BoldFont = *-Bold, ItalicFont = *-BookOblique, BoldItalicFont = *-BoldOblique, ]% - \setmathtt{NewCMMono10}[ + \setmonofont{NewCMMono10}[ Extension = .otf, UprightFont = *-Book, ItalicFont = *-BookItalic, @@ -2296,6 +2450,10 @@ BoldItalicFont = *-BoldOblique, ]% } +% \end{macrocode} +% +% Latin Modern +% \begin{macrocode} \newcommand\thu@set@font@lm{% \setmainfont{lmroman10}[ Extension = .otf, @@ -2347,8 +2505,11 @@ \fi \fi \fi +% \end{macrocode} +% +% Windows 的中易字体。 +% \begin{macrocode} \newcommand\thu@set@cjk@font@windows{% - \defaultCJKfontfeatures{Script=CJK}% \xeCJKsetup{EmboldenFactor=3}% \setCJKmainfont{SimSun}[ AutoFakeBold = true, @@ -2361,34 +2522,45 @@ \setCJKfamilyfont{zhkai}{KaiTi}% \setCJKfamilyfont{zhfs}{FangSong}% } +% \end{macrocode} +% +% macOS 的华文字体。 +% \begin{macrocode} \newcommand\thu@set@cjk@font@mac{% \defaultCJKfontfeatures{}% \setCJKmainfont{Songti SC}[ UprightFont = * Light, BoldFont = * Bold, - ItalicFont = Kaiti SC, + ItalicFont = Kaiti SC Regular, BoldItalicFont = Kaiti SC Bold, ]% - \setCJKsansfont{Heiti SC}[BoldFont=* Medium]% + \setCJKsansfont{Heiti SC}[ + UprightFont = * Light, + BoldFont = * Medium, + ]% \setCJKmonofont{STFangsong} \setCJKfamilyfont{zhsong}{Songti SC}[ - UprightFont = * Light, - BoldFont = * Bold, + UprightFont = * Light, + BoldFont = * Bold, ]% \setCJKfamilyfont{zhhei}{Heiti SC}[ - UprightFont = * Light, - BoldFont = * Medium, + UprightFont = * Light, + BoldFont = * Medium, ]% \setCJKfamilyfont{zhfs}{STFangsong}% - \setCJKfamilyfont{zhkai}{Kaiti SC}[BoldFont = * Bold]% + \setCJKfamilyfont{zhkai}{Kaiti SC}[ + UprightFont = * Regular, + BoldFont = * Bold, + ]% \setCJKfamilyfont{zhli}{Baoli SC}% \setCJKfamilyfont{zhyuan}{Yuanyi SC}[ - UprightFont = * Light, - BoldFont = * Bold, + UprightFont = * Light, + BoldFont = * Bold, ]% } % \end{macrocode} % +% 思源字体。 % 注意 Noto CJK 的 regular 字重名字不带“Regular”。 % \begin{macrocode} \newcommand\thu@set@cjk@font@noto{% @@ -2425,6 +2597,10 @@ UprightFont = *-Regular, ]% } +% \end{macrocode} +% +% Fandol 字体。 +% \begin{macrocode} \newcommand\thu@set@cjk@font@fandol{% \defaultCJKfontfeatures{}% \setCJKmainfont{FandolSong}[ @@ -2432,6 +2608,7 @@ UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = FandolKai-Regular, + ItalicFeatures = {Extension = .otf}, ]% \setCJKsansfont{FandolHei}[ Extension = .otf, @@ -2487,6 +2664,7 @@ integral-limits = false, partial = italic, math-ellipsis = AMS, + real-part = fraktur, }% \else \thusetup{ @@ -2494,19 +2672,20 @@ integral = upright, integral-limits = true, partial = upright, + real-part = roman, }% \ifthu@math@style@ISO \thusetup{ less-than-or-equal = horizontal, math-ellipsis = lower, - }% - \else + }% + \else \ifthu@math@style@GB \thusetup{ less-than-or-equal = slanted, math-ellipsis = centered, - }% - \fi + }% + \fi \fi \fi } @@ -2587,6 +2766,19 @@ \DeclareRobustCommand\mathellipsis{\mathinner{\unicodeellipsis}}% \fi } +\newcommand\thu@set@unimath@real@part{% + \ifthu@real@part@roman + \AtBeginDocument{% + \def\Re{\operatorname{Re}}% + \def\Im{\operatorname{Im}}% + }% + \else + \AtBeginDocument{% + \let\Re\thu@save@Re + \let\Im\thu@save@Im + }% + \fi +} \newcommand\thu@set@unimath@style{% \ifthu@uppercase@greek@upright \unimathsetup{math-style = TeX}% @@ -2610,6 +2802,7 @@ \fi \fi \thu@set@unimath@ellipsis + \thu@set@unimath@real@part } % \end{macrocode} % @@ -2621,6 +2814,8 @@ \AtBeginDocument{% \let\thu@save@leq\leq \let\thu@save@geq\geq + \let\thu@save@Re\Re + \let\thu@save@Im\Im }% % \end{macrocode} % @@ -2646,6 +2841,23 @@ } % \end{macrocode} % +% STIX Two Math +% \begin{macrocode} +\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}, + ]% +} +% \end{macrocode} +% +% XITS Math % \begin{macrocode} \newcommand\thu@xits@integral@stylistic@set{% \ifthu@integral@upright @@ -2664,51 +2876,26 @@ 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}, - ]% -} +% \end{macrocode} +% +% Libertinus Math +% \begin{macrocode} \newcommand\thu@libertinus@integral@stylistic@set{% - \ifthu@integral@italic + \ifthu@integral@slanted 8% \fi } \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, + \setmathfont{\thu@font@name@libertinus@math}[ + Extension = .otf, + StylisticSet = \thu@libertinus@integral@stylistic@set, ]% } +% \end{macrocode} +% +% New Computer Modern Math +% \begin{macrocode} \newcommand\thu@newcm@integral@stylistic@set{% \ifthu@integral@upright 2% @@ -2748,6 +2935,35 @@ } % \end{macrocode} % +% Latin Modern Math +% \begin{macrocode} +\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, + ]% +} +% \end{macrocode} +% +% NewTX Math % \begin{macrocode} \newcommand\thu@set@math@font@newtx{% \ifthu@font@newtx\else @@ -2787,6 +3003,12 @@ \else \DeclareRobustCommand\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}}% \fi + \let\thu@save@Re\Re + \let\thu@save@Im\Im + \ifthu@real@part@roman + \def\Re{\operatorname{Re}}% + \def\Im{\operatorname{Im}}% + \fi \RequirePackage{bm}% \ifthu@font@newtx\else \let\encodingdefault\thu@save@encodingdefault @@ -2823,113 +3045,6 @@ \AtEndPreamble{\thu@set@math@font@auto} % \end{macrocode} % -% \subsubsection{字号} -% -% \begin{macro}{\normalsize} -% 正文小四号(12bp)字,行距为固定值 20 bp。 -% 其他字号的行距按照相同的比例设置。 -% -% 表达式行的行距为单倍行距,段前空 6 磅,段后空 6 磅。 -% \begin{macrocode} -\renewcommand\normalsize{% - \@setfontsize\normalsize{12bp}{20bp}% - \abovedisplayskip 6bp% - \abovedisplayshortskip 6bp% - \belowdisplayshortskip 6bp% - \belowdisplayskip \abovedisplayskip -} -\normalsize -\ifx\MakeRobust\@undefined \else - \MakeRobust\normalsize -\fi -\DeclareRobustCommand\small{% - \@setfontsize\small{10.5bp}{17.5bp}% - \abovedisplayskip 6bp% - \abovedisplayshortskip 6bp% - \belowdisplayshortskip 6bp% - \def\@listi{\leftmargin\leftmargini - \topsep \z@skip - \parsep \z@skip - \itemsep \z@skip}% - \belowdisplayskip \abovedisplayskip -} -\DeclareRobustCommand\footnotesize{% - \@setfontsize\footnotesize{9bp}{15bp}% - \abovedisplayskip 6bp% - \abovedisplayshortskip 6bp% - \belowdisplayshortskip 6bp% - \def\@listi{\leftmargin\leftmargini - \topsep \z@skip - \parsep \z@skip - \itemsep \z@skip}% - \belowdisplayskip \abovedisplayskip -} -\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize{7.5bp}{12.5bp}} -\DeclareRobustCommand\tiny{\@setfontsize\tiny{6.5bp}{10.83bp}} -\DeclareRobustCommand\large{\@setfontsize\large{15bp}{25bp}} -\DeclareRobustCommand\Large{\@setfontsize\Large{18bp}{30bp}} -\DeclareRobustCommand\LARGE{\@setfontsize\LARGE{22bp}{36.67bp}} -\DeclareRobustCommand\huge{\@setfontsize\huge{24bp}{40bp}} -\DeclareRobustCommand\Huge{\@setfontsize\Huge{26bp}{43.33bp}} -% \end{macrocode} -% \end{macro} -% -% WORD 中的字号对应该关系如下(1bp = 72.27/72 pt): -% \begin{center} -% \begin{longtable}{llll} -% \toprule -% 初号 & 42bp & 14.82mm & 42.1575pt \\ -% 小初 & 36bp & 12.70mm & 36.135 pt \\ -% 一号 & 26bp & 9.17mm & 26.0975pt \\ -% 小一 & 24bp & 8.47mm & 24.09pt \\ -% 二号 & 22bp & 7.76mm & 22.0825pt \\ -% 小二 & 18bp & 6.35mm & 18.0675pt \\ -% 三号 & 16bp & 5.64mm & 16.06pt \\ -% 小三 & 15bp & 5.29mm & 15.05625pt \\ -% 四号 & 14bp & 4.94mm & 14.0525pt \\ -% 小四 & 12bp & 4.23mm & 12.045pt \\ -% 五号 & 10.5bp & 3.70mm & 10.59375pt \\ -% 小五 & 9bp & 3.18mm & 9.03375pt \\ -% 六号 & 7.5bp & 2.56mm & \\ -% 小六 & 6.5bp & 2.29mm & \\ -% 七号 & 5.5bp & 1.94mm & \\ -% 八号 & 5bp & 1.76mm & \\\bottomrule -% \end{longtable} -% \end{center} -% -% \begin{macro}{\thu@def@fontsize} -% 根据习惯定义字号。用法: -% -% \cs{thu@def@fontsize}\marg{字号名称}\marg{磅数} -% -% 避免了字号选择和行距的紧耦合。所有字号定义时为单倍行距,并提供选项指定行距倍数。 -% \begin{macrocode} -\def\thu@def@fontsize#1#2{% - \expandafter\newcommand\csname #1\endcsname[1][1.3]{% - \fontsize{#2}{##1\dimexpr #2}\selectfont}} -% \end{macrocode} -% \end{macro} -% -% 一组字号定义。 -% \begin{macrocode} -\thu@def@fontsize{chuhao}{42bp} -\thu@def@fontsize{xiaochu}{36bp} -\thu@def@fontsize{yihao}{26bp} -\thu@def@fontsize{xiaoyi}{24bp} -\thu@def@fontsize{erhao}{22bp} -\thu@def@fontsize{xiaoer}{18bp} -\thu@def@fontsize{sanhao}{16bp} -\thu@def@fontsize{xiaosan}{15bp} -\thu@def@fontsize{sihao}{14bp} -\thu@def@fontsize{xiaosi}{12bp} -\thu@def@fontsize{wuhao}{10.5bp} -\thu@def@fontsize{xiaowu}{9bp} -\thu@def@fontsize{liuhao}{7.5bp} -\thu@def@fontsize{xiaoliu}{6.5bp} -\thu@def@fontsize{qihao}{5.5bp} -\thu@def@fontsize{bahao}{5bp} -% \end{macrocode} -% % % \subsection{主文档格式} % \label{sec:mainbody} @@ -3238,9 +3353,9 @@ % % 设置浮动对象和文字之间的距离 % \begin{macrocode} -\setlength{\floatsep}{6bp} -\setlength{\textfloatsep}{6bp} -\setlength{\intextsep}{6bp} +\setlength{\floatsep}{12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength{\textfloatsep}{12\p@ \@plus 2\p@ \@minus 2\p@} +\setlength{\intextsep}{12\p@ \@plus 2\p@ \@minus 2\p@} \setlength{\@fptop}{0bp \@plus1.0fil} \setlength{\@fpsep}{12bp \@plus2.0fil} \setlength{\@fpbot}{0bp \@plus1.0fil} @@ -3353,7 +3468,7 @@ font = thu, labelsep = quad, aboveskip = 6bp, - belowskip = 6bp, + belowskip = 0bp, figureposition = bottom, tableposition = top, } @@ -4972,10 +5087,11 @@ statement-page-style = { name = statement@page@style, choices = { + auto, empty, plain, }, - default = empty, + default = auto, }, statement-page-number = { name = statement@page@number, @@ -5016,6 +5132,21 @@ \fi }% \kvsetkeys{thu@statement}{#1}% + \ifthu@statement@page@style@auto + \ifx\thu@statement@file\@empty + \ifthu@degree@bachelor + \thusetup{statement-page-style = empty}% + \else + \thusetup{statement-page-style = plain}% + \fi + \else + \ifthu@degree@bachelor + \thusetup{statement-page-style = plain}% + \else + \thusetup{statement-page-style = empty}% + \fi + \fi + \fi \ifx\thu@statement@file\@empty \thusetup{language=chinese}% \begingroup @@ -5028,9 +5159,7 @@ \fi \thu@chapter*{\thu@statement@name}% \endgroup - \ifthu@degree@bachelor - \thispagestyle{\thu@statement@page@style}% - \fi + \thispagestyle{\thu@statement@page@style}% \thu@statement@text\par \ifthu@degree@graduate \vskip 2cm% @@ -5045,9 +5174,7 @@ \markboth{\thu@statement@name}{}% \thu@phantomsection \addcontentsline{toc}{chapter}{\thu@statement@name}% - \ifthu@degree@bachelor\else - \thispagestyle{empty}% - \fi + \thispagestyle{\thu@statement@page@style}% }]{\thu@statement@file}% \fi \ifthu@degree@bachelor |