Skip to content

Commit e132906

Browse files
feat: replace bachelor thesis patch with new JWC thesis preset (#1138)
* feat: replace bachelor thesis patch with new JWC thesis preset * chore: mv preset file into texmf * feat: set appendix chapter headings in JWC thesis preset * feat: show frontmatter headings in TOC * feat: update abstract heading in JWC thesis preset * feat: set appendix chapter numbering format in JWC thesis preset * docs: add preset notes in main --------- Co-authored-by: LogCreative <logcreative@outlook.com>
1 parent f3fbf64 commit e132906

File tree

4 files changed

+105
-75
lines changed

4 files changed

+105
-75
lines changed

RELEASES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66

77
## [Unreleased]
88

9+
### Changed
10+
911
- 注释英文大摘要([#1137](https://github.com/sjtug/SJTUThesis/pull/1137))。
1012

1113
### Added
1214

13-
- 添加 `sjtuthesis-bachelor.sty` 来补充学士论文额外配置([#1113](https://github.com/sjtug/SJTUThesis/pull/1113))。
15+
- ~~添加 `sjtuthesis-bachelor.sty` 来补充学士论文额外配置([#1113](https://github.com/sjtug/SJTUThesis/pull/1113))。~~
16+
- 添加教务处版学位论文模板预设([#1138](https://github.com/sjtug/SJTUThesis/pull/1138))。
1417

1518
## [v2.2.1] - 2025-04-02
1619

main.tex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
% [twoside|oneside], % 可选(默认:twoside),双页或单页边距模式
1313
% [openright|openany], % 可选(默认:openright),奇数页或任意页开始新章
1414
% math-style=[ISO|TeX], % 可选 (默认:ISO),数学符号样式
15-
16-
% 添加学士学位论文相关的额外设置,硕士和博士学位论文可忽略
17-
\usepackage{sjtuthesis-bachelor}
15+
% preset=[base|jwc], % 可选(默认:base),预设配置,学士学位论文考虑使用 jwc 预设
1816

1917
% 论文基本配置,加载宏包等全局配置
2018
\input{setup}

sjtuthesis-bachelor.sty

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
%%
2+
%% Copyright (C) SJTUG
3+
%% 2018--2026 Weijian Wu <alexarawu@outlook.com>
4+
%% 2022--2026 Zilong Li <logcreative@outlook.com>
5+
%% 2024--2026 Boshi Yuan <nemoyuan2008@outlook.com>
6+
%%
7+
%% This work may be distributed and/or modified under the
8+
%% conditions of the LaTeX Project Public License, either version 1.3c
9+
%% of this license or (at your option) any later version.
10+
%% The latest version of this license is in
11+
%% https://www.latex-project.org/lppl.txt
12+
%% and version 1.3c or later is part of all distributions of LaTeX
13+
%% version 2008 or later.
14+
%%
15+
\ProvidesExplFile{sjtu-thesis-preset-jwc.def}
16+
{2026-03-02}{v20251010}
17+
{Thesis document preset for Shanghai Jiao Tong University (JWC)}
18+
\file_input:n { sjtu-thesis-preset-base.def }
19+
\__sjtu_conditional_const:nn { main_lang_zh }
20+
{ \str_if_eq_p:Vn \g__sjtu_lang_tl { zh } }
21+
\SetInfoEntry { zh }
22+
{
23+
department = { 学院 } ,
24+
major = { 专业名称 } ,
25+
degree = { \hfill \llap { 申请学位层次 } }
26+
}
27+
\keys_set:nn { sjtu / info }
28+
{ zh / subject = { 上海交通大学学位论文 } }
29+
\tl_set:Nn \SJTU@CT@W@width { 4 em }
30+
\EditInstance { sjtu / element } { title a / info }
31+
{ format= \zihao { 4 } \setbaselineskip { 30 bp } \heiti \bfseries }
32+
\keys_set:nn { sjtu / private / copyright }
33+
{ variant = b }
34+
\bool_lazy_any:nT
35+
{
36+
{ \__sjtu_if_main_lang_zh_p: }
37+
{ \__sjtu_if_main_lang_ja_p: }
38+
}
39+
{
40+
\ctex_set:nn { chapter }
41+
{
42+
name = { 第 , 章 } ,
43+
number = \chinese { chapter }
44+
}
45+
}
46+
\RenewDocumentEnvironment { abstract } { O{ } }
47+
{
48+
\__sjtu_select_language:n {#1}
49+
\tl_set:Ne \l__sjtu_heading_title_tl
50+
{
51+
\exp_not:N \protect \exp_not:N \MakeUppercase
52+
{ \exp_not:v { c__sjtu_name_abstract_ \l__sjtu_lang_tl _tl } }
53+
}
54+
\ctex_set:nn { chapter } { format+ = \sffamily }
55+
\__sjtu_make_heading:n { intoc, #1 }
56+
} { }
57+
\titlecontents { chapter }
58+
[ 0 pt ]
59+
{ \addvspace { 6 bp } \zihao { 4 } \setbaselineskip { 24 bp } \bfseries }
60+
{ \contentspush { \thecontentslabel \enskip } } { }
61+
{ \SJTU@leaders \thecontentspage }
62+
[ \addvspace { 6 bp } ]
63+
\titlecontents { section }
64+
[ 1 em ] { \zihao { -4 } \setbaselineskip { 20 bp } }
65+
{ \contentspush { \thecontentslabel \enskip } } { }
66+
{ \SJTU@leaders \thecontentspage }
67+
\titlecontents { subsection }
68+
[ 2 em ] { \zihao { 5 } \setbaselineskip { 16 bp } }
69+
{ \contentspush { \thecontentslabel \enskip } } { }
70+
{ \SJTU@leaders \thecontentspage }
71+
\keys_set:nn { sjtu / style }
72+
{ num-sep = { - } }
73+
\__sjtu_if_main_lang_zh:T
74+
{
75+
\def \SJTU@fullwidth@paren #1 { ( #1 ) }
76+
\AddToHook { cmd / appendix / before }
77+
{
78+
\ctex_set:nn { chapter }
79+
{ tocline = #2 \CTEXifname{\SJTU@fullwidth@paren\CTEXthechapter}{} }
80+
\ctex_patch_cmd:Nnn \@makechapterhead
81+
{ {\CTEXifname{\CTEX@chaptername\CTEX@chapter@aftername}{}} } { }
82+
\ctex_patch_cmd:Nnn \@makechapterhead
83+
{ \CTEX@chapter@aftertitle }
84+
{
85+
{\CTEXifname{\SJTU@fullwidth@paren\CTEX@chaptername}{}}
86+
\CTEX@chapter@aftertitle
87+
}
88+
\def \chaptermark #1
89+
{ \markboth{#1\CTEXifname{\SJTU@fullwidth@paren\CTEXthechapter}{}}{} }
90+
}
91+
\AddToHook { cmd / appendix / after }
92+
{
93+
\ctex_set:nn { chapter }
94+
{ number = \arabic { chapter } }
95+
\def \thechapter { A \arabic { chapter } }
96+
}
97+
}
98+
\endinput
99+
%%
100+
%% End of file `sjtu-thesis-preset-jwc.def'.

0 commit comments

Comments
 (0)