Skip to content

Commit d2bac1d

Browse files
committed
Rewrite template with LaTeX3
Check package compatibility Set languages Set font sizes Set fonts [WIP] Set math fonts Set CJK fonts Set page style Rewrite title page Rewrite English title page Rewrite \maketitle Rewrite statement Rewrite section headings format Rewrite abstract Rewrite toc Rewrite nomenclature Rewrite footnote Rewrite list format Rewrite figure and table format Rewrite equation format Rewrite bibtex format Set biblatex format Set acknowledgements format Add test for deprecations Set achievements format Rewrite hyperref patch Rewrite amsthm patch Add amsthm test Rewrite algorithm2e patch Add algorithm2e test Rewrite mathtools patch Rewrite siunitx patch Rewrite chapterbib patch Remove \ustc@warning Move option degree Move option degree-type Move option language Move option review Move font options Add math-style test Move option math-style Move option cite-style Move option output Move option section-style Move option badge-color Move option eqn-paren-style Rmove old options
1 parent b435168 commit d2bac1d

6 files changed

Lines changed: 3529 additions & 3146 deletions

File tree

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"files.associations": {
3+
"*.cls": "latex-expl3",
34
"*.lvt": "latex",
4-
"*.tlg": "latex",
5+
"*.tlg": "latex-expl3",
56
"*latexmkrc": "perl",
67
"tl_packages*": "shellscript"
78
},

tests/testfiles/deprecated.tlg

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
This is a generated file for the l3build validation system.
22
Don't change this file in any respect.
3-
Class ustcthesis Warning: The '\title' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
4-
Class ustcthesis Warning: The '\entitle' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
5-
Class ustcthesis Warning: The '\author' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
6-
Class ustcthesis Warning: The '\enauthor' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
7-
Class ustcthesis Warning: The '\major' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
8-
Class ustcthesis Warning: The '\enmajor' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
9-
Class ustcthesis Warning: The '\supervisor' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
10-
Class ustcthesis Warning: The '\ensupervisor' command is deprecated since ....-..-... Use '\ustcsetup' instead. on input line ....
11-
Class ustcthesis Warning: The 'professional-type' option is obsolete. on input line ....
12-
Class ustcthesis Warning: The 'professional-type*' option is obsolete. on input line ....
13-
Class ustcthesis Warning: The '\copyrightpage' command is deprecated since ....-..-... Use '\statement' instead. on input line ....
3+
Class ustcthesis Warning: The "\title" command is deprecated since ....-..-...
4+
(ustcthesis) Use "\ustcsetup" with "title" option instead.
5+
Class ustcthesis Warning: The "\entitle" command is deprecated since ....-..-...
6+
(ustcthesis) Use "\ustcsetup" with "title*" option instead.
7+
Class ustcthesis Warning: The "\author" command is deprecated since ....-..-...
8+
(ustcthesis) Use "\ustcsetup" with "author" option instead.
9+
Class ustcthesis Warning: The "\enauthor" command is deprecated since ....-..-...
10+
(ustcthesis) Use "\ustcsetup" with "author*" option instead.
11+
Class ustcthesis Warning: The "\major" command is deprecated since ....-..-...
12+
(ustcthesis) Use "\ustcsetup" with "speciality" option instead.
13+
Class ustcthesis Warning: The "\enmajor" command is deprecated since ....-..-...
14+
(ustcthesis) Use "\ustcsetup" with "speciality*" option instead.
15+
Class ustcthesis Warning: The "\supervisor" command is deprecated since ....-..-...
16+
(ustcthesis) Use "\ustcsetup" with "supervisor" option instead.
17+
Class ustcthesis Warning: The "\ensupervisor" command is deprecated since ....-..-...
18+
(ustcthesis) Use "\ustcsetup" with "supervisor*" option instead.
19+
Class ustcthesis Warning: The "advisor" option is deprecated since ....-..-...
20+
(ustcthesis) Use "practice-supervisor" instead.
21+
Class ustcthesis Warning: The "advisor*" option is deprecated since ....-..-...
22+
(ustcthesis) Use "practice-supervisor*" instead.
23+
Class ustcthesis Warning: The "professional-type" option is no longer required and is obsolete since ....-..-...
24+
Class ustcthesis Warning: The "professional-type*" option is no longer required and is obsolete since ....-..-...
25+
Class ustcthesis Warning: The "\copyrightpage" command is deprecated since ....-..-...
26+
(ustcthesis) Use "\statement" instead.
1427
Package fontspec Info:
1528
(fontspec) Font family 'FandolHei(0)' created for font 'FandolHei' with options [Extension={.otf},UprightFont={*-Regular},BoldFont={*-Bold}].
1629
(fontspec)
@@ -40,19 +53,25 @@ LaTeX Font Info: Font shape `TU/STIXTwoMath-Regular(0)/m/n' will be
4053
(Font) scaled to size 6.87555pt on input line ....
4154
[1
4255
]
43-
Class ustcthesis Warning: The '\makestatement' command is deprecated since ....-..-... Use '\statement' instead. on input line ....
56+
Class ustcthesis Warning: The "\makestatement" command is deprecated since ....-..-...
57+
(ustcthesis) Use "\statement" instead.
4458
[2
4559
] [3] [4
4660
]
47-
Class ustcthesis Warning: The 'enabsctract' environment is deprecated since ....-..-... Use 'abstract*' instead. on input line ....
61+
Class ustcthesis Warning: The "enabsctract" environment is deprecated since ....-..-...
62+
(ustcthesis) Use "abstract*" instead.
4863
[1
4964
] [2
5065
]
5166
第1章
52-
Class ustcthesis Warning: The '\note' command is deprecated since ....-..-... Use '\figurenote' instead. on input line ....
67+
Class ustcthesis Warning: The "\note" command is deprecated since ....-..-...
68+
(ustcthesis) Use "\figurenote" or "\tablenote" instead.
5369
[1
5470
]
55-
Class ustcthesis Warning: The 'publications' environment is deprecated since ....-..-... Use 'achievements' instead. on input line ....
71+
Class ustcthesis Warning: The "acknowledgments" environment is deprecated since ....-..-...
72+
(ustcthesis) Use "acknowledgements" instead.
73+
Class ustcthesis Warning: The "publications" environment is deprecated since ....-..-...
74+
(ustcthesis) Use "achievements" instead.
5675
[2
5776
] [3
5877
]

tests/testfiles/title-page-doctor-academic.tlg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ Completed box being shipped out [3]
490490
...\glue(\parskip) 0.0
491491
...\glue(\parskip) 0.0
492492
...\glue(\baselineskip) 7.91158
493-
...\hbox(17.82458+5.68924)x417.11752, glue set 34.084fil
493+
...\hbox(17.82458+5.68924)x417.11752, glue set 31.78743fil
494494
....\glue(\leftskip) 0.0 plus 1.0fil
495495
....\hbox(0.0+0.0)x0.0
496496
....\TU/texgyretermes(0)/m/n/26.09749 A
@@ -499,7 +499,7 @@ Completed box being shipped out [3]
499499
....\glue 6.52437 plus 3.26218 minus 2.17479
500500
....\TU/texgyretermes(0)/m/n/26.09749 for
501501
....\glue 6.52437 plus 3.26218 minus 2.17479
502-
....\TU/texgyretermes(0)/m/n/26.09749 doctors
502+
....\TU/texgyretermes(0)/m/n/26.09749 doctors
503503
....\glue 6.52437 plus 3.26218 minus 2.17479
504504
....\TU/texgyretermes(0)/m/n/26.09749 degree
505505
....\kern -0.0002

ustcsetup.tex

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,15 @@
7979
\graphicspath{{figures/}}
8080

8181
% 数学命令
82-
\makeatletter
83-
\newcommand\dif{% % 微分符号
84-
\mathop{}\!%
85-
\ifustc@math@style@TeX
86-
d%
87-
\else
88-
\mathrm{d}%
89-
\fi
90-
}
91-
\makeatother
82+
\ExplSyntaxOn
83+
\NewDocumentCommand \dif {} % 微分符号
84+
{
85+
\mathop { } \!
86+
\str_if_eq:VnTF \l__ustc_math_style_str { TeX }
87+
{ d }
88+
{ \mathrm { d } }
89+
}
90+
\ExplSyntaxOff
9291
\newcommand\eu{{\symup{e}}}
9392
\newcommand\iu{{\symup{i}}}
9493

ustcthesis-authoryear.cbx

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,40 @@
33

44
\RequireCitationStyle{gb7714-2015ay}
55

6-
\renewrobustcmd{\mkbibleftborder}{%
7-
\ifustc@language@chinese
8-
%
9-
\else
10-
(%
11-
\fi
12-
}
13-
\renewrobustcmd{\mkbibrightborder}{%
14-
\ifustc@language@chinese
15-
%
16-
\else
17-
)%
18-
\fi
19-
}
20-
\def\gbpunctcommacite{%
21-
\ifustc@language@chinese
22-
%
23-
\else
24-
\addcomma\space
25-
\fi
26-
}
27-
\def\gbpunctmarkcite{%
28-
\ifustc@language@chinese
29-
%
30-
\else
31-
\addcomma\space
32-
\fi
6+
\ExplSyntaxOn
7+
\renewrobustcmd \mkbibleftborder
8+
{
9+
\bool_if:NTF \l__ustc_language_chinese_bool
10+
{ ( }
11+
{ ( }
12+
}
13+
14+
\renewrobustcmd \mkbibrightborder
15+
{%
16+
\bool_if:NTF \l__ustc_language_chinese_bool
17+
{ ) }
18+
{ ) }
19+
}
20+
21+
\cs_set_nopar:Npn \gbpunctcommacite
22+
{
23+
\bool_if:NTF \l__ustc_language_chinese_bool
24+
{ , }
25+
{ \addcomma \space }
26+
}
27+
28+
\cs_set_nopar:Npn \gbpunctmarkcite
29+
{
30+
\bool_if:NTF \l__ustc_language_chinese_bool
31+
{ , }
32+
{ \addcomma \space }
3333
}
34-
\def\gbpunctsemicoloncite{%
35-
\ifustc@language@chinese
36-
%
37-
\else
38-
\addsemicolon\space
39-
\fi
34+
35+
\cs_set_nopar:Npn \gbpunctsemicoloncite
36+
{
37+
\bool_if:NTF \l__ustc_language_chinese_bool
38+
{ ; }
39+
{ \addsemicolon \space }
4040
}
41+
42+
\ExplSyntaxOff

0 commit comments

Comments
 (0)