From d79a721c345c9a2ced6c0640e88c10cc3378c1f0 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 1 Jul 2020 03:03:30 +0000 Subject: CTAN sync 202007010303 --- macros/latex/contrib/shtthesis/CHANGELOG.md | 8 + macros/latex/contrib/shtthesis/README.md | 21 +- .../contrib/shtthesis/shtthesis-user-guide.pdf | Bin 2168060 -> 2172646 bytes .../contrib/shtthesis/shtthesis-user-guide.tex | 71 +++-- macros/latex/contrib/shtthesis/shtthesis.cls | 297 ++++++++++++--------- 5 files changed, 244 insertions(+), 153 deletions(-) (limited to 'macros/latex/contrib/shtthesis') diff --git a/macros/latex/contrib/shtthesis/CHANGELOG.md b/macros/latex/contrib/shtthesis/CHANGELOG.md index 135a61987a..9dd9f07ef4 100644 --- a/macros/latex/contrib/shtthesis/CHANGELOG.md +++ b/macros/latex/contrib/shtthesis/CHANGELOG.md @@ -2,6 +2,14 @@ `sht-thesis` 项目派生于 `ucasthesis`,一个在 GPLv3 License 下分发的项目。根据该许可证条款,`sht-thesis` 项目列出基于 `ucasthesis` (commit `faad94b` 之后) 的所有修改条目: +## 2020-06-30 +> Release: v0.3.1 + +1. 改进 Linux/UNIX 环境下 XeLaTeX 和 LuaLaTeX 引擎的中文字体回退机制; +2. unicode-math 仅对 `\mathbf` 强制使用 `\symbf` 覆盖,其他命令保持原有语义; +3. 确保 hyperref 宏包在导言区最后被导入; +4. 从该版本开始,所有 release 同步发布至 Overleaf (真香)。 + ## 2020-06-23 > Release: v0.3.0 diff --git a/macros/latex/contrib/shtthesis/README.md b/macros/latex/contrib/shtthesis/README.md index 582318cdbf..794511d3f2 100644 --- a/macros/latex/contrib/shtthesis/README.md +++ b/macros/latex/contrib/shtthesis/README.md @@ -1,8 +1,8 @@ # ShangHaiTech university THESIS (shtthesis) -[![Action status](https://github.com/lirundong/sht-thesis/workflows/Build/badge.svg)](https://github.com/lirundong/shtthesis/actions) -[![CTAN version](https://img.shields.io/ctan/v/shtthesis)](https://ctan.org/pkg/shtthesis) -[![GitHub release](https://img.shields.io/github/v/release/lirundong/shtthesis)](https://github.com/lirundong/shtthesis/releases/latest) -[![GitHub downloads](https://img.shields.io/github/downloads/lirundong/shtthesis/total)](https://github.com/lirundong/shtthesis/releases) +[![Action status](https://github.com/lirundong/sht-thesis/workflows/build/badge.svg)](https://github.com/lirundong/shtthesis/actions) +[![GitHub release](https://img.shields.io/github/v/release/lirundong/shtthesis?style=flat&logo=GitHub)](https://github.com/lirundong/shtthesis/releases/latest) +[![CTAN version](https://img.shields.io/ctan/v/shtthesis?style=flat&logo=LaTeX)](https://ctan.org/pkg/shtthesis) +[![Overleaf](https://img.shields.io/badge/overleaf-shtthesis-green?style=flat&logo=Overleaf&color=1C890F)](https://www.overleaf.com/latex/templates/shanghaitech-university-thesis-template/mskbxkmfxqpt) `shtthesis` project, forked from [`ucasthesis`](https://github.com/mohuangrui/ucasthesis), is an **unofficial** LaTeX thesis template for ShanghaiTech University and satisfies all format requirements of graduate/undergraduate thesis. The user just need to set `\documentclass{shtthesis}` and to setup mandatory information via `\shtsetup`, then his or her thesis document will be typeset properly: ```latex @@ -21,17 +21,22 @@ ``` ## Get the Template -- Stable version: +- Stable version: Install or download with any of following methods - CTAN (**strongly recommended**): [`shtthesis`](https://ctan.org/pkg/shtthesis) package on CTAN can be installed via `tlmgr` for TeX Live and MacTeX users: ```bash tlmgr install shtthesis ``` + If your distribution has already installed `shtthesis`, please update it to the latest version: + ```bash + tlmgr update shtthesis + ``` **Note**: `shtthesis` package on CTAN does not include the university logo file. Please download [`shanghaitech-logo.pdf`](https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf) from this repository and put it in the root of your project directory. - - GitHub Release: please refer to [release](https://github.com/lirundong/sht-thesis/releases) page, and download required files based on release information -- Develop version: directly clone the GitHub repo + - [Overleaf](https://www.overleaf.com/latex/templates/shanghaitech-university-thesis-template/mskbxkmfxqpt): Please compile with XeLaTeX. Since compilation time for Overleaf free-plan is limited to *1 minute*, you might encounter with timeout issue if compiling with LuaLaTeX + - GitHub Release: Please refer to the [release](https://github.com/lirundong/sht-thesis/releases) page and download required files based on release information +- Develop version: Directly clone the GitHub repo ```bash - git clone https://github.com/lirundong/sht-thesis.git + git clone https://github.com/lirundong/shtthesis.git ``` Please, read through [the user's guide](shtthesis-user-guide.pdf) before continuing. diff --git a/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf b/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf index 7ad2b160ca..3badd9ad13 100644 Binary files a/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf and b/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf differ diff --git a/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex b/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex index bacc45a16f..16e951a3ff 100644 --- a/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex +++ b/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex @@ -206,6 +206,13 @@ url = {http://oaa.shanghaitech.edu.cn/2019/0321/c4666a41070/page.htm}, urldate = {2020-06-17} } +@online{clerkma2013unicode, + author = {Clerk Ma}, + title = {如何在{XeTeX}中单独设置数学字体,为什么{STIX}的数学字体很牛?}, + year = 2013, + url = {https://www.zhihu.com/question/20592491/answer/15577847}, + urldate = {2020-06-30} +} \end{filecontents} \begin{document} @@ -230,14 +237,14 @@ \ifgraduate \begin{nomenclatures} \header[单位]{符号}{说明} - \item[${m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$R$}{the gas constant} - \item[${m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$C_v$}{specific heat capacity at constant volume} - \item[${m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$C_p$}{specific heat capacity at constant pressure} - \item[${m^{2} \cdot s^{-2}}$]{$E$}{specific total energy} - \item[${kg \cdot m \cdot s^{-3} \cdot K^{-1}}$]{$k$}{thermal conductivity} - \item[${kg \cdot m^{-1} \cdot s^{-2}}$]{$S_{ij}$}{deviatoric stress tensor} - \item[${kg \cdot m^{-1} \cdot s^{-2}}$]{$\tau_{ij}$}{viscous stress tensor} - \item[${1}$]{$\delta_{ij}$}{Kronecker tensor} + \item[$\symup{{m^{2} \cdot s^{-2} \cdot K^{-1}}}$]{$R$}{the gas constant} + \item[$\symup{{m^{2} \cdot s^{-2} \cdot K^{-1}}}$]{$C_v$}{specific heat capacity at constant volume} + \item[$\symup{{m^{2} \cdot s^{-2} \cdot K^{-1}}}$]{$C_p$}{specific heat capacity at constant pressure} + \item[$\symup{{m^{2} \cdot s^{-2}}}$]{$E$}{specific total energy} + \item[$\symup{{kg \cdot m \cdot s^{-3} \cdot K^{-1}}}$]{$k$}{thermal conductivity} + \item[$\symup{{kg \cdot m^{-1} \cdot s^{-2}}}$]{$S_{ij}$}{deviatoric stress tensor} + \item[$\symup{{kg \cdot m^{-1} \cdot s^{-2}}}$]{$\tau_{ij}$}{viscous stress tensor} + \item[$\symup{{1}}$]{$\delta_{ij}$}{Kronecker tensor} \end{nomenclatures} \begin{nomenclatures}[缩写] @@ -597,6 +604,16 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \end{align} 同时重载了 \verb|\eqref|,使得公式编号格式修改后,其引用格式仍与 \textsf{amsmath} 无异:贝叶斯定理~\eqref{eq::bayesian}。排版本科生论文时不修改公式编号格式。 +\shtthesis{} 使用 \textsf{unicode-math} 宏包进行公式排版,因此在数学环境内既可以用标准 \LaTeX{} 宏,也可以直接输入 Unicode 符号。例如 $\oiint$ 符号可以通过 \verb|\oiint| 宏录入,也可以通过 Unicode 符号 $∯$ (对应 \verb|U+0222F| 码点) 录入。以下测试公式来自 \citet{clerkma2013unicode},其中所有字符均直接使用对应 Unicode 符号录入。 +\begin{align} +& ⊢ ∀x[(Fx ∨ Gx) → \mathord{∼}Hx] \\ +& ⊨ ¬∃y∀x[x∈y ↔ x∉x] \\ +& ⊭ x ∩ (y ∪ z) ≠ (x ∩ y) ∪ (x ∩ z) \\ +& ⊢ ⟦α⟧ = ℵ₀ → α ≇ ℘(α) \\ +& ⌜ψ[(℩x)φx]⌝ ≝ ⌜(∃x)[φx ∧ (∀z)(φz ⊃ x=z) ∧ ψx]⌝ \\ +& ⊢ (P ⥽ Q) ⥽ (□P ⥽ ◇Q) +\end{align} + \subsection{数学环境} \shtthesis 通过 \textsf{amsthm} 宏包定义了常用的数学环境和证明环境,如表~\ref{tab::math_envs} 所列。其中,英文表示 tex 文档内调用的环境名称,中文表示排版后论文中显示的环境名称。 @@ -779,8 +796,8 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} 本章中的测试材料,数学公式部分来自 \textsf{ucasthesis} 附录 B\footnote{\url{https://github.com/mohuangrui/ucasthesis/blob/master/Tex/Appendix.tex}},生僻字部分来自《生僻字大全(按部首分类)》\footnote{\url{http://xh.5156edu.com/page/z4745m2559j18770.html}}。 \section{排版数学公式} -\providecommand{\Vector}[1]{\ensuremath{\mathbf{ #1 }}} -\providecommand{\Tensor}[1]{\ensuremath{\mathbf{\mathsf{ #1 }}}} +\providecommand{\Vector}[1]{\ensuremath{\symbf{ #1 }}} +\providecommand{\Tensor}[1]{\ensuremath{\symbfsf{ #1 }}} \begin{equation} \begin{cases} \frac{\partial \rho}{\partial t} + \nabla\cdot(\rho\Vector{V}) = 0 \\ @@ -789,26 +806,28 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian} \end{cases} \end{equation} \begin{equation} - \frac{\partial }{\partial t}\int\limits_{\Omega} u \, \mathrm{d}\Omega + \int\limits_{S} \Vector{n}\cdot(u\Vector{V}) \, \mathrm{d}S = \dot{\phi} + \frac{\partial }{\partial t}\int\limits_{\Omega} u \, \symup{d}\Omega + \int\limits_{S} \Vector{n}\cdot(u\Vector{V}) \, \symup{d}S = \dot{\phi} \end{equation} -\[ +\begin{equation*} \begin{split} - \mathcal{L} \{f\}(s) &= \int _{0^{-}}^{\infty} f(t) e^{-st} \, \mathrm{d}t, \ - \mathscr{L} \{f\}(s) = \int _{0^{-}}^{\infty} f(t) e^{-st} \, \mathrm{d}t\\ - \mathcal{F} {\bigl (} f(x+x_{0}) {\bigr )} &= \mathcal{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}}, \ - \mathscr{F} {\bigl (} f(x+x_{0}) {\bigr )} = \mathscr{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}} + \symcal{L} \{f\}(s) &= \int _{0^{-}}^{\infty} f(t) e^{-st} \, \symup{d}t, \ + \symscr{L} \{f\}(s) = \int _{0^{-}}^{\infty} f(t) e^{-st} \, \symup{d}t\\ + \symcal{F} {\bigl (} f(x+x_{0}) {\bigr )} &= \symcal{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}}, \ + \symscr{F} {\bigl (} f(x+x_{0}) {\bigr )} = \symscr{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}} \end{split} -\] - -Ordinary math: $A,F,L,2,3,5,\sigma$. \verb|\mathrm|: $\mathrm{A,F,L,2,3,5,\sigma}$. - -\verb|\mathbf|: $\mathbf{A,F,L,2,3,5,\sigma}$. \verb|\mathit|: $\mathit{A,F,L,2,3,5,\sigma}$. - -\verb|\mathsf|: $\mathsf{A,F,L,2,3,5,\sigma}$. \verb|\mathtt|: $\mathtt{A,F,L,2,3,5,\sigma}$. +\end{equation*} -\verb|\mathfrak|: $\mathfrak{A,F,L,2,3,5,\sigma}$. \verb|\mathbb|: $\mathbb{A,F,L,2,3,5,\sigma}$. - -\verb|\mathcal|: $\mathcal{A,F,L,2,3,5,\sigma}$. \verb|\mathscr|: $\mathscr{A,F,L,2,3,5,\sigma}$. +\begin{center} +\begin{tabular}{*{4}{l}} + \toprule + Ordinary math& $A,F,L,2,3,5,\sigma$& \verb|\symup|& $\symup{A,F,L,2,3,5,\sigma}$ \\ + \verb|\symbf|& $\symbf{A,F,L,2,3,5,\sigma}$& \verb|\symit|& $\symit{A,F,L,2,3,5,\sigma}$ \\ + \verb|\symsf|& $\symsf{A,F,L,2,3,5,\sigma}$& \verb|\symtt|& $\symtt{A,F,L,2,3,5,\sigma}$ \\ + \verb|\symfrak|& $\symfrak{A,F,L,2,3,5,\sigma}$& \verb|\symbb|& $\symbb{A,F,L,2,3,5,\sigma}$ \\ + \verb|\symcal|& $\symcal{A,F,L,2,3,5,\sigma}$& \verb|\symscr|& $\symscr{A,F,L,2,3,5,\sigma}$ \\ + \bottomrule +\end{tabular} +\end{center} \section{排版生僻字} \label{sec::chs_rare} {\songti 叧叨叭叱叴叵叺叻叼叽叾卟叿吀吁吂吅吆吇吋吒吔吖吘吙吚吜吡吢吣吤吥吧吩吪吭吮吰吱吲呐吷吺吽呁呃呄呅呇呉呋呋呌呍呎呏呐呒呓呔呕呗呙呚呛呜呝呞呟呠呡呢呣呤呥呦呧周呩呪呫呬呭呮呯呰呱呲呴呶呵呷呸呹呺呻呾呿咀咁咂咃咄咅咇咈咉咊咋咍咎咐咑咓咔咕咖咗咘咙咚咛咜咝咞咟咠咡咢咣咤咥咦咧咨咩咪咫咬咭咮咯咰咲咳咴咵咶啕咹咺咻呙咽咾咿哂哃哅哆哇哈哊哋哌哎哏哐哑哒哓哔哕哖哗哘哙哚哛哜哝哞哟哠咔哣哤哦哧哩哪哫哬哯哰唝哵哶哷哸哹哻哼哽哾哿唀唁唂唃呗唅唆唈唉唊唋唌唍唎唏唑唒唓唔唣唖唗唘唙吣唛唜唝唞唟唠唡唢唣唤唥唦唧唨唩唪唫唬唭唯唰唲唳唴唵唶唷念唹唺唻唼唽唾唿啀啁啃啄啅啇啈啉啋啌啍啎问啐啑啒启啔啕啖啖啘啙啚啛啜啝哑启啠啡唡衔啥啦啧啨啩啪啫啬啭啮啯啰啱啲啳啴啵啶啷啹啺啻啼啽啾啿喀喁喂喃善喅喆喇喈喉喊喋喌喍喎喏喐喑喒喓喔喕喖喗喙喛喞喟喠喡喢喣喤喥喦喨喩喯喭喯喰喱哟喳喴喵営喷喸喹喺喼喽喾喿嗀嗁嗂嗃嗄嗅呛啬嗈嗉唝嗋嗌嗍吗嗏嗐嗑嗒嗓嗕嗖嗗嗘嗙呜嗛嗜嗝嗞嗟嗠嗡嗢嗧嗨唢嗪嗫嗬嗭嗮嗰嗱嗲嗳嗴嗵哔嗷嗸嗹嗺嗻嗼嗽嗾嗿嘀嘁嘂嘃嘄嘅嘅嘇嘈嘉嘊嘋嘌喽嘎嘏嘐嘑嘒嘓呕嘕啧嘘嘙嘚嘛唛嘝嘞嘞嘟嘠嘡嘢嘣嘤嘥嘦嘧嘨哗嘪嘫嘬嘭唠啸囍嘴哓嘶嘷呒嘹嘺嘻嘼啴嘾嘿噀噂噃噄咴噆噇噈噉噊噋噌噍噎噏噐噑噒嘘噔噕噖噗噘噙噚噛噜咝噞噟哒噡噢噣噤哝哕噧噩噪噫噬噭噮嗳噰噱哙噳喷噵噶噷吨噺噻噼噽噾噿咛嚁嚂嚃嚄嚅嚆吓嚈嚉嚊嚋哜嚍嚎嚏尝嚑嚒嚓嚔噜嚖嚗嚘啮嚚嚛嚜嚝嚞嚟嚠嚡嚢嚣嚤呖嚧咙嚩咙嚧嚪嚫嚬嚭嚯嚰嚱亸喾嚵嘤嚷嚸嚹嚺嚻嚼嚽嚾嚿啭嗫嚣囃囄冁囆囇呓囊囋囍囎囏囐嘱囒啮囔囕囖} diff --git a/macros/latex/contrib/shtthesis/shtthesis.cls b/macros/latex/contrib/shtthesis/shtthesis.cls index da48bb990b..1d616c240c 100644 --- a/macros/latex/contrib/shtthesis/shtthesis.cls +++ b/macros/latex/contrib/shtthesis/shtthesis.cls @@ -17,8 +17,8 @@ % Identification % ============================================================================== \NeedsTeXFormat{LaTeX2e} -\newcommand\version{0.3.0} -\newcommand\versiondate{2020/06/23} +\newcommand\version{0.3.1} +\newcommand\versiondate{2020/06/30} \ProvidesClass{shtthesis}[% \versiondate\space% v\version\space% @@ -295,6 +295,7 @@ }{ctexbook} \PassOptionsToPackage{ natbib = true, + hyperref = manual, backend = biber, gbpub = false, gbcitelocal = chinese, @@ -320,15 +321,12 @@ \RequirePackage[shortlabels, inline]{enumitem} \RequirePackage{mathtools} \RequirePackage{amsthm} -\RequirePackage[ - mathrm = sym, - mathit = sym, - mathbf = sym, - mathtt = sym, -]{unicode-math} -\RequirePackage{hyperref} +\RequirePackage[mathbf=sym]{unicode-math} \RequirePackage{biblatex} \AtEndPreamble{ + \RequirePackage{hyperref} + \addbibresource{\sht@bib@resource} + \BiblatexManualHyperrefOn \hypersetup{ pdfencoding = auto, psdextra = true, @@ -346,14 +344,6 @@ \definecolor{fdu@link}{HTML}{990000} \definecolor{fdu@url}{HTML}{0000B2} \definecolor{fdu@cite}{HTML}{007F00} - % `classic' color scheme from `fduthesis' - \definecolor{classic@link}{HTML}{FF0000} - \definecolor{classic@url}{HTML}{0000FF} - \definecolor{classic@cite}{HTML}{00FF00} - % `science' color scheme from `fduthesis' - \definecolor{science@link}{HTML}{CA0619} - \definecolor{science@url}{HTML}{389F9D} - \definecolor{science@cite}{HTML}{FF8920} \hypersetup{ colorlinks = true, linkcolor = fdu@link, @@ -362,7 +352,6 @@ } \fi \urlstyle{tt} - \addbibresource{\sht@bib@resource} } % ============================================================================== % Format Specifications @@ -382,7 +371,10 @@ \def\tablename{表} \def\figurename{图} \definecolor{ShtRed}{RGB}{146,46,23} -\def\school@logo@missing{校徽文件缺失,请至\href{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf}{项目主页}下载!} +\def\school@logo@missing{% + 校徽文件缺失,请至\href{https://github.com/lirundong/shtthesis/raw/master/% + shanghaitech-logo.pdf}{项目主页}下载!% +} % ------------------------------------------------------------------------------ % Geometry and layouts % ------------------------------------------------------------------------------ @@ -550,61 +542,61 @@ % ------------------------------------------------------------------------------ \ifthenelse{\equal{\sht@fontset}{windows}}{ \def\fake@bold@factor{2.5} - \setCJKmainfont[ - AutoFakeBold = \fake@bold@factor, - ItalicFont = KaiTi, - ]{SimSun} - \setCJKsansfont[ - AutoFakeBold = \fake@bold@factor, - ]{SimHei} - \setCJKfamilyfont{zhsong}[ - AutoFakeBold = \fake@bold@factor, - ]{SimSun} - \setCJKfamilyfont{zhhei}[ - AutoFakeBold = \fake@bold@factor, - ]{SimHei} - \setCJKfamilyfont{zhkai}[ - AutoFakeBold = \fake@bold@factor, - ]{KaiTi} + \setCJKmainfont{SimSun}[ + AutoFakeBold = \fake@bold@factor, + ItalicFont = KaiTi, + ] + \setCJKsansfont{SimHei}[ + AutoFakeBold = \fake@bold@factor, + ] + \setCJKfamilyfont{zhsong}{SimSun}[ + AutoFakeBold = \fake@bold@factor, + ] + \setCJKfamilyfont{zhhei}{SimHei}[ + AutoFakeBold = \fake@bold@factor, + ] + \setCJKfamilyfont{zhkai}{KaiTi}[ + AutoFakeBold = \fake@bold@factor, + ] }{ \ifthenelse{\equal{\sht@fontset}{mac}}{ - \setCJKmainfont[ - UprightFont = * Regular, - BoldFont = * Bold, - ItalicFont = Kaiti SC Regular, - BoldItalicFont = Kaiti SC Bold, - ]{Songti SC} - \setCJKsansfont[ - UprightFont = * Light, - BoldFont = * Medium, - ]{Heiti SC} - \setCJKfamilyfont{zhsong}[ - UprightFont = * Regular, - BoldFont = * Bold, - ]{Songti SC} - \setCJKfamilyfont{zhhei}[ - UprightFont = * Light, - BoldFont = * Medium, - ]{Heiti SC} - \setCJKfamilyfont{zhkai}[ - UprightFont = * Regular, - BoldFont = * Bold, - ]{Kaiti SC} + \setCJKmainfont{Songti SC}[ + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = Kaiti SC Regular, + BoldItalicFont = Kaiti SC Bold, + ] + \setCJKsansfont{Heiti SC}[ + UprightFont = * Light, + BoldFont = * Medium, + ] + \setCJKfamilyfont{zhsong}{Songti SC}[ + UprightFont = * Regular, + BoldFont = * Bold, + ] + \setCJKfamilyfont{zhhei}{Heiti SC}[ + UprightFont = * Light, + BoldFont = * Medium, + ] + \setCJKfamilyfont{zhkai}{Kaiti SC}[ + UprightFont = * Regular, + BoldFont = * Bold, + ] }{ - \IfFontExistsTF{Source Han Serif SC}{ - \def\unix@songti{Source Han Serif SC} + \IfFontExistsTF{Noto Serif CJK SC}{ + \def\unix@songti{Noto Serif CJK SC} }{ - \IfFontExistsTF{Noto Serif CJK SC}{ - \def\unix@songti{Noto Serif CJK SC} + \IfFontExistsTF{Source Han Serif SC}{ + \def\unix@songti{Source Han Serif SC} }{ \def\unix@songti{FandolSong} } } - \IfFontExistsTF{Source Han Sans SC}{ - \def\unix@heiti{Source Han Sans SC} + \IfFontExistsTF{Noto Sans CJK SC}{ + \def\unix@heiti{Noto Sans CJK SC} }{ - \IfFontExistsTF{Noto Sans CJK SC}{ - \def\unix@heiti{Noto Sans CJK SC} + \IfFontExistsTF{Source Han Sans SC}{ + \def\unix@heiti{Source Han Sans SC} }{ \def\unix@heiti{FandolHei} } @@ -626,13 +618,75 @@ }{ \def\unix@fangsong{FandolFang} } - \setCJKmainfont[ItalicFont=\unix@kaiti]{\unix@songti} - \setCJKsansfont[BoldFont=\unix@heiti@bold]{\unix@heiti} - \setCJKmonofont{\unix@fangsong} - \setCJKfamilyfont{zhsong}{\unix@songti} - \setCJKfamilyfont{zhhei}{\unix@heiti} - \setCJKfamilyfont{zhkai}{\unix@kaiti} - \setCJKfamilyfont{zhfs}{\unix@fangsong} + \ifluatex + \setCJKmainfont{\unix@songti}[ItalicFont=\unix@kaiti] + \setCJKsansfont{\unix@heiti}[BoldFont=\unix@heiti@bold] + \setCJKmonofont{\unix@fangsong} + \setCJKfamilyfont{zhsong}{\unix@songti} + \setCJKfamilyfont{zhhei}{\unix@heiti}[BoldFont=\unix@heiti@bold] + \setCJKfamilyfont{zhkai}{\unix@kaiti} + \setCJKfamilyfont{zhfs}{\unix@fangsong} + \else + \ifthenelse{\equal{\unix@songti}{FandolSong}}{ + \setCJKmainfont{FandolSong}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = FandolKai-Regular, + ] + \setCJKfamilyfont{zhsong}{FandolSong}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ] + }{ + \ifthenelse{\equal{\unix@kaiti}{FandolKai}}{ + \setCJKmainfont{\unix@songti}[ + ItalicFont = FandolKai-Regular, + ItalicFeatures = {Extension = .otf}, + ] + }{ + \setCJKmainfont{\unix@songti}[ItalicFont=\unix@kaiti] + } + \setCJKfamilyfont{zhsong}{\unix@songti} + } + \ifthenelse{\equal{\unix@heiti}{FandolHei}}{ + \setCJKsansfont{FandolHei}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ] + \setCJKfamilyfont{zhhei}{FandolHei}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ] + }{ + \setCJKsansfont{\unix@heiti}[BoldFont=\unix@heiti@bold] + \setCJKfamilyfont{zhhei}{\unix@heiti}[BoldFont=\unix@heiti@bold] + } + \ifthenelse{\equal{\unix@kaiti}{FandolKai}}{ + \setCJKfamilyfont{zhkai}{FandolKai}[ + Extension = .otf, + UprightFont = *-Regular, + ] + }{ + \setCJKfamilyfont{zhkai}{\unix@kaiti} + } + \ifthenelse{\equal{\unix@fangsong}{FandolFang}}{ + \setCJKfamilyfont{zhfs}{FandolFang}[ + Extension = .otf, + UprightFont = *-Regular, + ] + \setCJKmonofont{FandolFang}[ + Extension = .otf, + UprightFont = *-Regular, + ] + }{ + \setCJKmonofont{\unix@fangsong} + \setCJKfamilyfont{zhfs}{\unix@fangsong} + } + \fi \providecommand{\songti}{\CJKfamily{zhsong}} \providecommand{\heiti}{\CJKfamily{zhhei}} \providecommand{\kaishu}{\CJKfamily{zhkai}} @@ -683,37 +737,22 @@ % Math fonts % ------------------------------------------------------------------------------ \IfFontExistsTF{XITSMath-Regular.otf}{ - \setmathfont{XITSMath-Regular} [ - Extension = .otf, - BoldFont = XITSMath-Bold, - StylisticSet = 8, - ] - \setmathfont{XITSMath-Regular.otf} [ - range = {cal, bfcal}, - StylisticSet = 1, - ] - \setmathfont{XITSMath-Regular.otf} [ - range = {scr, bfscr}, - StylisticSet = 2, - ] + \def\sht@math@font{XITSMath-Regular.otf} }{ - \setmathfont{xits-math} [ - Extension = .otf, - BoldFont = *bold, - StylisticSet = 8, - ] - \setmathfont{xits-math.otf} [ - range = {cal, bfcal}, - StylisticSet = 1, - ] - \setmathfont{xits-math.otf} [ - range = {scr, bfscr}, - StylisticSet = 2, - ] + \def\sht@math@font{xits-math.otf} } -\IfFontExistsTF{FiraMath-Regular.otf}{ - \setmathfontface\mathsf{FiraMath-Regular.otf} -}{} +\setmathfont{\sht@math@font}[ + StylisticSet = 8, % upright integral variants, please refer to stix2-otf doc +] +% please refer to "Caligraphic vs. Script variants" section of unicode-math doc +\setmathfont{\sht@math@font}[ + range = {cal, bfcal}, + StylisticSet = 1, +] +\setmathfont{\sht@math@font}[ + range = {scr, bfscr}, + StylisticSet = 2, +] % ------------------------------------------------------------------------------ % Math environmrnts % ------------------------------------------------------------------------------ @@ -732,7 +771,8 @@ \theoremstyle{remark} \newtheorem{remark}{注}[chapter] \renewcommand*{\proofname}{证明} -\expandafter\patchcmd\csname\string\proof\endcsname{\@addpunct{.}}{\@addpunct{\emph{:}}}{}{} +\expandafter\patchcmd\csname\string\proof\endcsname{\@addpunct{.}}% + {\@addpunct{\emph{:}}}{}{} % ------------------------------------------------------------------------------ % Utility functions for ToC and bookmarks % ------------------------------------------------------------------------------ @@ -1158,14 +1198,17 @@ \fi% }}} \\ \ifdefempty{\sht@supervisor@institution}{}{ & - \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@supervisor@institution}}} \\ + \multicolumn{2}{c}{\shifted@uline{% + \shifted@box{\sht@supervisor@institution}}} \\ } 学位类别:& \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@degree@name}}} \\ 一级学科:& - \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@discipline@level@i}}} \\ + \multicolumn{2}{c}{\shifted@uline{% + \shifted@box{\sht@discipline@level@i}}} \\ \multicolumn{2}{l}{学校/学院名称:} & - \shifted@uline{\shifted@box[\cover@tab@last@entry@width]{\sht@institution}} \\ + \shifted@uline{\shifted@box[\cover@tab@last@entry@width]{% + \sht@institution}} \\ \end{tabular} } @@ -1263,22 +1306,28 @@ [\cover@tab@entry@width@undergraduate]{\sht@title} \\ 学生姓名:& \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@author}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]{% + \sht@author}} \\ 学\hspace{2\ccwd}号:& \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@author@id}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]{% + \sht@author@id}} \\ 入学年份:& \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@entrance@year}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]{% + \sht@entrance@year}} \\ 所在学院:& \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@institution}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]{% + \sht@institution}} \\ 攻读专业:& \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@discipline}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]{% + \sht@discipline}} \\ 指导教师:& \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@supervisor}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]{% + \sht@supervisor}} \\ \end{tabular} } @@ -1316,25 +1365,32 @@ \begin{tabular}{lc} Subject: & \sht@lines@to@tab[\cover@tab@uline@thick@undergraduate]% - [\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@title@en} \\ + [\cover@tab@entry@width@undergraduate][\content@left@shift@en]{% + \sht@title@en} \\ Student Name: & \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@author@en}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]% + [\content@left@shift@en]{\sht@author@en}} \\ Student ID: & \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@author@id}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]% + [\content@left@shift@en]{\sht@author@id}} \\ Year of Entrance: & \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@entrance@year}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]% + [\content@left@shift@en]{\sht@entrance@year}} \\ School: & \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@institution@en}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]% + [\content@left@shift@en]{\sht@institution@en}} \\ Major: & \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@discipline@en}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]% + [\content@left@shift@en]{\sht@discipline@en}} \\ Advisor: & \shifted@uline[\cover@tab@uline@thick@undergraduate]% - {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@supervisor@en}} \\ + {\shifted@box[\cover@tab@entry@width@undergraduate]% + [\content@left@shift@en]{\sht@supervisor@en}} \\ \end{tabular} } @@ -1395,7 +1451,8 @@ {\hfill{}作者签名:\hspace*{10em}导师签名:\hspace*{9em}} - {\hfill{}日\hspace*{2\ccwd}期:\hspace*{10em}日\hspace*{2\ccwd}期:\hspace*{9em}} + \hfill{}日\hspace*{2\ccwd}期:% + \hspace*{10em}日\hspace*{2\ccwd}期:\hspace*{9em}% \vspace{3ex} } @@ -1593,7 +1650,9 @@ \providecommand{\makebiblio}{% \renewcommand{\bibfont}{\zihao{5}}% \intotoc*{\cleardoublepage}{\bibname}% + \urlstyle{same}% \printbibliography% + \urlstyle{tt}% } % ------------------------------------------------------------------------------ % Appendix -- cgit v1.2.3