summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/shtthesis/shtthesis.cls
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-07-01 03:03:30 +0000
committerNorbert Preining <norbert@preining.info>2020-07-01 03:03:30 +0000
commitd79a721c345c9a2ced6c0640e88c10cc3378c1f0 (patch)
tree400d84326bfe896b980146734c9650006b72e550 /macros/latex/contrib/shtthesis/shtthesis.cls
parent70c32b2936f7dac3a0898faafe7c554c3bedeae9 (diff)
CTAN sync 202007010303
Diffstat (limited to 'macros/latex/contrib/shtthesis/shtthesis.cls')
-rw-r--r--macros/latex/contrib/shtthesis/shtthesis.cls297
1 files changed, 178 insertions, 119 deletions
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