Skip to content

Commit

Permalink
Refine handling of student-id option, fix #945
Browse files Browse the repository at this point in the history
Signed-off-by: Shengqi Chen <[email protected]>
  • Loading branch information
Harry-Chen committed Apr 15, 2024
1 parent 9307b22 commit 4cdcf4e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

## [Unreleased]

### Changed

- 更新 `student-id` 选项的处理逻辑,非 `proposal` 类型默认忽略,并增加警告([#945](https://github.com/tuna/thuthesis/issues/945)

## [v7.5.0] - 2024-03-29

### Added
Expand Down
15 changes: 11 additions & 4 deletions thuthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4584,14 +4584,15 @@
\restoregeometry
}
\newcommand\thu@set@student@id{%
\ifthu@thesis@type@proposal
\ifx\thu@student@id\@empty
\thusetup{student-id=2000310000}%
\ifthu@thesis@type@proposal\else
\ifx\thu@student@id\@empty\else
\thu@warning{`studen-id' in "\protect\thusetup" would be ignored when `thesis-type' is not proposal.}%
\fi
\fi
}
\thu@set@student@id
\thu@option@hook{thesis-type}{\thu@set@student@id}
\thu@option@hook{student-id}{\thu@set@student@id}
% \end{macrocode}
%
% 涉密信息
Expand Down Expand Up @@ -4656,7 +4657,13 @@
\thu@info@item{工程领域}{}{\thu@engineering@field}%
\thu@info@item{申请人}{\thu@name@title}{\thu@author}%
\fi
\thu@info@item{学号}{}{\thu@student@id}%
\ifthu@thesis@type@proposal
\ifx\thu@student@id\@empty
\thu@warning{Missing option `student-id' in "\protect\thusetup", ID will not appear on cover.}
\else
\thu@info@item{学号}{}{\thu@student@id}%
\fi
\fi
\thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}%
\thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}%
\thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}%
Expand Down

0 comments on commit 4cdcf4e

Please sign in to comment.