Skip to content

Commit 8a1ead3

Browse files
committed
Bump to v4.0.0
1 parent 6ac9de6 commit 8a1ead3

4 files changed

Lines changed: 34 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.0.0] - 2026-05-10
11+
1012
### Changed
1113

1214
- 本科生的正文行距改为 20 磅(同步教务处 2026-04-24 格式式样更新,[#501](https://github.com/ustctug/ustcthesis/issues/501))。
@@ -493,7 +495,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
493495
- 优化图注、算法的行距。
494496
- 二级以下节标题编号下采用“1.”、“(1)”、“①”。
495497

496-
[Unreleased]: https://github.com/ustctug/ustcthesis/compare/v4.0.0-beta.11...HEAD
498+
[Unreleased]: https://github.com/ustctug/ustcthesis/compare/v4.0.0...HEAD
499+
[4.0.0]: https://github.com/ustctug/ustcthesis/compare/v4.0.0-beta.11...v4.0.0
497500
[4.0.0-beta.11]: https://github.com/ustctug/ustcthesis/compare/v4.0.0-beta.10...v4.0.0-beta.11
498501
[4.0.0-beta.10]: https://github.com/ustctug/ustcthesis/compare/v4.0.0-beta.9...v4.0.0-beta.10
499502
[4.0.0-beta.9]: https://github.com/ustctug/ustcthesis/compare/v4.0.0-beta.8...v4.0.0-beta.9

build.lua

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env texlua
2+
---@diagnostic disable: lowercase-global
3+
4+
-- Configuration file for use with "l3build"
25

36
module = "ustcthesis"
47

@@ -29,37 +32,40 @@ typesetopts = "-file-line-error -halt-on-error -interaction=nonstopmode"
2932

3033
lvtext = ".tex"
3134

35+
local package_repository = "https://github.com/ustctug/ustcthesis"
36+
local version_pattern = "[%d.]+[%l%d.-]*"
37+
3238
function update_tag(file, content, tagname, tagdate)
33-
tagname = string.gsub(tagname, "^v", "")
34-
local url = "https://github.com/ustctug/ustcthesis"
39+
local version = string.gsub(tagname, "^v", "")
3540
local date = string.gsub(tagdate, "%-", "/")
3641

3742
content = string.gsub(content,
38-
"Copyright %(C%) (%d%d%d%d)%-%d%d%d%d",
43+
"Copyright %(Cc%) (%d%d%d%d)%-+%d%d%d%d",
3944
"Copyright (C) %1-" .. os.date("%Y"))
4045

41-
if string.match(file, "%.cls$") then
42-
content = string.gsub(content, "\\newcommand\\ustcthesisversion{[0-9a-z.-]+",
43-
"\\newcommand\\ustcthesisversion{" .. tagname)
46+
if file == "CHANGELOG.md" then
47+
local previous = string.match(content, "compare/v(" .. version_pattern .. ")%.%.%.HEAD")
48+
if version ~= previous then
49+
content = string.gsub(content,
50+
"## %[Unreleased%]",
51+
"## [Unreleased]\n\n## [" .. version .. "] - " .. tagdate)
52+
content = string.gsub(content,
53+
"v" .. version_pattern .. "%.%.%.HEAD",
54+
"v" .. version .. "...HEAD\n[" .. version .. "]: " .. package_repository .. "/compare/v" .. previous
55+
.. "...v" .. version)
56+
end
57+
58+
elseif string.match(file, "%.cls$") then
59+
content = string.gsub(content, "\\newcommand\\ustcthesisversion{" .. version_pattern,
60+
"\\newcommand\\ustcthesisversion{" .. version)
4461

4562
content = string.gsub(content, "\\ProvidesClass{ustcthesis}%[%d%d%d%d/%d%d/%d%d",
4663
"\\ProvidesClass{ustcthesis}[" .. date)
4764

48-
elseif string.match(file, "%-doc.tex") then
49-
content = string.gsub(content, "v[0-9a-z.-]+\\qquad %d%d%d%d%-%d%d%-%d%d",
50-
"v" .. tagname .. "\\qquad " .. tagdate)
51-
52-
elseif string.match(file, "CHANGELOG.md") then
53-
local previous = string.match(content, "/compare/v([0-9a-z.-]+)%.%.%.HEAD")
54-
if tagname == previous then return content end
55-
content = string.gsub(content,
56-
"## %[Unreleased%]",
57-
"## [Unreleased]\n\n## [" .. tagname .. "] - " .. tagdate)
58-
59-
content = string.gsub(content,
60-
previous:gsub("%.", "%%."):gsub("%-", "%%-") .. "%.%.%.HEAD",
61-
tagname .. "...HEAD\n[" .. tagname .. "]: " .. url .. "/compare/v"
62-
.. previous .. "...v" .. tagname)
65+
elseif string.match(file, "%-doc.tex$") then
66+
content = string.gsub(content, "v" .. version_pattern .. "\\qquad %d%d%d%d%-%d%d%-%d%d",
67+
"v" .. version .. "\\qquad " .. tagdate)
68+
6369
end
6470
return content
6571
end

ustcthesis-doc.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
\title{\cls{ustcthesis} 使用说明}
114114
\author{Zeping Lee\thanks{zepinglee AT gmail.com} \and
115115
seisman\thanks{seisman.info AT gmail.com} }
116-
\date{v4.0.0-beta.11\qquad 2026-04-06}
116+
\date{v4.0.0\qquad 2026-05-10}
117117
\maketitle
118118

119119

ustcthesis.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
%
1212

1313
\NeedsTeXFormat{LaTeX2e}[2017/04/15]
14-
\newcommand\ustcthesisversion{4.0.0-beta.11}
15-
\ProvidesClass{ustcthesis}[2026/04/06 v\ustcthesisversion\space USTC thesis template]
14+
\newcommand\ustcthesisversion{4.0.0}
15+
\ProvidesClass{ustcthesis}[2026/05/10 v\ustcthesisversion\space USTC thesis template]
1616

1717
% 报错和警告
1818
\newcommand\ustc@error[1]{%

0 commit comments

Comments
 (0)