Skip to content

Commit ea40cc5

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 b79c387 commit ea40cc5

18 files changed

+3715
-3211
lines changed

.github/tl_packages

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,70 +3,93 @@ l3build
33
latexmk
44
#
55
# Required to build formats
6-
bibtex
76
latex-bin
8-
makeindex
97
tex
108
#
119
# Assuming a 'basic' font set up, metafont is required to avoid
1210
# warnings with some packages and errors with others
1311
metafont
1412
mfware
1513
#
16-
# Dependencies for xeCJK
14+
# Dependencies for ustcthesis
15+
amsmath
16+
bigfoot # perpage.sty for footmisc
17+
caption
18+
ctex
19+
enumitem
20+
etoolbox
21+
fancyhdr
22+
fontspec
23+
footmisc
24+
geometry
25+
graphics
26+
multirow
27+
notoccite
28+
titlesec
29+
unicode-math
30+
url
31+
#
32+
# Fonts
33+
fandol
34+
libertinus-fonts
35+
newcomputermodern
36+
newtx
37+
stix2-otf
38+
tex-gyre
39+
xits
40+
#
41+
# Dependencies for ctex
42+
cjk
43+
zhnumber
44+
#
45+
# Dependencies for XeTeX
1746
fontspec
1847
ulem
1948
xecjk
2049
xetex
50+
#
2151
# Dependencies for LuaTeX
2252
chinese-jfm
2353
lualatex-math
54+
luatex
2455
#
25-
# Dependencies for ctex
26-
cjk
27-
ctex
28-
zhnumber
56+
# Extra packages
57+
algorithm2e
58+
amscls # amsthm.sty
59+
booktabs
60+
hyperref
61+
mathtools
62+
nomencl
63+
siunitx
64+
threeparttable
65+
tools # longtable.sty
2966
#
3067
# Dependencies for algorithm2e
31-
algorithm2e
3268
ifoddpage
3369
relsize
3470
#
71+
# Dependencies for bitex
72+
bibtex
73+
natbib
74+
#
3575
# Dependencies for biblatex
3676
biber
3777
biblatex
3878
biblatex-gb7714-2015
3979
xstring
4080
#
81+
# Dependencies for hyperref
82+
hycolor
83+
infwarerr
84+
#
4185
# Dependencies for nomencl
42-
nomencl
43-
koma-script
86+
makeindex
4487
xkeyval
4588
#
46-
# Dependencies for ustcthesis
47-
bigfoot
48-
caption
49-
enumitem
50-
fancyhdr
51-
footmisc
52-
filehook
53-
natbib
54-
notoccite
55-
multirow
56-
titlesec
57-
unicode-math
58-
#
59-
# Dependencies for fonts
60-
fandol
61-
stix2-otf
62-
tex-gyre
63-
xits
64-
#
65-
# Dependencies for extra packages
66-
booktabs
67-
mathtools
68-
threeparttable
69-
siunitx
89+
# Dependencies for newtx
90+
xpatch
91+
carlisle # scalefnt.sty
92+
oberdiek # centernot.sty
7093
#
7194
# Dependencies for doc
7295
hypdoc

.github/workflows/test.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ jobs:
1515
uses: actions/checkout@v6
1616

1717
- name: Set up TeX Live
18-
uses: zauguin/install-texlive@v4
18+
uses: TeX-Live/setup-texlive-action@v3
1919
with:
20-
package_file: .github/tl_packages
20+
package-file: .github/tl_packages
21+
# uses: zauguin/install-texlive@v4
22+
# with:
23+
# package_file: .github/tl_packages
2124

2225
- name: Test example
2326
run: make main
@@ -40,3 +43,37 @@ jobs:
4043
name: testfiles
4144
path: build/**/*.diff
4245
retention-days: 3
46+
47+
test-historic:
48+
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
49+
name: Test TeX Live ${{ matrix.version }}
50+
runs-on: ubuntu-latest
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
version: [2025, 2024, 2023, 2022, 2021]
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v6
58+
59+
- name: Set up TeX Live ${{ matrix.version }}
60+
uses: TeX-Live/setup-texlive-action@v3
61+
with:
62+
version: ${{ matrix.version }}
63+
# package-file: .github/tl_packages_${{ matrix.version }}
64+
package-file: .github/tl_packages
65+
# uses: zauguin/install-texlive@v4
66+
# with:
67+
# texlive_version: ${{ matrix.version }}
68+
# package_file: .github/tl_packages_${{ matrix.version }}
69+
70+
- name: Test example
71+
run: make main
72+
73+
- name: Test example with LuaTeX
74+
run: |
75+
make clean
76+
latexmk -lualatex main.tex
77+
78+
- name: Test doc
79+
run: make doc

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
"files.associations": {
3+
"*.cls": "latex-expl3",
4+
"*.lvt": "latex-expl3",
5+
"*.sty": "latex-expl3",
6+
"*.tlg": "latex-expl3",
7+
"tl_packages*": "shellscript",
8+
},
29
"latex-workshop.intellisense.unimathsymbols.enabled": true,
310
"latex-workshop.latex.recipes": [
411
{

build.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ excludetests = {
2929
"font-mac",
3030
}
3131

32-
checkopts = "-file-line-error -halt-on-error -interaction=nonstopmode"
33-
typesetopts = "-file-line-error -halt-on-error -interaction=nonstopmode"
34-
3532
lvtext = ".tex"
3633

3734
function update_tag(file, content, tagname, tagdate)
3835
tagname = string.gsub(tagname, "^v", "")
3936
local url = "https://github.com/ustctug/ustcthesis"
40-
local date = string.gsub(tagdate, "%-", "/")
4137

4238
content = string.gsub(content,
4339
"Copyright %(C%) (%d%d%d%d)%-%d%d%d%d",
@@ -47,8 +43,8 @@ function update_tag(file, content, tagname, tagdate)
4743
content = string.gsub(content, "\\newcommand\\ustcthesisversion{[0-9a-z.-]+",
4844
"\\newcommand\\ustcthesisversion{" .. tagname)
4945

50-
content = string.gsub(content, "\\ProvidesClass{ustcthesis}%[%d%d%d%d/%d%d/%d%d",
51-
"\\ProvidesClass{ustcthesis}[" .. date)
46+
content = string.gsub(content, "\\ProvidesExplClass{ustcthesis}{%d%d%d%d%-%d%d%-%d%d",
47+
"\\ProvidesExplClass{ustcthesis}{" .. tagdate)
5248

5349
elseif string.match(file, "%-doc.tex") then
5450
content = string.gsub(content, "v[0-9a-z.-]+\\qquad %d%d%d%d%-%d%d%-%d%d",

test/testfiles-crossref/main-bachelor-arabic.tlg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5560,14 +5560,12 @@ Completed box being shipped out [11]
55605560
....\glue(\leftskip) 0.0 plus 1.0fil
55615561
....\hbox(0.0+0.0)x0.0
55625562
....\TU/texgyretermes(0)/m/n/12.045 2016
5563-
....\kern -0.0002
5564-
....\kern 0.0002
55655563
....\glue 3.01125 plus 1.50562 minus 1.00374
55665564
....\TU/FandolSong(0)/m/n/12.045 年
5565+
....\kern -0.00018
5566+
....\kern 0.00018
55675567
....\glue 3.01125 plus 1.50562 minus 1.00374
55685568
....\TU/texgyretermes(0)/m/n/12.045 5
5569-
....\kern -0.0002
5570-
....\kern 0.0002
55715569
....\glue 3.01125 plus 1.50562 minus 1.00374
55725570
....\TU/FandolSong(0)/m/n/12.045 月
55735571
....\kern -0.00017

test/testfiles-crossref/main-bachelor-english.tlg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5469,14 +5469,12 @@ Completed box being shipped out [11]
54695469
....\glue(\leftskip) 0.0 plus 1.0fil
54705470
....\hbox(0.0+0.0)x0.0
54715471
....\TU/texgyretermes(0)/m/n/12.045 2016
5472-
....\kern -0.0002
5473-
....\kern 0.0002
54745472
....\glue 3.01125 plus 1.50562 minus 1.00374
54755473
....\TU/FandolSong(0)/m/n/12.045 年
5474+
....\kern -0.00018
5475+
....\kern 0.00018
54765476
....\glue 3.01125 plus 1.50562 minus 1.00374
54775477
....\TU/texgyretermes(0)/m/n/12.045 5
5478-
....\kern -0.0002
5479-
....\kern 0.0002
54805478
....\glue 3.01125 plus 1.50562 minus 1.00374
54815479
....\TU/FandolSong(0)/m/n/12.045 月
54825480
....\kern -0.00017

test/testfiles-crossref/main-bachelor.tlg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5624,14 +5624,12 @@ Completed box being shipped out [11]
56245624
....\glue(\leftskip) 0.0 plus 1.0fil
56255625
....\hbox(0.0+0.0)x0.0
56265626
....\TU/texgyretermes(0)/m/n/12.045 2016
5627-
....\kern -0.0002
5628-
....\kern 0.0002
56295627
....\glue 3.01125 plus 1.50562 minus 1.00374
56305628
....\TU/FandolSong(0)/m/n/12.045 年
5629+
....\kern -0.00018
5630+
....\kern 0.00018
56315631
....\glue 3.01125 plus 1.50562 minus 1.00374
56325632
....\TU/texgyretermes(0)/m/n/12.045 5
5633-
....\kern -0.0002
5634-
....\kern 0.0002
56355633
....\glue 3.01125 plus 1.50562 minus 1.00374
56365634
....\TU/FandolSong(0)/m/n/12.045 月
56375635
....\kern -0.00017

0 commit comments

Comments
 (0)