|
| 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