From 0e8da8d556bca64334dc08b8dca8abc1bda6f9bf Mon Sep 17 00:00:00 2001 From: Alexara Wu Date: Thu, 30 Mar 2023 01:13:13 +0800 Subject: [PATCH] Sync with SJTUTeX * Update to version 2.0 --- .../sjtutex/config/sjtu-lang-article-en.cfg | 63 - .../sjtutex/config/sjtu-lang-article-zh.cfg | 80 -- .../sjtutex/config/sjtu-lang-report-zh.cfg | 85 -- .../sjtutex/config/sjtu-lang-thesis-zh.cfg | 91 -- .../sjtutex/fd/sjtu-cjk-font-adobe-ja.def | 69 + .../sjtutex/fd/sjtu-cjk-font-adobe-zh.def | 57 + .../latex/sjtutex/fd/sjtu-cjk-font-adobe.def | 31 +- .../sjtutex/fd/sjtu-cjk-font-fandol-ja.def | 95 ++ .../sjtutex/fd/sjtu-cjk-font-fandol-zh.def | 89 ++ .../latex/sjtutex/fd/sjtu-cjk-font-fandol.def | 62 +- .../sjtutex/fd/sjtu-cjk-font-founder-ja.def | 53 + .../sjtutex/fd/sjtu-cjk-font-founder-zh.def | 56 + .../sjtutex/fd/sjtu-cjk-font-founder.def | 30 +- .../latex/sjtutex/fd/sjtu-cjk-font-mac-ja.def | 82 ++ .../latex/sjtutex/fd/sjtu-cjk-font-mac-zh.def | 80 ++ .../latex/sjtutex/fd/sjtu-cjk-font-mac.def | 52 +- .../sjtutex/fd/sjtu-cjk-font-ubuntu-ja.def | 76 + .../sjtutex/fd/sjtu-cjk-font-ubuntu-zh.def | 72 + .../latex/sjtutex/fd/sjtu-cjk-font-ubuntu.def | 45 +- .../sjtutex/fd/sjtu-cjk-font-windows-ja.def | 53 + .../sjtutex/fd/sjtu-cjk-font-windows-zh.def | 56 + .../sjtutex/fd/sjtu-cjk-font-windows.def | 30 +- .../sjtutex/fd/sjtu-math-font-cambria.def | 6 +- .../latex/sjtutex/fd/sjtu-math-font-lm.def | 4 +- .../latex/sjtutex/fd/sjtu-math-font-newcm.def | 4 +- .../latex/sjtutex/fd/sjtu-math-font-newpx.def | 9 +- .../latex/sjtutex/fd/sjtu-math-font-newtx.def | 7 +- .../sjtutex/fd/sjtu-math-font-stixtwo.def | 8 +- .../latex/sjtutex/fd/sjtu-math-font-times.def | 5 +- .../latex/sjtutex/fd/sjtu-math-font-xits.def | 8 +- .../sjtutex/fd/sjtu-text-font-cambria.def | 6 +- .../latex/sjtutex/fd/sjtu-text-font-lm.def | 14 +- .../latex/sjtutex/fd/sjtu-text-font-newcm.def | 4 +- .../latex/sjtutex/fd/sjtu-text-font-newpx.def | 14 +- .../latex/sjtutex/fd/sjtu-text-font-newtx.def | 14 +- .../sjtutex/fd/sjtu-text-font-stixtwo.def | 14 +- .../latex/sjtutex/fd/sjtu-text-font-times.def | 10 +- .../latex/sjtutex/fd/sjtu-text-font-xits.def | 8 +- .../latex/sjtutex/sjtu-lang-generic-de.def | 52 + .../latex/sjtutex/sjtu-lang-generic-en.def | 75 + .../latex/sjtutex/sjtu-lang-generic-ja.def | 60 + .../latex/sjtutex/sjtu-lang-generic-zh.def | 60 + .../tex/latex/sjtutex/sjtu-lang-thesis-de.def | 116 ++ .../tex/latex/sjtutex/sjtu-lang-thesis-en.def | 139 ++ .../tex/latex/sjtutex/sjtu-lang-thesis-ja.def | 124 ++ .../tex/latex/sjtutex/sjtu-lang-thesis-zh.def | 145 ++ ...report-en.cfg => sjtu-name-generic-de.def} | 48 +- ...thesis-en.cfg => sjtu-name-generic-en.def} | 48 +- ...e-generic.cfg => sjtu-name-generic-ja.def} | 33 +- .../latex/sjtutex/sjtu-name-generic-zh.def | 47 + .../tex/latex/sjtutex/sjtu-name-thesis-de.def | 57 + .../tex/latex/sjtutex/sjtu-name-thesis-en.def | 57 + .../tex/latex/sjtutex/sjtu-name-thesis-ja.def | 60 + ...ame-thesis.cfg => sjtu-name-thesis-zh.def} | 83 +- texmf/tex/latex/sjtutex/sjtu-scheme-de.def | 80 ++ texmf/tex/latex/sjtutex/sjtu-scheme-en.def | 55 + texmf/tex/latex/sjtutex/sjtu-scheme-ja.def | 85 ++ texmf/tex/latex/sjtutex/sjtu-scheme-zh.def | 85 ++ texmf/tex/latex/sjtutex/sjtuarticle.cls | 829 ++++------- texmf/tex/latex/sjtutex/sjtureport.cls | 838 ++++------- texmf/tex/latex/sjtutex/sjtuthesis.cls | 1253 ++++++++--------- 61 files changed, 3407 insertions(+), 2564 deletions(-) delete mode 100644 texmf/tex/latex/sjtutex/config/sjtu-lang-article-en.cfg delete mode 100644 texmf/tex/latex/sjtutex/config/sjtu-lang-article-zh.cfg delete mode 100644 texmf/tex/latex/sjtutex/config/sjtu-lang-report-zh.cfg delete mode 100644 texmf/tex/latex/sjtutex/config/sjtu-lang-thesis-zh.cfg create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-ja.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-zh.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-ja.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-zh.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-ja.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-zh.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-ja.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-zh.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-ja.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-zh.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-ja.def create mode 100644 texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-zh.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-generic-de.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-generic-en.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-generic-ja.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-generic-zh.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-thesis-de.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-thesis-en.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-thesis-ja.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-lang-thesis-zh.def rename texmf/tex/latex/sjtutex/{config/sjtu-lang-report-en.cfg => sjtu-name-generic-de.def} (50%) rename texmf/tex/latex/sjtutex/{config/sjtu-lang-thesis-en.cfg => sjtu-name-generic-en.def} (50%) rename texmf/tex/latex/sjtutex/{config/sjtu-name-generic.cfg => sjtu-name-generic-ja.def} (50%) create mode 100644 texmf/tex/latex/sjtutex/sjtu-name-generic-zh.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-name-thesis-de.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-name-thesis-en.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-name-thesis-ja.def rename texmf/tex/latex/sjtutex/{config/sjtu-name-thesis.cfg => sjtu-name-thesis-zh.def} (58%) create mode 100644 texmf/tex/latex/sjtutex/sjtu-scheme-de.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-scheme-en.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-scheme-ja.def create mode 100644 texmf/tex/latex/sjtutex/sjtu-scheme-zh.def diff --git a/texmf/tex/latex/sjtutex/config/sjtu-lang-article-en.cfg b/texmf/tex/latex/sjtutex/config/sjtu-lang-article-en.cfg deleted file mode 100644 index 8c2c8029..00000000 --- a/texmf/tex/latex/sjtutex/config/sjtu-lang-article-en.cfg +++ /dev/null @@ -1,63 +0,0 @@ -%% -%% This is file `sjtu-lang-article-en.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% sjtutex.dtx (with options: `lang,article,en') -%% -%% Copyright (C) SJTUG -%% 2018--2023 Alexara Wu -%% 2022--2023 Log Creative -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. The latest version of this license is in: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainers of this work are Alexara Wu and Log Creative. -%% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {SJTUArticle English config (SJTUTeX)} -\ProvidesExplFile{sjtu-lang-article-en.cfg} - {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\clist_map_inline:nn - { - { assumption } - { Assumption } , - { axiom } - { Axiom } , - { conjecture } - { Conjecture } , - { corollary } - { Corollary } , - { definition } - { Definition } , - { example } - { Example } , - { exercise } - { Exercise } , - { lemma } - { Lemma } , - { problem } - { Problem } , - { proposition } - { Proposition } , - { remark } - { Remark } , - { solution } - { Solution } , - { theorem } - { Theorem } , - } - { \__sjtu_define_name_g:nn #1 } -\endinput -%% -%% End of file `sjtu-lang-article-en.cfg'. diff --git a/texmf/tex/latex/sjtutex/config/sjtu-lang-article-zh.cfg b/texmf/tex/latex/sjtutex/config/sjtu-lang-article-zh.cfg deleted file mode 100644 index 69498089..00000000 --- a/texmf/tex/latex/sjtutex/config/sjtu-lang-article-zh.cfg +++ /dev/null @@ -1,80 +0,0 @@ -%% -%% This is file `sjtu-lang-article-zh.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% sjtutex.dtx (with options: `lang,article,zh') -%% -%% Copyright (C) SJTUG -%% 2018--2023 Alexara Wu -%% 2022--2023 Log Creative -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. The latest version of this license is in: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainers of this work are Alexara Wu and Log Creative. -%% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {SJTUArticle Chinese config (SJTUTeX)} -\ProvidesExplFile{sjtu-lang-article-zh.cfg} - {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\keys_set_known:nn { sjtu / name } - { - contents = 目 \quad 录 , - listfigure = 插 \quad 图 , - listtable = 表 \quad 格 , - figure = 图 , - table = 表 , - abstract = 摘 \quad 要 , - index = 索 \quad 引 , - appendix = 附录 , - proof = 证明 , - bib = 参考文献 , - figure* = Figure , - table* = Table , - algorithm = 算法 , - listalgorithm = 算 \quad 法 , - } -\clist_map_inline:nn - { - { assumption } - { 假设 } , - { axiom } - { 公理 } , - { conjecture } - { 猜想 } , - { corollary } - { 推论 } , - { definition } - { 定义 } , - { example } - { 例 } , - { exercise } - { 练习 } , - { lemma } - { 引理 } , - { problem } - { 问题 } , - { proposition } - { 命题 } , - { remark } - { 注 } , - { solution } - { 解 } , - { theorem } - { 定理 } , - } - { \__sjtu_define_name_g:nn #1 } -\endinput -%% -%% End of file `sjtu-lang-article-zh.cfg'. diff --git a/texmf/tex/latex/sjtutex/config/sjtu-lang-report-zh.cfg b/texmf/tex/latex/sjtutex/config/sjtu-lang-report-zh.cfg deleted file mode 100644 index 4bfeac82..00000000 --- a/texmf/tex/latex/sjtutex/config/sjtu-lang-report-zh.cfg +++ /dev/null @@ -1,85 +0,0 @@ -%% -%% This is file `sjtu-lang-report-zh.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% sjtutex.dtx (with options: `lang,report,zh') -%% -%% Copyright (C) SJTUG -%% 2018--2023 Alexara Wu -%% 2022--2023 Log Creative -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. The latest version of this license is in: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainers of this work are Alexara Wu and Log Creative. -%% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {SJTUReport Chinese config (SJTUTeX)} -\ProvidesExplFile{sjtu-lang-report-zh.cfg} - {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\keys_set_known:nn { sjtu / name } - { - contents = 目 \quad 录 , - listfigure = 插 \quad 图 , - listtable = 表 \quad 格 , - figure = 图 , - table = 表 , - abstract = 摘 \quad 要 , - index = 索 \quad 引 , - appendix = 附录 , - proof = 证明 , - bib = 参考文献 , - figure* = Figure , - table* = Table , - algorithm = 算法 , - listalgorithm = 算 \quad 法 , - } -\ctex_set:nn { chapter } - { - name = { 第 , 章 } , - number = \chinese { chapter } - } -\clist_map_inline:nn - { - { assumption } - { 假设 } , - { axiom } - { 公理 } , - { conjecture } - { 猜想 } , - { corollary } - { 推论 } , - { definition } - { 定义 } , - { example } - { 例 } , - { exercise } - { 练习 } , - { lemma } - { 引理 } , - { problem } - { 问题 } , - { proposition } - { 命题 } , - { remark } - { 注 } , - { solution } - { 解 } , - { theorem } - { 定理 } , - } - { \__sjtu_define_name_g:nn #1 } -\endinput -%% -%% End of file `sjtu-lang-report-zh.cfg'. diff --git a/texmf/tex/latex/sjtutex/config/sjtu-lang-thesis-zh.cfg b/texmf/tex/latex/sjtutex/config/sjtu-lang-thesis-zh.cfg deleted file mode 100644 index 6a798cd1..00000000 --- a/texmf/tex/latex/sjtutex/config/sjtu-lang-thesis-zh.cfg +++ /dev/null @@ -1,91 +0,0 @@ -%% -%% This is file `sjtu-lang-thesis-zh.cfg', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% sjtutex.dtx (with options: `lang,thesis,zh') -%% -%% Copyright (C) SJTUG -%% 2018--2023 Alexara Wu -%% 2022--2023 Log Creative -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. The latest version of this license is in: -%% -%% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainers of this work are Alexara Wu and Log Creative. -%% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {SJTUThesis Chinese config (SJTUTeX)} -\ProvidesExplFile{sjtu-lang-thesis-zh.cfg} - {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\keys_set_known:nn { sjtu / name } - { - contents = 目 \quad 录 , - listfigure = 插 \quad 图 , - listtable = 表 \quad 格 , - figure = 图 , - table = 表 , - index = 索 \quad 引 , - appendix = 附录 , - proof = 证明 , - bib = 参考文献 , - figure* = Figure , - table* = Table , - algorithm = 算法 , - listalgorithm = 算 \quad 法 , - abbr = 缩略语对照表 , - nom = 符号对照表 , - summary = 全文总结 , - ack = 致 \quad 谢 , - resume = 个人简历 , - digest = 大摘要 , - achv = 学术论文和科研成果目录 - } -\ctex_set:nn { chapter } - { - name = { 第 , 章 } , - number = \chinese { chapter } - } -\clist_map_inline:nn - { - { assumption } - { 假设 } , - { axiom } - { 公理 } , - { conjecture } - { 猜想 } , - { corollary } - { 推论 } , - { definition } - { 定义 } , - { example } - { 例 } , - { exercise } - { 练习 } , - { lemma } - { 引理 } , - { problem } - { 问题 } , - { proposition } - { 命题 } , - { remark } - { 注 } , - { solution } - { 解 } , - { theorem } - { 定理 } , - } - { \__sjtu_define_name_g:nn #1 } -\endinput -%% -%% End of file `sjtu-lang-thesis-zh.cfg'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-ja.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-ja.def new file mode 100644 index 00000000..927d94af --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-ja.def @@ -0,0 +1,69 @@ +%% +%% This is file `sjtu-cjk-font-adobe-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,adobe,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Adobe CJK fonts definition for Japanese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-adobe-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { \__sjtu_fontset_error:nn { cjk } { adobe } } + { + \setCJKmainfont { Kozuka~Mincho~Pr6N } + [ + UprightFont = *~L , + BoldFont = *~B + ] + \setCJKsansfont { Kozuka~Gothic~Pr6N } + [ + UprightFont = *~M , + BoldFont = *~B + ] + \setCJKmonofont { Kozuka~Gothic~Pr6N } + \setCJKfamilyfont { jamin } { Kozuka~Mincho~Pr6N } + [ + UprightFont = *~L , + BoldFont = *~B + ] + \setCJKfamilyfont { jagoth } { Kozuka~Gothic~Pr6N } + [ + UprightFont = *~M , + BoldFont = *~B + ] + \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } + [ AutoFakeBold = 3 , ItalicFont = AdobeKaitiStd-Regular ] + \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } + \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\NewDocumentCommand \mincho { } { \CJKfamily { jamin } } +\NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } +\endinput +%% +%% End of file `sjtu-cjk-font-adobe-ja.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-zh.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-zh.def new file mode 100644 index 00000000..e133ea0d --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe-zh.def @@ -0,0 +1,57 @@ +%% +%% This is file `sjtu-cjk-font-adobe-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,adobe,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Adobe CJK fonts definition for Chinese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-adobe-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nnn + { \__sjtu_fontset_error:nn { cjk } { adobe } } + { + \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { adobe } + \ctex_punct_set:n { adobe } + \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } + \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } + \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } + } + { + \setCJKmainfont { AdobeSongStd-Light } + [ AutoFakeBold = 3 , ItalicFont = AdobeKaitiStd-Regular ] + \setCJKsansfont { AdobeHeitiStd-Regular } [ AutoFakeBold = 3 ] + \setCJKmonofont { AdobeFangsongStd-Regular } + \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } + [ AutoFakeBold = 3 , ItalicFont = AdobeKaitiStd-Regular ] + \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } + \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\endinput +%% +%% End of file `sjtu-cjk-font-adobe-zh.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe.def index bc1592a9..04a8dc8e 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-adobe.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `cjkfont,adobe') +%% sjtutex.dtx (with options: `font,cjk,adobe,und') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,34 +24,13 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Adobe CJK fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-cjk-font-adobe.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\__sjtu_fontset_case:nnn - { \__sjtu_fontset_error:nn { cjk } { adobe } } - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { adobe } - \ctex_punct_set:n { adobe } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } - { - \setCJKmainfont { AdobeSongStd-Light } - [ AutoFakeBold = 3, ItalicFont = AdobeKaitiStd-Regular ] - \setCJKsansfont { AdobeHeitiStd-Regular } [ BoldFont = * ] - \setCJKmonofont { AdobeFangsongStd-Regular } - \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } - [ AutoFakeBold = 3, ItalicFont = AdobeKaitiStd-Regular ] - \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } [ BoldFont = * ] - \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } - \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } - } -\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } -\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } -\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } -\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\tl_if_eq:NNTF \g__sjtu_lang_tl \c__sjtu_lang_ja_tl + { \ctex_file_input:n { sjtu-cjk-font-adobe-ja.def } } + { \ctex_file_input:n { sjtu-cjk-font-adobe-zh.def } } \endinput %% %% End of file `sjtu-cjk-font-adobe.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-ja.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-ja.def new file mode 100644 index 00000000..a07066b7 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-ja.def @@ -0,0 +1,95 @@ +%% +%% This is file `sjtu-cjk-font-fandol-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,fandol,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Fandol CJK fonts definition for Japanese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-fandol-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { \__sjtu_fontset_error:nn { cjk } { fandol } } + { + \setCJKmainfont { HaranoAjiMincho } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold + ] + \setCJKsansfont { HaranoAjiGothic } + [ + Extension = .otf , + UprightFont = *-Medium , + BoldFont = *-Bold + ] + \setCJKmonofont { HaranoAjiGothic } + [ + Extension = .otf , + UprightFont = *-Regular + ] + \setCJKfamilyfont { jamin } { HaranoAjiMincho } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold + ] + \setCJKfamilyfont { jagoth } { HaranoAjiGothic } + [ + Extension = .otf , + UprightFont = *-Medium , + BoldFont = *-Bold + ] + \setCJKfamilyfont { zhsong } { FandolSong } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold , + ItalicFont = FandolKai-Regular + ] + \setCJKfamilyfont { zhhei } { FandolHei } + [ + Extension = .otf , + UprightFont = *-Regular, + BoldFont = *-Bold + ] + \setCJKfamilyfont { zhfs } { FandolFang } + [ + Extension = .otf , + UprightFont = *-Regular + ] + \setCJKfamilyfont { zhkai } { FandolKai } + [ + Extension = .otf , + UprightFont = *-Regular + ] + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\NewDocumentCommand \mincho { } { \CJKfamily { jamin } } +\NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } +\endinput +%% +%% End of file `sjtu-cjk-font-fandol-ja.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-zh.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-zh.def new file mode 100644 index 00000000..55fb6fb9 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol-zh.def @@ -0,0 +1,89 @@ +%% +%% This is file `sjtu-cjk-font-fandol-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,fandol,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Fandol CJK fonts definition for Chinese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-fandol-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nnn + { \__sjtu_fontset_error:nn { cjk } { fandol } } + { + \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { fandol } + \ctex_punct_set:n { fandol } + \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } + \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } + \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } + } + { + \setCJKmainfont { FandolSong } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold , + ItalicFont = FandolKai-Regular + ] + \setCJKsansfont { FandolHei } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold + ] + \setCJKmonofont { FandolFang } + [ + Extension = .otf , + UprightFont = *-Regular + ] + \setCJKfamilyfont { zhsong } { FandolSong } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold , + ItalicFont = FandolKai-Regular + ] + \setCJKfamilyfont { zhhei } { FandolHei } + [ + Extension = .otf , + UprightFont = *-Regular, + BoldFont = *-Bold + ] + \setCJKfamilyfont { zhfs } { FandolFang } + [ + Extension = .otf , + UprightFont = *-Regular + ] + \setCJKfamilyfont { zhkai } { FandolKai } + [ + Extension = .otf , + UprightFont = *-Regular + ] + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\endinput +%% +%% End of file `sjtu-cjk-font-fandol-zh.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol.def index 9778eddd..6bd5d368 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-fandol.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `cjkfont,fandol') +%% sjtutex.dtx (with options: `font,cjk,fandol,und') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,65 +24,13 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Fandol CJK fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-cjk-font-fandol.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\__sjtu_fontset_case:nnn - { \__sjtu_fontset_error:nn { cjk } { fandol } } - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { fandol } - \ctex_punct_set:n { fandol } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } - { - \setCJKmainfont { FandolSong } - [ - Extension = .otf, - UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = FandolKai-Regular - ] - \setCJKsansfont { FandolHei } - [ - Extension = .otf, - UprightFont = *-Regular, - BoldFont = *-Regular, - ] - \setCJKmonofont { FandolFang } - [ - Extension = .otf, - UprightFont = *-Regular, - ] - \setCJKfamilyfont { zhsong } { FandolSong } - [ - Extension = .otf, - UprightFont = *-Regular, - BoldFont = *-Bold - ] - \setCJKfamilyfont { zhhei } { FandolHei } - [ - Extension = .otf, - UprightFont = *-Regular, - BoldFont = *-Regular - ] - \setCJKfamilyfont { zhfs } { FandolFang } - [ - Extension = .otf, - UprightFont = *-Regular - ] - \setCJKfamilyfont { zhkai } { FandolKai } - [ - Extension = .otf, - UprightFont = *-Regular - ] - } -\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } -\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } -\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } -\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\tl_if_eq:NNTF \g__sjtu_lang_tl \c__sjtu_lang_ja_tl + { \ctex_file_input:n { sjtu-cjk-font-fandol-ja.def } } + { \ctex_file_input:n { sjtu-cjk-font-fandol-zh.def } } \endinput %% %% End of file `sjtu-cjk-font-fandol.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-ja.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-ja.def new file mode 100644 index 00000000..b004baff --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-ja.def @@ -0,0 +1,53 @@ +%% +%% This is file `sjtu-cjk-font-founder-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,founder,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Founder CJK fonts definition for Japanese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-founder-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { \__sjtu_fontset_error:nn { cjk } { founder } } + { + \setCJKmainfont { ipam.ttf } [ AutoFakeBold = 3 ] + \setCJKsansfont { ipag.ttf } [ AutoFakeBold = 3 ] + \setCJKmonofont { ipag.ttf } + \setCJKfamilyfont { jamin } { ipam.ttf } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { jagoth } { ipag.ttf } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhsong } { FZShuSong-Z01 } + [ AutoFakeBold = 3 , ItalicFont = FZKai-Z03 ] + \setCJKfamilyfont { zhhei } { FZHei-B01 } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhkai } { FZKai-Z03 } + \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\NewDocumentCommand \mincho { } { \CJKfamily { jamin } } +\NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } +\endinput +%% +%% End of file `sjtu-cjk-font-founder-ja.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-zh.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-zh.def new file mode 100644 index 00000000..741c81d4 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder-zh.def @@ -0,0 +1,56 @@ +%% +%% This is file `sjtu-cjk-font-founder-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,founder,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Founder CJK fonts definition for Chinese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-founder-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { + \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { founder } + \ctex_punct_set:n { founder } + \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } + \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } + \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } + } + { + \setCJKmainfont { FZShuSong-Z01 } + [ AutoFakeBold = 3 , ItalicFont = FZKai-Z03 ] + \setCJKsansfont { FZHei-B01 } [ AutoFakeBold = 3 ] + \setCJKmonofont { FZFangSong-Z02 } + \setCJKfamilyfont { zhsong } { FZShuSong-Z01 } + [ AutoFakeBold = 3 , ItalicFont = FZKai-Z03 ] + \setCJKfamilyfont { zhhei } { FZHei-B01 } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhkai } { FZKai-Z03 } + \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\endinput +%% +%% End of file `sjtu-cjk-font-founder-zh.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder.def index 12a19d6b..82186295 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-founder.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `cjkfont,founder') +%% sjtutex.dtx (with options: `font,cjk,founder,und') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,33 +24,13 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Founder CJK fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-cjk-font-founder.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\__sjtu_fontset_case:nn - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { founder } - \ctex_punct_set:n { founder } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } - { - \setCJKmainfont { FZShuSong-Z01 } - [ AutoFakeBold = 3, ItalicFont = FZKai-Z03 ] - \setCJKsansfont { FZHei-B01 } [ BoldFont = * ] - \setCJKmonofont { FZFangSong-Z02 } - \setCJKfamilyfont { zhsong } { FZShuSong-Z01 } - [ AutoFakeBold = 3, ItalicFont = FZKai-Z03 ] - \setCJKfamilyfont { zhhei } { FZHei-B01 } [ BoldFont = * ] - \setCJKfamilyfont { zhkai } { FZKai-Z03 } - \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } - } -\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } -\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } -\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } -\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\tl_if_eq:NNTF \g__sjtu_lang_tl \c__sjtu_lang_ja_tl + { \ctex_file_input:n { sjtu-cjk-font-founder-ja.def } } + { \ctex_file_input:n { sjtu-cjk-font-founder-zh.def } } \endinput %% %% End of file `sjtu-cjk-font-founder.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-ja.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-ja.def new file mode 100644 index 00000000..d44992af --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-ja.def @@ -0,0 +1,82 @@ +%% +%% This is file `sjtu-cjk-font-mac-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,mac,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {macOS CJK fonts definition for Japanese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-mac-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { \__sjtu_fontset_error:nn { cjk } { mac } } + { + \setCJKmainfont { Hiragino~Mincho~ProN } + [ + UprightFont = *~W3 , + BoldFont = *~W6 + ] + \setCJKsansfont { Hiragino~Kaku~Gothic~ProN } + [ + UprightFont = *~W3 , + BoldFont = *~W6 + ] + \setCJKmonofont { Hiragino~Kaku~Gothic~ProN } + \setCJKfamilyfont { jamin } { Hiragino~Mincho~ProN } + [ + UprightFont = *~W3 , + BoldFont = *~W6 + ] + \setCJKfamilyfont { jagoth } { Hiragino~Kaku~Gothic~ProN } + [ + UprightFont = *~W3 , + BoldFont = *~W6 + ] + \setCJKfamilyfont { zhsong } { Songti~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = Kaiti~SC~Regular , + BoldItalicFont = Kaiti~SC~Bold + ] + \setCJKfamilyfont { zhhei } { Heiti~SC } + [ + UprightFont = *~Medium , + AutoFakeBold = 3 + ] + \setCJKfamilyfont { zhfs } { STFangsong } + \setCJKfamilyfont { zhkai } { Kaiti~SC } + [ + UprightFont = *~Regular , + BoldFont = *~Bold + ] + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\NewDocumentCommand \mincho { } { \CJKfamily { jamin } } +\NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } +\endinput +%% +%% End of file `sjtu-cjk-font-mac-ja.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-zh.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-zh.def new file mode 100644 index 00000000..0bb010d1 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac-zh.def @@ -0,0 +1,80 @@ +%% +%% This is file `sjtu-cjk-font-mac-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,mac,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {macOS CJK fonts definition for Chinese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-mac-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nnn + { \__sjtu_fontset_error:nn { cjk } { mac } } + { + \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { mac } + \ctex_punct_set:n { mac } + \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } + \ctex_punct_map_family:nn { \CJKsfdefault } { zhpf } + \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhpf } + \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } + } + { + \setCJKmainfont { Songti~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = Kaiti~SC~Regular , + BoldItalicFont = Kaiti~SC~Bold + ] + \setCJKsansfont { Heiti~SC } + [ + UprightFont = *~Medium , + AutoFakeBold = 3 + ] + \setCJKmonofont { STFangsong } + \setCJKfamilyfont { zhsong } { Songti~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = Kaiti~SC~Regular , + BoldItalicFont = Kaiti~SC~Bold + ] + \setCJKfamilyfont { zhhei } { Heiti~SC } + [ + UprightFont = *~Medium , + AutoFakeBold = 3 + ] + \setCJKfamilyfont { zhfs } { STFangsong } + \setCJKfamilyfont { zhkai } { Kaiti~SC } + [ + UprightFont = *~Regular , + BoldFont = *~Bold + ] + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\endinput +%% +%% End of file `sjtu-cjk-font-mac-zh.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac.def index 44295cbf..2a7960f3 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-mac.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `cjkfont,mac') +%% sjtutex.dtx (with options: `font,cjk,mac,und') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,55 +24,13 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {macOS CJK fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-cjk-font-mac.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\__sjtu_fontset_case:nnn - { \__sjtu_fontset_error:nn { cjk } { mac } } - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { mac } - \ctex_punct_set:n { mac } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_family:nn { \CJKsfdefault } { zhpf } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhpf } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } - { - \setCJKmainfont { Songti~SC } - [ - UprightFont = *~Light, - BoldFont = *~Bold, - ItalicFont = Kaiti~SC~Regular, - BoldItalicFont = Kaiti~SC~Bold - ] - \setCJKsansfont { Heiti~SC } - [ - UprightFont = *~Medium, - BoldFont = *~Medium - ] - \setCJKmonofont { STFangsong } - \setCJKfamilyfont { zhsong } { Songti~SC } - [ - UprightFont = *~Light, - BoldFont = *~Bold - ] - \setCJKfamilyfont { zhhei } { Heiti~SC } - [ - UprightFont = *~Medium, - BoldFont = *~Medium - ] - \setCJKfamilyfont { zhfs } { STFangsong } - \setCJKfamilyfont { zhkai } { Kaiti~SC } - [ - UprightFont = *~Regular, - BoldFont = *~Bold - ] - } -\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } -\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } -\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } -\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\tl_if_eq:NNTF \g__sjtu_lang_tl \c__sjtu_lang_ja_tl + { \ctex_file_input:n { sjtu-cjk-font-mac-ja.def } } + { \ctex_file_input:n { sjtu-cjk-font-mac-zh.def } } \endinput %% %% End of file `sjtu-cjk-font-mac.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-ja.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-ja.def new file mode 100644 index 00000000..89f89f81 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-ja.def @@ -0,0 +1,76 @@ +%% +%% This is file `sjtu-cjk-font-ubuntu-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,ubuntu,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Ubuntu CJK fonts definition for Japanese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-ubuntu-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { \__sjtu_fontset_error:nn { cjk } { ubuntu } } + { + \setCJKmainfont { Noto~Serif~CJK~JP } + [ + UprightFont = *~Light , + BoldFont = *~Bold + ] + \setCJKsansfont { Noto~Sans~CJK~JP } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] + \setCJKmonofont { Noto~Sans~Mono~CJK~JP } + \setCJKfamilyfont { jamin } { Noto~Serif~CJK~JP } + [ + UprightFont = *~Light , + BoldFont = *~Bold + ] + \setCJKfamilyfont { jagoth } { Noto~Sans~CJK~JP } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] + \setCJKfamilyfont { zhsong } { Noto~Serif~CJK~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = AR~PL~KaitiM~GB + ] + \setCJKfamilyfont { zhhei } { Noto~Sans~CJK~SC } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] + \setCJKfamilyfont { zhfs } { Noto~Sans~Mono~CJK~JP } + \setCJKfamilyfont { zhkai } { AR~PL~KaitiM~GB } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\NewDocumentCommand \mincho { } { \CJKfamily { jamin } } +\NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } +\endinput +%% +%% End of file `sjtu-cjk-font-ubuntu-ja.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-zh.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-zh.def new file mode 100644 index 00000000..bd4cd7f0 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu-zh.def @@ -0,0 +1,72 @@ +%% +%% This is file `sjtu-cjk-font-ubuntu-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,ubuntu,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Ubuntu CJK fonts definition for Chinese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-ubuntu-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nnn + { \__sjtu_fontset_error:nn { cjk } { ubuntu } } + { + \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhsong } { ubuntu } + \ctex_punct_set:n { ubuntu } + \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } + \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } + \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } + } + { + \setCJKmainfont { Noto~Serif~CJK~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = AR~PL~KaitiM~GB + ] + \setCJKsansfont { Noto~Sans~CJK~SC } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] + \setCJKmonofont { Noto~Sans~Mono~CJK~SC } + \setCJKfamilyfont { zhsong } { Noto~Serif~CJK~SC } + [ + UprightFont = *~Light , + BoldFont = *~Bold , + ItalicFont = AR~PL~KaitiM~GB + ] + \setCJKfamilyfont { zhhei } { Noto~Sans~CJK~SC } + [ + UprightFont = *~Medium , + BoldFont = *~Bold + ] + \setCJKfamilyfont { zhfs } { Noto~Sans~Mono~CJK~JP } + \setCJKfamilyfont { zhkai } { AR~PL~KaitiM~GB } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\endinput +%% +%% End of file `sjtu-cjk-font-ubuntu-zh.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu.def index 3c46db00..90237b3e 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-ubuntu.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `cjkfont,ubuntu') +%% sjtutex.dtx (with options: `font,cjk,ubuntu,und') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,48 +24,13 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Ubuntu CJK fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-cjk-font-ubuntu.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\__sjtu_fontset_case:nnn - { \__sjtu_fontset_error:nn { cjk } { ubuntu } } - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhsong } { ubuntu } - \ctex_punct_set:n { ubuntu } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } - { - \setCJKmainfont { Noto~Serif~CJK~SC } - [ - UprightFont = *~Light, - BoldFont = *~Bold, - ItalicFont = AR~PL~KaitiM~GB - ] - \setCJKsansfont { Noto~Sans~CJK~SC } - [ - UprightFont = *~Medium, - BoldFont = *~Medium - ] - \setCJKmonofont { Noto~Sans~Mono~CJK~SC } - \setCJKfamilyfont { zhsong } { Noto~Serif~CJK~SC } - [ - UprightFont = *~Light, - BoldFont = *~Bold, - ItalicFont = AR~PL~KaitiM~GB - ] - \setCJKfamilyfont { zhhei } { Noto~Sans~CJK~SC } - [ - UprightFont = *~Medium, - BoldFont = *~Medium - ] - \setCJKfamilyfont { zhkai } { AR~PL~KaitiM~GB } - } -\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } -\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } -\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\tl_if_eq:NNTF \g__sjtu_lang_tl \c__sjtu_lang_ja_tl + { \ctex_file_input:n { sjtu-cjk-font-ubuntu-ja.def } } + { \ctex_file_input:n { sjtu-cjk-font-ubuntu-zh.def } } \endinput %% %% End of file `sjtu-cjk-font-ubuntu.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-ja.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-ja.def new file mode 100644 index 00000000..62bfdde9 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-ja.def @@ -0,0 +1,53 @@ +%% +%% This is file `sjtu-cjk-font-windows-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,windows,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Windows CJK fonts definition for Japanese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-windows-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { \__sjtu_fontset_error:nn { cjk } { windows } } + { + \setCJKmainfont { MS~Mincho } [ AutoFakeBold = 3 ] + \setCJKsansfont { MS~Gothic } [ AutoFakeBold = 3 ] + \setCJKmonofont { MS~Gothic } + \setCJKfamilyfont { jamin } { MS~Mincho } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { jagoth } { MS~Gothic } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhsong } { SimSun } + [ AutoFakeBold = 3 , ItalicFont = KaiTi ] + \setCJKfamilyfont { zhhei } { SimHei } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhkai } { KaiTi } + \setCJKfamilyfont { zhfs } { FangSong } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\NewDocumentCommand \mincho { } { \CJKfamily { jamin } } +\NewDocumentCommand \gothic { } { \CJKfamily { jagoth } } +\endinput +%% +%% End of file `sjtu-cjk-font-windows-ja.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-zh.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-zh.def new file mode 100644 index 00000000..5e7f29f9 --- /dev/null +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows-zh.def @@ -0,0 +1,56 @@ +%% +%% This is file `sjtu-cjk-font-windows-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `font,cjk,windows,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Windows CJK fonts definition for Chinese (SJTUTeX)} +\ProvidesExplFile{sjtu-cjk-font-windows-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_fontset_case:nn + { + \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { windows } + \ctex_punct_set:n { windows } + \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } + \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } + \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } + } + { + \setCJKmainfont { SimSun } + [ AutoFakeBold = 3 , ItalicFont = KaiTi ] + \setCJKsansfont { SimHei } [ AutoFakeBold = 3 ] + \setCJKmonofont { FangSong } + \setCJKfamilyfont { zhsong } { SimSun } + [ AutoFakeBold = 3 , ItalicFont = KaiTi ] + \setCJKfamilyfont { zhhei } { SimHei } [ AutoFakeBold = 3 ] + \setCJKfamilyfont { zhkai } { KaiTi } + \setCJKfamilyfont { zhfs } { FangSong } + } +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\endinput +%% +%% End of file `sjtu-cjk-font-windows-zh.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows.def b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows.def index 87bc3a7e..d20d65ec 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-cjk-font-windows.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `cjkfont,windows') +%% sjtutex.dtx (with options: `font,cjk,windows,und') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,33 +24,13 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Windows CJK fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-cjk-font-windows.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\__sjtu_fontset_case:nn - { - \ctex_load_zhmap:nnnn { zhsong } { zhhei } { zhfs } { windows } - \ctex_punct_set:n { windows } - \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong } - \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei } - \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai } - } - { - \setCJKmainfont { SimSun } - [ AutoFakeBold = 3, ItalicFont = KaiTi ] - \setCJKsansfont { SimHei } [ BoldFont = * ] - \setCJKmonofont { FangSong } - \setCJKfamilyfont { zhsong } { SimSun } - [ AutoFakeBold = 3, ItalicFont = KaiTi ] - \setCJKfamilyfont { zhhei } { SimHei } [ BoldFont = * ] - \setCJKfamilyfont { zhkai } { KaiTi } - \setCJKfamilyfont { zhfs } { FangSong } - } -\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } -\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } -\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } -\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +\tl_if_eq:NNTF \g__sjtu_lang_tl \c__sjtu_lang_ja_tl + { \ctex_file_input:n { sjtu-cjk-font-windows-ja.def } } + { \ctex_file_input:n { sjtu-cjk-font-windows-zh.def } } \endinput %% %% End of file `sjtu-cjk-font-windows.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-cambria.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-cambria.def index 95baab58..3397a2cd 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-cambria.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-cambria.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,cambria') +%% sjtutex.dtx (with options: `font,math,cambria') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Cambria math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-cambria.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -35,7 +35,7 @@ \setmathfont { Cambria~Math } \setmathrm { Cambria } \setmathsf { Calibri } - \setmathtt { Consolas } [ Scale = MatchLowercase ] + \setmathtt { Consolas } [ Scale = 0.95 ] } \endinput %% diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-lm.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-lm.def index 6ce7dd39..c20e7af6 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-lm.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-lm.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,lm') +%% sjtutex.dtx (with options: `font,math,lm') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Latin Modern math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-lm.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newcm.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newcm.def index 2ad43a16..d0aa8cf6 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newcm.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newcm.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,newcm') +%% sjtutex.dtx (with options: `font,math,newcm') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {New Computer Modern math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-newcm.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newpx.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newpx.def index fbfff256..440dc046 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newpx.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newpx.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,newpx') +%% sjtutex.dtx (with options: `font,math,newpx') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {New PX math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-newpx.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -33,9 +33,10 @@ \tl_set_eq:NN \g__sjtu_save_sfdefault_tl \sfdefault \tl_set_eq:NN \g__sjtu_save_ttdefault_tl \ttdefault \tl_set:Nn \encodingdefault { OT1 } -\tl_set:Nn \rmdefault { zpltlf } +\tl_set:Nn \rmdefault { zplTLF } +\tl_set:Nn \qhv@scale { 0.94 } \tl_set:Nn \sfdefault { qhv } -\tl_set:Nn \ttdefault { ntxtt } +\tl_set:Nn \ttdefault { qcr } \RequirePackage { newpxmath } \RequirePackage { bm } \tl_set_eq:NN \encodingdefault \g__sjtu_save_encodingdefault_tl diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newtx.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newtx.def index d62f0852..670019d4 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newtx.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-newtx.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,newtx') +%% sjtutex.dtx (with options: `font,math,newtx') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {New TX math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-newtx.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -34,8 +34,9 @@ \tl_set_eq:NN \g__sjtu_save_ttdefault_tl \ttdefault \tl_set:Nn \encodingdefault { OT1 } \tl_set:Nn \rmdefault { ntxtlf } +\tl_set:Nn \qhv@scale { 0.94 } \tl_set:Nn \sfdefault { qhv } -\tl_set:Nn \ttdefault { ntxtt } +\tl_set:Nn \ttdefault { qcr } \RequirePackage { newtxmath } \RequirePackage { bm } \tl_set_eq:NN \encodingdefault \g__sjtu_save_encodingdefault_tl diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-stixtwo.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-stixtwo.def index 87462372..d57a55ee 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-stixtwo.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-stixtwo.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,stixtwo') +%% sjtutex.dtx (with options: `font,math,stixtwo') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {STIX Two math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-stixtwo.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -63,7 +63,8 @@ UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, - BoldItalicFont = *-bolditalic + BoldItalicFont = *-bolditalic, + Scale = 0.94, ] \setmathtt { texgyrecursor } @@ -73,7 +74,6 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, - Scale = MatchLowercase, Ligatures = CommonOff ] } diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-times.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-times.def index 2c286442..22854f7e 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-times.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-times.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,times') +%% sjtutex.dtx (with options: `font,math,times') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Times math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-times.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -32,6 +32,7 @@ \tl_set_eq:NN \g__sjtu_save_rmdefault_tl \rmdefault \RequirePackage { mathptmx } \tl_set_eq:NN \rmdefault \g__sjtu_save_rmdefault_tl +\tl_set:Nn \Hv@scale { 0.94 } \DeclareMathAlphabet { \mathsf } { OT1 } { phv } { m } { n } \DeclareMathAlphabet { \mathtt } { OT1 } { pcr } { m } { n } \SetMathAlphabet { \mathsf } { bold } { OT1 } { phv } { b } { n } diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-xits.def b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-xits.def index c37bb4be..b8aedd16 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-math-font-xits.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-math-font-xits.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `mathfont,xits') +%% sjtutex.dtx (with options: `font,math,xits') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {XITS math fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-math-font-xits.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -69,7 +69,8 @@ UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, - BoldItalicFont = *-bolditalic + BoldItalicFont = *-bolditalic, + Scale = 0.94, ] \setmathtt { texgyrecursor } @@ -79,7 +80,6 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, - Scale = MatchLowercase, Ligatures = CommonOff ] } diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-cambria.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-cambria.def index 9bb4c6d7..7d4df222 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-cambria.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-cambria.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,cambria') +%% sjtutex.dtx (with options: `font,text,cambria') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Cambria text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-cambria.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -33,7 +33,7 @@ { \setmainfont { Cambria } \setsansfont { Calibri } - \setmonofont { Consolas } [ Scale = MatchLowercase ] + \setmonofont { Consolas } [ Scale = 0.95 ] } \endinput %% diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-lm.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-lm.def index 72ec3ff9..825022b7 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-lm.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-lm.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,lm') +%% sjtutex.dtx (with options: `font,text,lm') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,13 +24,17 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Latin Modern text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-lm.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\tl_set:Nn \rmdefault { lmr } -\tl_set:Nn \sfdefault { lmss } -\tl_set:Nn \ttdefault { lmtt } +\__sjtu_fontset_case:nn + { + \tl_set:Nn \encodingdefault { T1 } + \tl_set:Nn \rmdefault { lmr } + \tl_set:Nn \sfdefault { lmss } + \tl_set:Nn \ttdefault { lmtt } + } { } \endinput %% %% End of file `sjtu-text-font-lm.def'. diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newcm.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newcm.def index 5179c590..20b94f12 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newcm.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newcm.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,newcm') +%% sjtutex.dtx (with options: `font,text,newcm') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {New Computer Modern text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-newcm.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newpx.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newpx.def index 77e5eb7f..c9899a86 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newpx.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newpx.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,newpx') +%% sjtutex.dtx (with options: `font,text,newpx') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,12 +24,16 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {New PX text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-newpx.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \__sjtu_fontset_case:nn - { \RequirePackage { newpxtext } } + { + \tl_set:Nn \encodingdefault { T1 } + \RequirePackage { newpxtext } + \tl_set:Nn \ttdefault { qcr } + } { \setmainfont { TeXGyrePagellaX } @@ -47,7 +51,8 @@ UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, - BoldItalicFont = *-bolditalic + BoldItalicFont = *-bolditalic, + Scale = 0.94, ] \setmonofont { texgyrecursor } @@ -57,7 +62,6 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, - Scale = MatchLowercase, Ligatures = CommonOff ] } diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newtx.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newtx.def index 28ec5a13..222395a0 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newtx.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-newtx.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,newtx') +%% sjtutex.dtx (with options: `font,text,newtx') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,12 +24,16 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {New TX text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-newtx.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \__sjtu_fontset_case:nn - { \RequirePackage { newtxtext } } + { + \tl_set:Nn \encodingdefault { T1 } + \RequirePackage { newtxtext } + \tl_set:Nn \ttdefault { qcr } + } { \setmainfont { TeXGyreTermesX } @@ -47,7 +51,8 @@ UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, - BoldItalicFont = *-bolditalic + BoldItalicFont = *-bolditalic, + Scale = 0.94, ] \setmonofont { texgyrecursor } @@ -57,7 +62,6 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, - Scale = MatchLowercase, Ligatures = CommonOff ] } diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-stixtwo.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-stixtwo.def index d57e16f1..bbf027bd 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-stixtwo.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-stixtwo.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,stixtwo') +%% sjtutex.dtx (with options: `font,text,stixtwo') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,15 +24,17 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {STIX Two text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-stixtwo.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \__sjtu_fontset_case:nn { + \tl_set:Nn \encodingdefault { T1 } \tl_set:Nn \rmdefault { stix2 } - \tl_set:Nn \sfdefault { phv } - \tl_set:Nn \ttdefault { pcr } + \tl_set:Nn \qhv@scale { 0.94 } + \tl_set:Nn \sfdefault { qhv } + \tl_set:Nn \ttdefault { qcr } } { \setmainfont @@ -51,7 +53,8 @@ UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, - BoldItalicFont = *-bolditalic + BoldItalicFont = *-bolditalic, + Scale = 0.94, ] \setmonofont { texgyrecursor } @@ -61,7 +64,6 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, - Scale = MatchLowercase, Ligatures = CommonOff ] } diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-times.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-times.def index cb1defdf..5cf34ca9 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-times.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-times.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,times') +%% sjtutex.dtx (with options: `font,text,times') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,20 +24,22 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Times text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-times.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \__sjtu_fontset_case:nn { + \tl_set:Nn \encodingdefault { T1 } \tl_set:Nn \rmdefault { ptm } + \tl_set:Nn \Hv@scale { 0.94 } \tl_set:Nn \sfdefault { phv } \tl_set:Nn \ttdefault { pcr } } { \setmainfont { Times~New~Roman } [ Ligatures = Rare ] - \setsansfont { Arial } - \setmonofont { Courier~New } [ Scale = MatchLowercase ] + \setsansfont { Arial } [ Scale = 0.94 ] + \setmonofont { Courier~New } } \endinput %% diff --git a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-xits.def b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-xits.def index a97d6d9b..c8298b30 100644 --- a/texmf/tex/latex/sjtutex/fd/sjtu-text-font-xits.def +++ b/texmf/tex/latex/sjtutex/fd/sjtu-text-font-xits.def @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% sjtutex.dtx (with options: `textfont,xits') +%% sjtutex.dtx (with options: `font,text,xits') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,7 +24,7 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {XITS text fonts definition (SJTUTeX)} \ProvidesExplFile{sjtu-text-font-xits.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -47,7 +47,8 @@ UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, - BoldItalicFont = *-bolditalic + BoldItalicFont = *-bolditalic, + Scale = 0.94, ] \setmonofont { texgyrecursor } @@ -57,7 +58,6 @@ BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic, - Scale = MatchLowercase, Ligatures = CommonOff ] } diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-generic-de.def b/texmf/tex/latex/sjtutex/sjtu-lang-generic-de.def new file mode 100644 index 00000000..3bdc5c0c --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-generic-de.def @@ -0,0 +1,52 @@ +%% +%% This is file `sjtu-lang-generic-de.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,generic,de') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {German specific definition for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-generic-de.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\cs_new:Npn \__sjtu_date_aux_de:nnn #1#2#3 + { + \clist_item:Nn \c__sjtu_name_month_de_clist {#2} ~ + {#3} ,~ \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_de:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_de:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_de:nn #1#2 + { + \clist_item:Nn \c__sjtu_name_month_de_clist {#2} ,~ + \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_short_de:w #1-#2 \q_stop + { \__sjtu_date_aux_short_de:nn {#1} {#2} } +\cs_new_protected:Nn \__sjtu_set_language_de: + { + \ctex_set:n { autoindent = 1.5 em } + \normalfont + } +\endinput +%% +%% End of file `sjtu-lang-generic-de.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-generic-en.def b/texmf/tex/latex/sjtutex/sjtu-lang-generic-en.def new file mode 100644 index 00000000..3fe0e8b4 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-generic-en.def @@ -0,0 +1,75 @@ +%% +%% This is file `sjtu-lang-generic-en.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,generic,en') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {English specific definition for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-generic-en.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\cs_new:Npn \__sjtu_ordinal_en:n #1 + { + \int_to_arabic:n {#1} + \exp_not:N \textsuperscript + { + \int_case:nnF { \int_mod:nn {#1} { 100 } } + { + { 11 } { th } + { 12 } { th } + { 13 } { th } + } + { + \int_case:nnF { \int_mod:nn {#1} { 10 } } + { + { 1 } { st } + { 2 } { nd } + { 3 } { rd } + } + { th } + } + } + } +\cs_new:Npn \__sjtu_date_aux_en:nnn #1#2#3 + { + \clist_item:Nn \c__sjtu_name_month_en_clist {#2} ~ + \__sjtu_ordinal_en:n {#3} ,~ + \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_en:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_en:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_en:nn #1#2 + { + \clist_item:Nn \c__sjtu_name_month_en_clist {#2} ,~ + \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_short_en:w #1-#2 \q_stop + { \__sjtu_date_aux_short_en:nn {#1} {#2} } +\cs_new_protected:Nn \__sjtu_set_language_en: + { + \ctex_set:n { autoindent = 1.5 em } + \normalfont + } +\endinput +%% +%% End of file `sjtu-lang-generic-en.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-generic-ja.def b/texmf/tex/latex/sjtutex/sjtu-lang-generic-ja.def new file mode 100644 index 00000000..7fda0977 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-generic-ja.def @@ -0,0 +1,60 @@ +%% +%% This is file `sjtu-lang-generic-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,generic,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Japanese specific definition for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-generic-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\cs_new:Npn \__sjtu_date_aux_ja:nnn #1#2#3 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_ja_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_ja_tl } ~ + \int_to_arabic:n {#3} ~ { \exp_not:V \c__sjtu_name_day_ja_tl } + } +\cs_new:Npn \__sjtu_date_aux_ja:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_ja:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_ja:nn #1#2 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_ja_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_ja_tl } + } +\cs_new:Npn \__sjtu_date_aux_short_ja:w #1-#2 \q_stop + { \__sjtu_date_aux_short_ja:nn {#1} {#2} } +\cs_new:Nn \__sjtu_set_cjk_default_ja: + { + \tl_set:Nn \CJKrmdefault { jamin } + \tl_set:Nn \CJKsfdefault { jagoth } + \tl_set:Nn \CJKttdefault { jagoth } + } +\cs_new_protected:Nn \__sjtu_set_language_ja: + { + \ctex_set:n { autoindent = 1 } + \__sjtu_set_cjk_default_ja: + \normalfont + } +\endinput +%% +%% End of file `sjtu-lang-generic-ja.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-generic-zh.def b/texmf/tex/latex/sjtutex/sjtu-lang-generic-zh.def new file mode 100644 index 00000000..24e3b06e --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-generic-zh.def @@ -0,0 +1,60 @@ +%% +%% This is file `sjtu-lang-generic-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,generic,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Chinese specific definition for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-generic-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\cs_new:Npn \__sjtu_date_aux_zh:nnn #1#2#3 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_zh_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_zh_tl } ~ + \int_to_arabic:n {#3} ~ { \exp_not:V \c__sjtu_name_day_zh_tl } + } +\cs_new:Npn \__sjtu_date_aux_zh:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_zh:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_zh:nn #1#2 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_zh_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_zh_tl } + } +\cs_new:Npn \__sjtu_date_aux_short_zh:w #1-#2 \q_stop + { \__sjtu_date_aux_short_zh:nn {#1} {#2} } +\cs_new:Nn \__sjtu_set_cjk_default_zh: + { + \tl_set:Nn \CJKrmdefault { zhsong } + \tl_set:Nn \CJKsfdefault { zhhei } + \tl_set:Nn \CJKttdefault { zhfs } + } +\cs_new_protected:Nn \__sjtu_set_language_zh: + { + \ctex_set:n { autoindent = true } + \__sjtu_set_cjk_default_zh: + \normalfont + } +\endinput +%% +%% End of file `sjtu-lang-generic-zh.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-thesis-de.def b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-de.def new file mode 100644 index 00000000..72a237a5 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-de.def @@ -0,0 +1,116 @@ +%% +%% This is file `sjtu-lang-thesis-de.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,thesis,de') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {German specific definition for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-thesis-de.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_info_keys_define:n { de } +\keys_define:nn { sjtu / info / de } + { + subject .initial:x = + { + Eine~ Dissertation~ Eingereicht~ an \exp_not:N \\ + der~ { \exp_not:V \c__sjtu_name_univ_de_tl }~ für~ + { \exp_not:V \c__sjtu_name_degree_level_de_tl } titel + } + } +\cs_new:Npn \__sjtu_date_aux_de:nnn #1#2#3 + { + \clist_item:Nn \c__sjtu_name_month_de_clist {#2} ~ + {#3} ,~ \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_de:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_de:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_de:nn #1#2 + { + \clist_item:Nn \c__sjtu_name_month_de_clist {#2} ,~ + \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_short_de:w #1-#2 \q_stop + { \__sjtu_date_aux_short_de:nn {#1} {#2} } +\cs_new_protected:Nn \__sjtu_set_language_de: + { + \ctex_set:n { autoindent = 1.5 em } + \normalfont + } +\cs_new:Npn \ps@SJTU@fund@de + { + \ps@empty + \cs_set:Npn \@oddfoot + { + \begin{minipage} { \textwidth } + \centering \zihao { - 5 } + \clist_use:Nn \l__sjtu_info_fund_de_clist { \par } + \end{minipage} + } + \cs_set_eq:NN \@evenfoot \@oddfoot + } +\clist_map_inline:nn + { + { subject } + { + format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , + content = \l__sjtu_info_subject_de_tl , + bottom-skip = \c_zero_dim plus 2 fill + }, + { title } + { + format = \zihao { -2 } \bfseries \fixedlineskip { 31.2 bp } , + content = \MakeUppercase \l__sjtu_info_display_title_de_tl , + bottom-skip = \c_zero_dim plus 2 fill + }, + { info } + { + format = \zihao { 3 } \fixedlineskip { 31.2 bp } , + content = + { + \__sjtu_title_page_info_i:nxn { de } + { author, \l__sjtu_info_supervisors_clist } + { { \bfseries #1 \c__sjtu_name_info_sep_de_tl } {#3} } + } , + bottom-skip = \c_zero_dim plus 3 fill + }, + { date } + { + format = \zihao { 3 } \fixedlineskip { 31.2 bp } , + content = + { \__sjtu_title_page_info_ii:n { de } } + }, + } + { + \__sjtu_declare_component:nnn { title / de } #1 + } +\__sjtu_declare_page:nn { title / de } + { + style = SJTU@fund@de , + format = \linespread { 1 } \__sjtu_set_language_de: , + prefix = title / de , + components = { subject, title, info, date } + } +\endinput +%% +%% End of file `sjtu-lang-thesis-de.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-thesis-en.def b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-en.def new file mode 100644 index 00000000..42fced50 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-en.def @@ -0,0 +1,139 @@ +%% +%% This is file `sjtu-lang-thesis-en.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,thesis,en') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {English specific definition for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-thesis-en.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_info_keys_define:n { en } +\keys_define:nn { sjtu / info / en } + { + subject .initial:x = + { + A~ Dissertation~ Submitted~ to \exp_not:N \\ + { \exp_not:V \c__sjtu_name_univ_en_tl }~ for~ + { \exp_not:V \c__sjtu_name_degree_level_en_tl }~ Degree + } + } +\cs_new:Npn \__sjtu_ordinal_en:n #1 + { + \int_to_arabic:n {#1} + \exp_not:N \textsuperscript + { + \int_case:nnF { \int_mod:nn {#1} { 100 } } + { + { 11 } { th } + { 12 } { th } + { 13 } { th } + } + { + \int_case:nnF { \int_mod:nn {#1} { 10 } } + { + { 1 } { st } + { 2 } { nd } + { 3 } { rd } + } + { th } + } + } + } +\cs_new:Npn \__sjtu_date_aux_en:nnn #1#2#3 + { + \clist_item:Nn \c__sjtu_name_month_en_clist {#2} ~ + \__sjtu_ordinal_en:n {#3} ,~ + \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_en:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_en:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_en:nn #1#2 + { + \clist_item:Nn \c__sjtu_name_month_en_clist {#2} ,~ + \int_to_arabic:n {#1} + } +\cs_new:Npn \__sjtu_date_aux_short_en:w #1-#2 \q_stop + { \__sjtu_date_aux_short_en:nn {#1} {#2} } +\cs_new_protected:Nn \__sjtu_set_language_en: + { + \ctex_set:n { autoindent = 1.5 em } + \normalfont + } +\cs_new:Npn \ps@SJTU@fund@en + { + \ps@empty + \cs_set:Npn \@oddfoot + { + \begin{minipage} { \textwidth } + \centering \zihao { - 5 } + \clist_use:Nn \l__sjtu_info_fund_en_clist { \par } + \end{minipage} + } + \cs_set_eq:NN \@evenfoot \@oddfoot + } +\clist_map_inline:nn + { + { subject } + { + format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , + content = \l__sjtu_info_subject_en_tl , + bottom-skip = \c_zero_dim plus 2 fill + }, + { title } + { + format = \zihao { -2 } \bfseries \fixedlineskip { 31.2 bp } , + content = \MakeUppercase \l__sjtu_info_display_title_en_tl , + bottom-skip = \c_zero_dim plus 2 fill + }, + { info } + { + format = \zihao { 3 } \fixedlineskip { 31.2 bp } , + content = + { + \__sjtu_title_page_info_i:nxn { en } + { author, \l__sjtu_info_supervisors_clist } + { { \bfseries #1 \c__sjtu_name_info_sep_en_tl } {#3} } + } , + bottom-skip = \c_zero_dim plus 3 fill + }, + { date } + { + format = \zihao { 3 } \fixedlineskip { 31.2 bp } , + content = + { \__sjtu_title_page_info_ii:n { en } } + }, + } + { + \__sjtu_declare_component:nnn { title / en } #1 + } +\__sjtu_declare_page:nn { title / en } + { + style = SJTU@fund@en , + format = \linespread { 1 } \__sjtu_set_language_en: , + prefix = title / en , + components = { subject, title, info, date } + } +\endinput +%% +%% End of file `sjtu-lang-thesis-en.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-thesis-ja.def b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-ja.def new file mode 100644 index 00000000..8af20236 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-ja.def @@ -0,0 +1,124 @@ +%% +%% This is file `sjtu-lang-thesis-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,thesis,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Japanese specific definition for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-thesis-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_info_keys_define:n { ja } +\keys_define:nn { sjtu / info / ja } + { + subject .initial:x = + { + \exp_not:V \c__sjtu_name_univ_ja_tl + \exp_not:V \c__sjtu_name_degree_level_ja_tl + \exp_not:V \c__sjtu_name_thesis_ja_tl + } + } +\cs_new:Npn \__sjtu_date_aux_ja:nnn #1#2#3 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_ja_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_ja_tl } ~ + \int_to_arabic:n {#3} ~ { \exp_not:V \c__sjtu_name_day_ja_tl } + } +\cs_new:Npn \__sjtu_date_aux_ja:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_ja:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_ja:nn #1#2 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_ja_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_ja_tl } + } +\cs_new:Npn \__sjtu_date_aux_short_ja:w #1-#2 \q_stop + { \__sjtu_date_aux_short_ja:nn {#1} {#2} } +\cs_new:Nn \__sjtu_set_cjk_default_ja: + { + \tl_set:Nn \CJKrmdefault { jamin } + \tl_set:Nn \CJKsfdefault { jagoth } + \tl_set:Nn \CJKttdefault { jagoth } + } +\cs_new_protected:Nn \__sjtu_set_language_ja: + { + \ctex_set:n { autoindent = 1 } + \__sjtu_set_cjk_default_ja: + \normalfont + } +\cs_new:Npn \ps@SJTU@fund@ja + { + \ps@empty + \cs_set:Npn \@oddfoot + { + \begin{minipage} { \textwidth } + \centering \zihao { - 5 } + \clist_use:Nn \l__sjtu_info_fund_ja_clist { \par } + \end{minipage} + } + \cs_set_eq:NN \@evenfoot \@oddfoot + } +\clist_map_inline:nn + { + { subject } + { + format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , + content = \l__sjtu_info_subject_ja_tl , + bottom-skip = \c_zero_dim plus 2 fill + }, + { title } + { + format = \zihao { -2 } \bfseries \fixedlineskip { 31.2 bp } , + content = \l__sjtu_info_display_title_ja_tl , + bottom-skip = \c_zero_dim plus 2 fill + }, + { info } + { + format = \zihao { 3 } \fixedlineskip { 31.2 bp } , + content = + { + \__sjtu_title_page_info_i:nxn { ja } + { author, \l__sjtu_info_supervisors_clist } + { { \bfseries #1 \c__sjtu_name_info_sep_ja_tl } {#3} } + } , + bottom-skip = \c_zero_dim plus 3 fill + }, + { date } + { + format = \zihao { 3 } \fixedlineskip { 31.2 bp } , + content = + { \__sjtu_title_page_info_ii:n { ja } } + }, + } + { + \__sjtu_declare_component:nnn { title / ja } #1 + } +\__sjtu_declare_page:nn { title / ja } + { + style = SJTU@fund@ja , + format = \linespread { 1 } \__sjtu_set_language_ja: , + prefix = title / ja , + components = { subject, title, info, date } + } +\endinput +%% +%% End of file `sjtu-lang-thesis-ja.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-lang-thesis-zh.def b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-zh.def new file mode 100644 index 00000000..caf586a9 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-lang-thesis-zh.def @@ -0,0 +1,145 @@ +%% +%% This is file `sjtu-lang-thesis-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `lang,thesis,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Chinese specific definition for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-lang-thesis-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\__sjtu_info_keys_define:n { zh } +\keys_define:nn { sjtu / info / zh } + { + subject .initial:x = + { + \exp_not:V \c__sjtu_name_univ_zh_tl + \exp_not:V \c__sjtu_name_degree_level_zh_tl + \exp_not:V \c__sjtu_name_thesis_zh_tl + } + } +\cs_new:Npn \__sjtu_date_aux_zh:nnn #1#2#3 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_zh_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_zh_tl } ~ + \int_to_arabic:n {#3} ~ { \exp_not:V \c__sjtu_name_day_zh_tl } + } +\cs_new:Npn \__sjtu_date_aux_zh:w #1-#2-#3 \q_stop + { \__sjtu_date_aux_zh:nnn {#1} {#2} {#3} } +\cs_new:Npn \__sjtu_date_aux_short_zh:nn #1#2 + { + \int_to_arabic:n {#1} ~ { \exp_not:V \c__sjtu_name_year_zh_tl } ~ + \int_to_arabic:n {#2} ~ { \exp_not:V \c__sjtu_name_month_zh_tl } + } +\cs_new:Npn \__sjtu_date_aux_short_zh:w #1-#2 \q_stop + { \__sjtu_date_aux_short_zh:nn {#1} {#2} } +\cs_new:Nn \__sjtu_set_cjk_default_zh: + { + \tl_set:Nn \CJKrmdefault { zhsong } + \tl_set:Nn \CJKsfdefault { zhhei } + \tl_set:Nn \CJKttdefault { zhfs } + } +\cs_new_protected:Nn \__sjtu_set_language_zh: + { + \ctex_set:n { autoindent = true } + \__sjtu_set_cjk_default_zh: + \normalfont + } +\cs_new:Npn \ps@SJTU@fund@zh + { + \ps@empty + \cs_set:Npn \@oddfoot + { + \begin{minipage} { \textwidth } + \centering \zihao { - 5 } + \clist_use:Nn \l__sjtu_info_fund_zh_clist { \par } + \end{minipage} + } + \cs_set_eq:NN \@evenfoot \@oddfoot + } +\clist_map_inline:nn + { + { logo } + { + content = + { + \includegraphics [ width = 3 cm ] + { sjtu-vi-badge- \l__sjtu_style_title_logo_color_tl .pdf } + } + }, + { subject } + { + format = \zihao { -2 } \fixedlineskip { 31.2 bp } , + content = \l__sjtu_info_subject_zh_tl , + bottom-skip = \c_zero_dim plus 2 fill + }, + { title } + { + format = \zihao { 2 } \bfseries \fixedlineskip { 31.2 bp } , + content = \l__sjtu_info_display_title_zh_tl , + bottom-skip = \c_zero_dim plus 3 fill + }, + { info } + { + format = \zihao { 4 } \fixedlineskip { 31.2 bp } , + content = + { + \__sjtu_title_page_info_i:nxn { zh } + { + author, + id, + \l__sjtu_info_supervisors_clist , + department, + major, + \int_compare:nNnF { \g__sjtu_thesis_type_int } = { 1 } + { degree } + } + { + \__sjtu_cjk_spread_box:nn { 5 em } { \heiti #1 } + \c__sjtu_name_info_sep_zh_tl + \__sjtu_left_aligned_box:nn {#2} {#3} + } + } , + bottom-skip = 31.2 bp + }, + { date } + { + format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , + content = \l__sjtu_info_date_zh_tl + } + } + { + \__sjtu_declare_component:nnn { title / zh } #1 + } +\__sjtu_declare_page:nn { title / zh } + { + bookmark = true , + bookmark-text = \c__sjtu_name_title_page_tl , + style = SJTU@fund@zh , + format = \linespread { 1 } \__sjtu_set_language_zh: , + prefix = title / zh , + components = { logo, subject, title, info, date } + } +\endinput +%% +%% End of file `sjtu-lang-thesis-zh.def'. diff --git a/texmf/tex/latex/sjtutex/config/sjtu-lang-report-en.cfg b/texmf/tex/latex/sjtutex/sjtu-name-generic-de.def similarity index 50% rename from texmf/tex/latex/sjtutex/config/sjtu-lang-report-en.cfg rename to texmf/tex/latex/sjtutex/sjtu-name-generic-de.def index 5782df62..2346620d 100644 --- a/texmf/tex/latex/sjtutex/config/sjtu-lang-report-en.cfg +++ b/texmf/tex/latex/sjtutex/sjtu-name-generic-de.def @@ -1,10 +1,10 @@ %% -%% This is file `sjtu-lang-report-en.cfg', +%% This is file `sjtu-name-generic-de.def', %% generated with the docstrip utility. %% %% The original source files were: %% -%% sjtutex.dtx (with options: `lang,report,en') +%% sjtutex.dtx (with options: `name,generic,de') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,40 +24,22 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {SJTUReport English config (SJTUTeX)} -\ProvidesExplFile{sjtu-lang-report-en.cfg} +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {German name config for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-name-generic-de.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\clist_const:Nn \c__sjtu_name_month_de_clist + { + Januar, Februar, März, April, Mai, Juni, + Juli, August, September, Oktober, November, Dezember + } \clist_map_inline:nn { - { assumption } - { Assumption } , - { axiom } - { Axiom } , - { conjecture } - { Conjecture } , - { corollary } - { Corollary } , - { definition } - { Definition } , - { example } - { Example } , - { exercise } - { Exercise } , - { lemma } - { Lemma } , - { problem } - { Problem } , - { proposition } - { Proposition } , - { remark } - { Remark } , - { solution } - { Solution } , - { theorem } - { Theorem } , + { keywords } { Schlüsselwörter } , + { info_sep } { :~ } , + { item_sep } { ,~ } } - { \__sjtu_define_name_g:nn #1 } + { \__sjtu_define_name:nn #1 } \endinput %% -%% End of file `sjtu-lang-report-en.cfg'. +%% End of file `sjtu-name-generic-de.def'. diff --git a/texmf/tex/latex/sjtutex/config/sjtu-lang-thesis-en.cfg b/texmf/tex/latex/sjtutex/sjtu-name-generic-en.def similarity index 50% rename from texmf/tex/latex/sjtutex/config/sjtu-lang-thesis-en.cfg rename to texmf/tex/latex/sjtutex/sjtu-name-generic-en.def index bba22100..73ea507d 100644 --- a/texmf/tex/latex/sjtutex/config/sjtu-lang-thesis-en.cfg +++ b/texmf/tex/latex/sjtutex/sjtu-name-generic-en.def @@ -1,10 +1,10 @@ %% -%% This is file `sjtu-lang-thesis-en.cfg', +%% This is file `sjtu-name-generic-en.def', %% generated with the docstrip utility. %% %% The original source files were: %% -%% sjtutex.dtx (with options: `lang,thesis,en') +%% sjtutex.dtx (with options: `name,generic,en') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,40 +24,22 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {SJTUThesis English config (SJTUTeX)} -\ProvidesExplFile{sjtu-lang-thesis-en.cfg} +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {English name config for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-name-generic-en.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\clist_const:Nn \c__sjtu_name_month_en_clist + { + January, February, March, April, May, June, + July, August, September, October, November, December + } \clist_map_inline:nn { - { assumption } - { Assumption } , - { axiom } - { Axiom } , - { conjecture } - { Conjecture } , - { corollary } - { Corollary } , - { definition } - { Definition } , - { example } - { Example } , - { exercise } - { Exercise } , - { lemma } - { Lemma } , - { problem } - { Problem } , - { proposition } - { Proposition } , - { remark } - { Remark } , - { solution } - { Solution } , - { theorem } - { Theorem } , + { keywords } { Key~words } , + { info_sep } { :~ } , + { item_sep } { ,~ } } - { \__sjtu_define_name_g:nn #1 } + { \__sjtu_define_name:nn #1 } \endinput %% -%% End of file `sjtu-lang-thesis-en.cfg'. +%% End of file `sjtu-name-generic-en.def'. diff --git a/texmf/tex/latex/sjtutex/config/sjtu-name-generic.cfg b/texmf/tex/latex/sjtutex/sjtu-name-generic-ja.def similarity index 50% rename from texmf/tex/latex/sjtutex/config/sjtu-name-generic.cfg rename to texmf/tex/latex/sjtutex/sjtu-name-generic-ja.def index 8645bcb7..2fd856fd 100644 --- a/texmf/tex/latex/sjtutex/config/sjtu-name-generic.cfg +++ b/texmf/tex/latex/sjtutex/sjtu-name-generic-ja.def @@ -1,10 +1,10 @@ %% -%% This is file `sjtu-name-generic.cfg', +%% This is file `sjtu-name-generic-ja.def', %% generated with the docstrip utility. %% %% The original source files were: %% -%% sjtutex.dtx (with options: `name,generic') +%% sjtutex.dtx (with options: `name,generic,ja') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,29 +24,24 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {Generic name config (SJTUTeX)} -\ProvidesExplFile{sjtu-name-generic.cfg} +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Japanese name config for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-name-generic-ja.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \clist_map_inline:nn { - { author } { 姓名 } , - { id } { 学号 } , - { supervisor } { 指导教师 } , - { assoc_supervisor } { 副指导教师 } , - { department } { 院系 } , + { year } { 年 } , + { month } { 月 } , + { day } { 日 } } - { \__sjtu_define_name:nn #1 } + { \__sjtu_define_name:nnn { ja } #1 } \clist_map_inline:nn { - { univ } { 上海交通大学 } { Shanghai~ Jiao~ Tong~ University } , - { address } { 中国 \quad 上海 } { Shanghai,~ P.R.~ China } , - { title_page } { 题名页 } { Title~ Page } , - { keywords } { 关键词: } { Key~words:~ } , - { info_sep } { : } { :~ } , - { item_sep } { , } { ,~ } + { keywords } { キーワード } , + { info_sep } { : } , + { item_sep } { \quad } } - { \__sjtu_define_name_g:nnn #1 } + { \__sjtu_define_name:nn #1 } \endinput %% -%% End of file `sjtu-name-generic.cfg'. +%% End of file `sjtu-name-generic-ja.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-name-generic-zh.def b/texmf/tex/latex/sjtutex/sjtu-name-generic-zh.def new file mode 100644 index 00000000..0a1109b9 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-name-generic-zh.def @@ -0,0 +1,47 @@ +%% +%% This is file `sjtu-name-generic-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `name,generic,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Chinese name config for generic (SJTUTeX)} +\ProvidesExplFile{sjtu-name-generic-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\clist_map_inline:nn + { + { year } { 年 } , + { month } { 月 } , + { day } { 日 } + } + { \__sjtu_define_name:nnn { zh } #1 } +\clist_map_inline:nn + { + { keywords } { 关键词 } , + { info_sep } { : } , + { item_sep } { , } + } + { \__sjtu_define_name:nn #1 } +\endinput +%% +%% End of file `sjtu-name-generic-zh.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-name-thesis-de.def b/texmf/tex/latex/sjtutex/sjtu-name-thesis-de.def new file mode 100644 index 00000000..b097545d --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-name-thesis-de.def @@ -0,0 +1,57 @@ +%% +%% This is file `sjtu-name-thesis-de.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `name,thesis,de') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {German name config for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-name-thesis-de.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\clist_const:Nn \c__sjtu_name_month_de_clist + { + Januar, Februar, März, April, Mai, Juni, + Juli, August, September, Oktober, November, Dezember + } +\__sjtu_define_name_from_clist:nnnn { de } + { degree_level } { \g__sjtu_thesis_type_int } + { Bachelor, Master, Doktor } +\clist_map_inline:nn + { + { univ } { Shanghai~ Jiao~ Tong~ Universität } , + { address } { Shanghai,~ VR~ China } , + { author } { Autor/in } , + { supervisor } { Betreuer/in } , + { assoc_supervisor } { Zweitbetreuer/in } , + { co_supervisor } { Co-Betreuer/in } , + { title_page } { Titelblatt } , + { declaration } { Eidesstattliche~ Erklärung } , + { abstract } { Abstrakt } , + { keywords } { Schlüsselwörter } , + { info_sep } { :~ } , + { item_sep } { ,~ } + } + { \__sjtu_define_name:nnn { de } #1 } +\endinput +%% +%% End of file `sjtu-name-thesis-de.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-name-thesis-en.def b/texmf/tex/latex/sjtutex/sjtu-name-thesis-en.def new file mode 100644 index 00000000..bb3c68df --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-name-thesis-en.def @@ -0,0 +1,57 @@ +%% +%% This is file `sjtu-name-thesis-en.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `name,thesis,en') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {English name config for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-name-thesis-en.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\clist_const:Nn \c__sjtu_name_month_en_clist + { + January, February, March, April, May, June, + July, August, September, October, November, December + } +\__sjtu_define_name_from_clist:nnnn { en } + { degree_level } { \g__sjtu_thesis_type_int } + { Bachelor, Master, Doctor } +\clist_map_inline:nn + { + { univ } { Shanghai~ Jiao~ Tong~ University } , + { address } { Shanghai,~ P.R.~ China } , + { author } { Author } , + { supervisor } { Supervisor } , + { assoc_supervisor } { Assoc.~ Supervisor } , + { co_supervisor } { Co-supervisor } , + { title_page } { Title~ Page } , + { declaration } { Statutory~ Declaration } , + { abstract } { Abstract } , + { keywords } { Key~words } , + { info_sep } { :~ } , + { item_sep } { ,~ } + } + { \__sjtu_define_name:nnn { en } #1 } +\endinput +%% +%% End of file `sjtu-name-thesis-en.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-name-thesis-ja.def b/texmf/tex/latex/sjtutex/sjtu-name-thesis-ja.def new file mode 100644 index 00000000..3416ffb0 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-name-thesis-ja.def @@ -0,0 +1,60 @@ +%% +%% This is file `sjtu-name-thesis-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `name,thesis,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Japanese name config for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-name-thesis-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\clist_map_inline:nn + { + { year } { 年 } , + { month } { 月 } , + { day } { 日 } + } + { \__sjtu_define_name:nnn { ja } #1 } +\__sjtu_define_name_from_clist:nnnn { ja } + { degree_level } { \g__sjtu_thesis_type_int } + { 学士, 修士, 博士 } +\clist_map_inline:nn + { + { univ } { 上海交通大学 } , + { address } { 中国・上海 } , + { author } { 氏名 } , + { supervisor } { 指導教員 } , + { assoc_supervisor } { 副指導教員 } , + { co_supervisor } { 共同指導 } , + { thesis } { 学位請求論文 } , + { title_page } { 標題紙 } , + { declaration } { 誓約書・公表許諾書 } , + { abstract } { 要 \quad 旨 } , + { keywords } { キーワード } , + { info_sep } { : } , + { item_sep } { \quad } + } + { \__sjtu_define_name:nnn { ja } #1 } +\endinput +%% +%% End of file `sjtu-name-thesis-ja.def'. diff --git a/texmf/tex/latex/sjtutex/config/sjtu-name-thesis.cfg b/texmf/tex/latex/sjtutex/sjtu-name-thesis-zh.def similarity index 58% rename from texmf/tex/latex/sjtutex/config/sjtu-name-thesis.cfg rename to texmf/tex/latex/sjtutex/sjtu-name-thesis-zh.def index 879aa44c..39111f6d 100644 --- a/texmf/tex/latex/sjtutex/config/sjtu-name-thesis.cfg +++ b/texmf/tex/latex/sjtutex/sjtu-name-thesis-zh.def @@ -1,10 +1,10 @@ %% -%% This is file `sjtu-name-thesis.cfg', +%% This is file `sjtu-name-thesis-zh.def', %% generated with the docstrip utility. %% %% The original source files were: %% -%% sjtutex.dtx (with options: `name,thesis') +%% sjtutex.dtx (with options: `name,thesis,zh') %% %% Copyright (C) SJTUG %% 2018--2023 Alexara Wu @@ -24,58 +24,45 @@ %% %% The Current Maintainers of this work are Alexara Wu and Log Creative. %% -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ - {Name config for thesis template (SJTUTeX)} -\ProvidesExplFile{sjtu-name-thesis.cfg} +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Chinese name config for thesis (SJTUTeX)} +\ProvidesExplFile{sjtu-name-thesis-zh.def} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\__sjtu_define_symbol:nn { white_square } { "25A1 } -\__sjtu_define_name_from_clist:nNnn { degree_level } - \g__sjtu_thesis_type_int - { 学士 , 硕士 , 博士 } - { Bachelor, Master, Doctor } \clist_map_inline:nn { - { id } { 学号 } , - { department } { 院系 } , - { major } { 学科 / 专业 } , - { degree } { 申请学位 } , - { thesis } { 学位论文 } , - { decl_author } { 学位论文作者 } , - { decl_supervisor } { 指导教师 } + { year } { 年 } , + { month } { 月 } , + { day } { 日 } } - { \__sjtu_define_name:nn #1 } -\clist_map_inline:nn - { - { author } { 姓名 } { Author } , - { supervisor } { 导师 } { Supervisor } , - { assoc_supervisor } { 副导师 } { Assoc.~ Supervisor } , - { co_supervisor } { 联合导师 } { Co-supervisor } - } - { \__sjtu_define_name:nnn #1 } + { \__sjtu_define_name:nnn { zh } #1 } +\__sjtu_define_symbol:nn { white_square } { "25A1 } +\__sjtu_define_name_from_clist:nnnn { zh } + { degree_level } { \g__sjtu_thesis_type_int } + { 学士, 硕士, 博士 } \clist_map_inline:nn { - { univ } { 上海交通大学 } { Shanghai~ Jiao~ Tong~ University } , - { address } { 中国 \quad 上海 } { Shanghai,~ P.R.~ China } , - { title_page } { 题名页 } { Title~ Page } , - { orig_decl } { 原创性声明 } { Statement~ of~ Originality } , - { auth_decl } { 使用授权书 } { Copyright~ Permission } , - { decl } - { - \c__sjtu_name_orig_decl_zh_tl - 及 - \c__sjtu_name_auth_decl_zh_tl - } - { - { \c__sjtu_name_orig_decl_en_tl }~ - and~ - { \c__sjtu_name_auth_decl_en_tl } - } , - { abstract } { 摘 \quad 要 } { Abstract } , - { keywords } { 关键词: } { Key~words:~ } , - { info_sep } { : } { :~ } , - { item_sep } { , } { ,~ } + { univ } { 上海交通大学 } , + { author } { 姓名 } , + { id } { 学号 } , + { supervisor } { 导师 } , + { assoc_supervisor } { 副导师 } , + { department } { 院系 } , + { co_supervisor } { 联合导师 } , + { major } { 学科 / 专业 } , + { degree } { 申请学位 } , + { thesis } { 学位论文 } , + { title_page } { 题名页 } , + { declaration } { 原创性声明及使用授权书 } , + { orig_decl } { 原创性声明 } , + { auth_decl } { 使用授权书 } , + { decl_author } { 学位论文作者 } , + { decl_supervisor } { 指导教师 } , + { abstract } { 摘 \quad 要 } , + { keywords } { 关键词 } , + { info_sep } { : } , + { item_sep } { , } } - { \__sjtu_define_name_g:nnn #1 } + { \__sjtu_define_name:nnn { zh } #1 } \tl_const:Nn \c__sjtu_orig_decl_text_zh_tl { 本人郑重声明:所呈交的学位论文,是本人在导师的指导下,独立进行研究工 @@ -114,4 +101,4 @@ } \endinput %% -%% End of file `sjtu-name-thesis.cfg'. +%% End of file `sjtu-name-thesis-zh.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-scheme-de.def b/texmf/tex/latex/sjtutex/sjtu-scheme-de.def new file mode 100644 index 00000000..49f2bb4a --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-scheme-de.def @@ -0,0 +1,80 @@ +%% +%% This is file `sjtu-scheme-de.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `scheme,de') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {German scheme (SJTUTeX)} +\ProvidesExplFile{sjtu-scheme-de.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\keys_set_known:nn { sjtu / name } + { + contents = { Inhaltsverzeichnis } , + listfigure = { Abbildungsverzeichnis } , + listtable = { Tabellenverzeichnis } , + figure = { Abbildung } , + table = { Tabelle } , + abstract = { Zusammenfassung } , + index = { Index } , + appendix = { Anhang } , + proof = { Beweis } , + bib = { Literaturverzeichnis } , + part = { Teil } , + chapter = { Kapitel } , + figure* = { Figure } , + table* = { Table } , + algorithm = { Algorithmus } , + listalgorithm = { Algorithmenverzeichnis } , + abbr = { Abkürzungsverzeichnis } , + nom = { Symbolverzeichnis } , + ack = { Danksagungen } , + resume = { Lebenslauf } , + digest = { Kurzfassung } , + achv = { Forschungsleistungen } + } +\ctex_if_autoindent_touched:F + { \ctex_set:n { autoindent = 1.5 em } } +\ctex_patch_cmd:Nnn \quotation { 1.5em } { \parindent } +\keys_set:nn { sjtu / style } + { fnmark-style = plain } +\clist_map_inline:nn + { + { assumption } { Annahme } , + { axiom } { Axiom } , + { conjecture } { Hypothese } , + { corollary } { Korollar } , + { definition } { Definition } , + { example } { Beispiel } , + { exercise } { Übung } , + { lemma } { Lemma } , + { problem } { Problem } , + { proposition } { Proposition } , + { remark } { Anmerkung } , + { solution } { Lösung } , + { theorem } { Theorem } + } + { \__sjtu_define_name:nn #1 } +\endinput +%% +%% End of file `sjtu-scheme-de.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-scheme-en.def b/texmf/tex/latex/sjtutex/sjtu-scheme-en.def new file mode 100644 index 00000000..ac22b3a4 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-scheme-en.def @@ -0,0 +1,55 @@ +%% +%% This is file `sjtu-scheme-en.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `scheme,en') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {English scheme (SJTUTeX)} +\ProvidesExplFile{sjtu-scheme-en.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\ctex_if_autoindent_touched:F + { \ctex_set:n { autoindent = 1.5 em } } +\ctex_patch_cmd:Nnn \quotation { 1.5em } { \parindent } +\keys_set:nn { sjtu / style } + { fnmark-style = plain } +\clist_map_inline:nn + { + { assumption } { Assumption } , + { axiom } { Axiom } , + { conjecture } { Conjecture } , + { corollary } { Corollary } , + { definition } { Definition } , + { example } { Example } , + { exercise } { Exercise } , + { lemma } { Lemma } , + { problem } { Problem } , + { proposition } { Proposition } , + { remark } { Remark } , + { solution } { Solution } , + { theorem } { Theorem } + } + { \__sjtu_define_name:nn #1 } +\endinput +%% +%% End of file `sjtu-scheme-en.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-scheme-ja.def b/texmf/tex/latex/sjtutex/sjtu-scheme-ja.def new file mode 100644 index 00000000..9fd04274 --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-scheme-ja.def @@ -0,0 +1,85 @@ +%% +%% This is file `sjtu-scheme-ja.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `scheme,ja') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Japanese scheme (SJTUTeX)} +\ProvidesExplFile{sjtu-scheme-ja.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\keys_set_known:nn { sjtu / name } + { + contents = { 目 \quad 次 } , + listfigure = { 図目次 } , + listtable = { 表目次 } , + figure = { 図 } , + table = { 表 } , + abstract = { 概 \quad 要 } , + index = { 索 \quad 引 } , + appendix = { 付録 } , + proof = { 证明 } , + bib = { 参考文献 } , + figure* = { Figure } , + table* = { Table } , + algorithm = { アルゴリズム } , + listalgorithm = { アルゴリズム目次 } , + abbr = { 略語表 } , + nom = { 記号表 } , + ack = { 謝 \quad 辞 } , + resume = { 履歴書 } , + digest = { 要 \quad 約 } , + achv = { 研究業績書 } + } +\keys_set_known:nn { ctex / chapter } + { + name = { 第 , 章 } , + number = \chinese { chapter } + } +\ctex_if_autoindent_touched:F + { \ctex_set:n { autoindent = 1 } } +\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd } +\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd } +\ctex_patch_cmd:Nnn \quotation { 1.5em } { \parindent } +\keys_set:nn { sjtu / style } + { fnmark-style = circled } +\clist_map_inline:nn + { + { assumption } { 仮定 } , + { axiom } { 公理 } , + { conjecture } { 予想 } , + { corollary } { 系 } , + { definition } { 定義 } , + { example } { 例 } , + { exercise } { 練習 } , + { lemma } { 補題 } , + { problem } { 問題 } , + { proposition } { 命題 } , + { remark } { 注意 } , + { solution } { 解法 } , + { theorem } { 定理 } + } + { \__sjtu_define_name:nn #1 } +\endinput +%% +%% End of file `sjtu-scheme-ja.def'. diff --git a/texmf/tex/latex/sjtutex/sjtu-scheme-zh.def b/texmf/tex/latex/sjtutex/sjtu-scheme-zh.def new file mode 100644 index 00000000..1aae677f --- /dev/null +++ b/texmf/tex/latex/sjtutex/sjtu-scheme-zh.def @@ -0,0 +1,85 @@ +%% +%% This is file `sjtu-scheme-zh.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sjtutex.dtx (with options: `scheme,zh') +%% +%% Copyright (C) SJTUG +%% 2018--2023 Alexara Wu +%% 2022--2023 Log Creative +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Alexara Wu and Log Creative. +%% +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ + {Chinese scheme (SJTUTeX)} +\ProvidesExplFile{sjtu-scheme-zh.def} + {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} +\keys_set_known:nn { sjtu / name } + { + contents = { 目 \quad 录 } , + listfigure = { 插 \quad 图 } , + listtable = { 表 \quad 格 } , + figure = { 图 } , + table = { 表 } , + abstract = { 摘 \quad 要 } , + index = { 索 \quad 引 } , + appendix = { 附录 } , + proof = { 证明 } , + bib = { 参考文献 } , + figure* = { Figure } , + table* = { Table } , + algorithm = { 算法 } , + listalgorithm = { 算 \quad 法 } , + abbr = { 缩略语对照表 } , + nom = { 符号对照表 } , + ack = { 致 \quad 谢 } , + resume = { 个人简历 } , + digest = { 大摘要 } , + achv = { 学术论文和科研成果目录 } + } +\keys_set_known:nn { ctex / chapter } + { + name = { 第 , 章 } , + number = \chinese { chapter } + } +\ctex_if_autoindent_touched:F + { \ctex_set:n { autoindent = true } } +\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd } +\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd } +\ctex_patch_cmd:Nnn \quotation { 1.5em } { \parindent } +\keys_set:nn { sjtu / style } + { fnmark-style = circled } +\clist_map_inline:nn + { + { assumption } { 假设 } , + { axiom } { 公理 } , + { conjecture } { 猜想 } , + { corollary } { 推论 } , + { definition } { 定义 } , + { example } { 例 } , + { exercise } { 练习 } , + { lemma } { 引理 } , + { problem } { 问题 } , + { proposition } { 命题 } , + { remark } { 注 } , + { solution } { 解 } , + { theorem } { 定理 } + } + { \__sjtu_define_name:nn #1 } +\endinput +%% +%% End of file `sjtu-scheme-zh.def'. diff --git a/texmf/tex/latex/sjtutex/sjtuarticle.cls b/texmf/tex/latex/sjtutex/sjtuarticle.cls index cb1f7493..946f5e28 100644 --- a/texmf/tex/latex/sjtutex/sjtuarticle.cls +++ b/texmf/tex/latex/sjtutex/sjtuarticle.cls @@ -26,7 +26,7 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Article template for Shanghai Jiao Tong University} \ProvidesExplClass{sjtuarticle} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -51,8 +51,8 @@ \skip_new:N \l__sjtu_tmpa_skip \box_new:N \l__sjtu_tmpa_box \tl_new:N \g__sjtu_lang_tl -\tl_new:N \g__sjtu_lang_aux_tl -\tl_set:Nn \g__sjtu_lang_aux_tl { zh } +\tl_const:Nn \c__sjtu_lang_de_tl { de } +\tl_const:Nn \c__sjtu_lang_ja_tl { ja } \tl_new:N \g__sjtu_zihao_tl \dim_new:N \g__sjtu_font_size_dim \dim_new:N \g__sjtu_line_skip_dim @@ -68,7 +68,6 @@ \bool_new:N \g__sjtu_slanted_uppercase_greek_bool \bool_new:N \g__sjtu_upright_integral_bool \bool_new:N \g__sjtu_integral_limits_bool -\clist_new:N \g__sjtu_options_to_ctex_class_clist \clist_set:Nn \g__sjtu_options_to_ctex_class_clist { a4paper, UTF8, scheme = plain, fontset = none } \clist_new:N \g__sjtu_options_to_packages_clist @@ -91,24 +90,22 @@ lang .choice: , lang .value_required:n = true , lang .choices:nn = - { zh, en } + { zh, en, de, ja } { \tl_gset_eq:NN \g__sjtu_lang_tl \l_keys_choice_tl - \int_compare:nNnT { \l_keys_choice_int } = { 1 } - { \tl_gset:Nn \g__sjtu_lang_aux_tl { en } } } , lang .initial:n = { zh } , zihao .choice: , zihao .value_required:n = true , zihao / -4 .code:n = { - \tl_gset:Nn \g__sjtu_zihao_tl { -4 } + \tl_gset:Nn \g__sjtu_zihao_tl {#1} \dim_gset:Nn \g__sjtu_font_size_dim { 12 bp } \dim_gset:Nn \g__sjtu_default_line_skip_dim { 20 bp } } , zihao / 5 .code:n = { - \tl_gset:Nn \g__sjtu_zihao_tl { 5 } + \tl_gset:Nn \g__sjtu_zihao_tl {#1} \dim_gset:Nn \g__sjtu_font_size_dim { 10.5 bp } \dim_gset:Nn \g__sjtu_default_line_skip_dim { 15.6 bp } } , @@ -192,7 +189,9 @@ \bool_if:NT \g__sjtu_upright_integral_bool { upint } , \bool_if:NT \g__sjtu_integral_limits_bool - { intlimits } + { intlimits } , + \tl_if_eq:NNT \g__sjtu_lang_tl \c__sjtu_lang_de_tl + { german, ngerman } } \clist_put_right:Nx \g__sjtu_options_to_ctex_class_clist { @@ -242,10 +241,12 @@ graphicx, enumitem } -\cs_generate_variant:Nn \tl_const:Nn { co, Nv } \cs_generate_variant:Nn \cs_gset:Npn { cpo } -\prg_generate_conditional_variant:Nnn \regex_match:nn { ne } { T } +\cs_generate_variant:Nn \tl_const:Nn { Nv } +\cs_generate_variant:Nn \clist_use:Nn { NV, cv } \exp_args_generate:n { Nnv } +\cs_generate_variant:Nn \exp_last_unbraced:Ne { ce } +\prg_generate_conditional_variant:Nnn \regex_match:nn { ne } { T, TF } \cs_new:Npx \__sjtu_engine_case:nn #1#2 { \bool_lazy_or:nnTF @@ -274,7 +275,7 @@ { \cs_new:Npn \__sjtu_unicode_char:n #1 { - \Unicode + \exp_not:N \Unicode { \int_div_truncate:nn {#1} { 256 } } { \int_mod:nn {#1} { 256 } } } @@ -310,6 +311,9 @@ } \cs_generate_variant:Nn \__sjtu_dim_set_to_wd:Nn { Nv } \cs_generate_variant:Nn \__sjtu_dim_add_to_wd:Nn { cv } +\cs_new:Npn \__sjtu_cs_provide_eq:NN #1#2 + { \cs_if_exist:NF #1 { \cs_set_eq:NN #1 #2 } } +\cs_generate_variant:Nn \__sjtu_cs_provide_eq:NN { cc } \cs_new_protected:Npn \__sjtu_vspace:N #1 { \skip_vertical:N #1 @@ -334,266 +338,15 @@ \skip_set:Nn \l__sjtu_tmpa_skip {#1} \__sjtu_vspace_r:N \l__sjtu_tmpa_skip } -\__sjtu_engine_case:nnn - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \bool_set_false:N \l__sjtu_tmpa_bool - \cs_set_eq:NN \SJTU@CJK@filltwosidesSymbol \CJKsymbol - \cs_set:Npn \CJKsymbol ##1 - { - \bool_if:NTF \l__sjtu_tmpa_bool - { \hfil \SJTU@CJK@filltwosidesSymbol { ##1 } } - { - \SJTU@CJK@filltwosidesSymbol { ##1 } - \bool_set_true:N \l__sjtu_tmpa_bool - } - } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \cs_set:Npn \CJKglue - { \skip_horizontal:n { \c_zero_dim plus 1 filll } } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \ltjsetparameter { kanjiskip = { \c_zero_dim plus 1 filll } } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } -\cs_new_protected:Npn \__sjtu_left_aligned_box:nn #1#2 - { - \mode_leave_vertical: - \hbox_to_wd:nn {#1} { #2 \hfil } - } \cs_new_protected:Npn \__sjtu_define_name:nn #1#2 - { \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} } -\cs_new_protected:Npn \__sjtu_define_name:nnn #1#2#3 - { - \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} - \tl_const:cn { c__sjtu_name_ #1 _en_tl } {#3} - } -\cs_new_protected:Npn \__sjtu_define_name_g:nn #1#2 { \tl_const:cn { c__sjtu_name_ #1 _tl } {#2} } -\cs_new_protected:Npn \__sjtu_define_name_g:nnn #1#2#3 - { - \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} - \tl_const:cn { c__sjtu_name_ #1 _en_tl } {#3} - \tl_gset_eq:cc - { c__sjtu_name_ #1 _tl } - { c__sjtu_name_ #1 _ \g__sjtu_lang_tl _tl } - } -\cs_new_protected:Npn \__sjtu_define_name_from_clist:nNnn #1#2#3#4 - { - \tl_const:cx { c__sjtu_name_ #1 _zh_tl } - { \clist_item:nn {#3} {#2} } - \tl_const:cx { c__sjtu_name_ #1 _en_tl } - { \clist_item:nn {#4} {#2} } - } +\cs_new_protected:Npn \__sjtu_define_name:nnn #1#2#3 + { \tl_const:cn { c__sjtu_name_ #2 _ #1 _tl } {#3} } +\cs_new_protected:Npn \__sjtu_define_name_from_clist:nnnn #1#2#3#4 + { \tl_const:cx { c__sjtu_name_ #2 _ #1 _tl } { \clist_item:nn {#4} {#3} } } +\cs_generate_variant:Nn \__sjtu_define_name:nn { nv } \cs_new_protected:Npn \__sjtu_define_symbol:nn #1#2 - { \tl_const:co { c__sjtu_symbol_ #1 _tl } { \__sjtu_unicode_char:n {#2} } } -\cs_new:Npn \__sjtu_date_aux_zh:nnn #1#2#3 - { \__zhnum_date_aux:Nnnnn \int_to_arabic:n { ~ } {#1} {#2} {#3} } -\cs_new:Npn \__sjtu_date_aux_zh:w #1-#2-#3 \q_stop - { \__sjtu_date_aux_zh:nnn {#1} {#2} {#3} } -\clist_const:Nn \c__sjtu_name_month_en_clist - { - January, February, March, April, May, June, - July, August, September, October, November, December - } -\cs_new:Npn \__sjtu_ordinal_en:n #1 - { - \int_to_arabic:n {#1} - \exp_not:N \textsuperscript - { - \int_case:nnF { \int_mod:nn {#1} { 100 } } - { - { 11 } { th } - { 12 } { th } - { 13 } { th } - } - { - \int_case:nnF { \int_mod:nn {#1} { 10 } } - { - { 1 } { st } - { 2 } { nd } - { 3 } { rd } - } - { th } - } - } - } -\cs_new:Npn \__sjtu_date_aux_en:nnn #1#2#3 - { \clist_item:Nn \c__sjtu_name_month_en_clist {#2}~ \__sjtu_ordinal_en:n {#3},~ #1 } -\cs_new:Npn \__sjtu_date_aux_en:w #1-#2-#3 \q_stop - { \__sjtu_date_aux_en:nnn {#1} {#2} {#3} } -\clist_map_inline:nn - { zh, en } - { - \tl_const:cx { c__sjtu_today_ #1 _tl } - { - \use:c { __sjtu_date_aux_ #1 :nnn } - { \int_value:w \tex_year:D } - { \tex_month:D } - { \tex_day:D } - } - } -\tl_const:Nv \c__sjtu_today_tl { c__sjtu_today_ \g__sjtu_lang_tl _tl } -\file_input:n { sjtu-name-generic.cfg } -\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } -\keys_define:nn { sjtu } - { - info .meta:nn = { sjtu / info } {#1} , - style .meta:nn = { sjtu / style } {#1} , - name .meta:nn = { sjtu / name } {#1} - } -\clist_map_inline:nn - { - title, display_title, running_title, subject, author, date, - supervisor, assoc_supervisor, department, - } - { - \tl_new:c { l__sjtu_info_ #1 _zh_tl } - } -\tl_new:N \l__sjtu_info_id_zh_tl -\clist_map_inline:nn - { keywords } - { - \clist_new:c { l__sjtu_info_ #1 _zh_clist } - } -\keys_define:nn { sjtu / info } - { - title .code:n = - { - \tl_set:Nn \l__sjtu_info_title_zh_tl {#1} - \clist_map_inline:nn - { - \l__sjtu_info_display_title_zh_tl , - \l__sjtu_info_running_title_zh_tl - } - { \tl_if_empty:NT ##1 { \tl_set:Nn ##1 {#1} } } - } , - display-title .tl_set:N = \l__sjtu_info_display_title_zh_tl , - running-title .tl_set:N = \l__sjtu_info_running_title_zh_tl , - subject .tl_set:N = \l__sjtu_info_subject_zh_tl , - keywords .clist_set:N = \l__sjtu_info_keywords_zh_clist , - author .tl_set:N = \l__sjtu_info_author_zh_tl , - id .tl_set:N = \l__sjtu_info_id_zh_tl , - supervisor .tl_set:N = \l__sjtu_info_supervisor_zh_tl , - assoc-supervisor .tl_set:N = \l__sjtu_info_assoc_supervisor_zh_tl , - department .tl_set:N = \l__sjtu_info_department_zh_tl , - date .code:n = - { - \regex_match:neT { \d{4}-\d{2}-\d{2} } {#1} - { - \tl_set:Nx \l__sjtu_info_date_zh_tl - { \exp_last_unbraced:Ne \__sjtu_date_aux_zh:w #1 \q_stop } - \tl_set:Nx \l__sjtu_info_date_en_tl - { \exp_last_unbraced:Ne \__sjtu_date_aux_en:w #1 \q_stop } - } - } , - display-date .tl_set:N = \l__sjtu_info_date_zh_tl , - display-date .initial:V = \c__sjtu_today_tl , - } -\RenewDocumentCommand \title { s +m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { title* = {#2} } } - { \keys_set_known:nn { sjtu / info } { title = {#2} } } - } -\tl_set:Nn \@title { \l__sjtu_info_title_zh_tl } -\RenewDocumentCommand \author { s m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { author* = {#2} } } - { \keys_set_known:nn { sjtu / info } { author = {#2} } } - } -\tl_set:Nn \@author { \l__sjtu_info_author_zh_tl } -\RenewDocumentCommand \date { s m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { display-date* = {#2} } } - { \keys_set_known:nn { sjtu / info } { display-date = {#2} } } - } -\tl_set:Nn \@date { \l__sjtu_info_date_zh_tl } -\tl_set:Nv \today { c__sjtu_today_ \g__sjtu_lang_tl _tl } -\keys_define:nn { sjtu / style } - { - float-font .tl_set:N = \SJTU@style@float@font , - float-font .initial:n = \zihao { 5 } \fixedlineskip { 15.6 bp } , - caption-font .code:n = - { \DeclareCaptionFont { SJTU@font } {#1} } , - caption-font .initial:n = \zihao { 5 } \bfseries , - subcaption-font .code:n = - { \DeclareCaptionFont { SJTU@sub@font } {#1} } , - subcaption-font .initial:n = \zihao { 5 } \normalfont , - fnmark-font .tl_set:N = \l__sjtu_style_fnmark_font_tl , - fnmark-font .initial:n = , - float-num-sep .tl_set:N = \l__sjtu_style_fl_num_sep_tl , - float-num-sep .initial:n = { -- } , - equation-num-sep .tl_set:N = \l__sjtu_style_eq_num_sep_tl , - equation-num-sep .initial:n = { -- } , - title-logo-color .choice: , - title-logo-color .choices:nn = - { red, blue, black } - { \tl_set_eq:NN \l__sjtu_style_title_logo_color_tl \l_keys_choice_tl } , - title-logo-color .initial:n = { red } , - header-logo-color .choice: , - header-logo-color .choices:nn = - { red, blue, black } - { \tl_set_eq:NN \l__sjtu_style_header_logo_color_tl \l_keys_choice_tl } , - header-logo-color .initial:n = { red } , - header-uppercase .choice: , - header-uppercase / true .code:n = - { \cs_gset_eq:NN \__sjtu_nouppercase:n \use:n } , - header-uppercase / false .code:n = - { \cs_gset:Nn \__sjtu_nouppercase:n { \nouppercase {##1} } } , - header-uppercase .default:n = { true } , - header-uppercase .initial:n = { true } , - header-font .tl_set:N = \l__sjtu_style_header_font_tl , - header-font .initial:n = \zihao { -5 } \sffamily , - footer-font .tl_set:N = \l__sjtu_style_footer_font_tl , - footer-font .initial:n = \zihao { -5 } , - page-number .cs_set:Np = \__sjtu_page:n #1 , - page-number .initial:n = { {#1} } - } -\keys_define:nn { sjtu / name } - { - contents .tl_set:N = \contentsname , - listfigure .tl_set:N = \listfigurename , - listtable .tl_set:N = \listtablename , - figure .tl_set:N = \figurename , - table .tl_set:N = \tablename , - abstract .tl_set:N = \abstractname , - index .tl_set:N = \indexname , - appendix .tl_set:N = \appendixname , - proof .tl_set:N = \proofname , - bib .tl_set:N = \refname , - figure* .tl_set:N = \l__sjtu_name_figure_aux_tl , - figure* .initial:n = { 图 } , - table* .tl_set:N = \l__sjtu_name_table_aux_tl , - table* .initial:n = { 表 } , - algorithm .tl_set:N = \l__sjtu_name_algorithm_tl , - algorithm .initial:n = { Algorithm } , - listalgorithm .tl_set:N = \l__sjtu_name_listalgorithm_tl , - listalgorithm .initial:n = { List~of~Algorithms } , - } -\file_input:n { sjtu-lang-article- \g__sjtu_lang_tl .cfg } + { \tl_const:cx { c__sjtu_symbol_ #1 _tl } { \__sjtu_unicode_char:n {#2} } } \cs_new_protected:Npn \__sjtu_fontset_error:nn #1#2 { \msg_error:nnnn { sjtutex } { font-unavailable } {#1} {#2} } \msg_new:nnn { sjtutex } { font-unavailable } @@ -622,8 +375,12 @@ } \cs_new_protected:Nn \__sjtu_set_unimath_symbol: { - \cs_set_eq:NN \increment \upDelta - \cs_set_eq:NN \QED \blacksquare + \clist_map_inline:nn + { + { increment } { upDelta } , + { QED } { blacksquare } + } + { \__sjtu_cs_provide_eq:cc ##1 } } \tl_if_empty:NT \g__sjtu_math_font_tl { \tl_gset_eq:NN \g__sjtu_math_font_tl \g__sjtu_text_font_tl } @@ -688,6 +445,9 @@ \intcap\intcup\upint\lowint } } +\NewDocumentCommand \CJKrmfamily { } { \CJKfamily { \CJKrmdefault } } +\NewDocumentCommand \CJKsffamily { } { \CJKfamily { \CJKsfdefault } } +\NewDocumentCommand \CJKttfamily { } { \CJKfamily { \CJKttdefault } } \__sjtu_unicode_engine_case:nn { \xeCJK_declare_char_class:nn { CJK } @@ -698,6 +458,29 @@ { "24EA, "2460-"2473, "3251-"32BF, "25A1 } \ltjsetparameter { jacharrange = { +99 } } } +\keys_define:nn { sjtu / name } + { + contents .meta:nn = { ctex } { contentsname = {#1} } , + listfigure .meta:nn = { ctex } { listfigurename = {#1} } , + listtable .meta:nn = { ctex } { listtablename = {#1} } , + figure .meta:nn = { ctex } { figurename = {#1} } , + table .meta:nn = { ctex } { tablename = {#1} } , + abstract .meta:nn = { ctex } { abstractname = {#1} } , + index .meta:nn = { ctex } { indexname = {#1} } , + appendix .meta:nn = { ctex } { appendixname = {#1} } , + proof .meta:nn = { ctex } { proofname = {#1} } , + bib .meta:nn = { ctex } { bibname = {#1} } , + part .tl_set:N = \partname , + figure* .tl_set:N = \SJTU@figurename@aux , + figure* .initial:n = { 图 } , + table* .tl_set:N = \SJTU@tablename@aux , + table* .initial:n = { 表 } , + algorithm .tl_set:N = \SJTU@algorithmname , + algorithm .initial:n = { Algorithm } , + listalgorithm .tl_set:N = \SJTU@listalgorithmname , + listalgorithm .initial:n = { List~of~Algorithms } , + } + \file_input:n { sjtu-name-generic- \g__sjtu_lang_tl .def } \geometry { top = 3.5 cm, @@ -709,49 +492,64 @@ footskip = 1.0 cm } \pagestyle { fancy } -\cs_new:Nn \__sjtu_thepage: { \thepage } \fancyhf { } -\tl_set:Nn \l__sjtu_header_logo_tl +\keys_define:nn { sjtu / style } + { + header-font .tl_set:N = \l__sjtu_style_header_font_tl , + header-font .initial:n = \zihao { -5 } \sffamily , + footer-font .tl_set:N = \l__sjtu_style_footer_font_tl , + footer-font .initial:n = \zihao { -5 } + } +\fancyheadinit { \l__sjtu_style_header_font_tl } +\fancyfootinit { \l__sjtu_style_footer_font_tl } +\keys_define:nn { sjtu / style } + { + header-uppercase .choice: , + header-uppercase / true .code:n = + { \cs_set_eq:NN \__sjtu_nouppercase:n \use:n } , + header-uppercase / false .code:n = + { \cs_set:Nn \__sjtu_nouppercase:n { \nouppercase {##1} } } , + header-uppercase .default:n = { true } , + header-uppercase .initial:n = { false } + } +\cs_generate_variant:Nn \__sjtu_nouppercase:n { V } +\keys_define:nn { sjtu / style } + { + header-logo-color .choice: , + header-logo-color .choices:nn = + { red, blue, black } + { \tl_set_eq:NN \l__sjtu_style_header_logo_color_tl \l_keys_choice_tl } , + header-logo-color .initial:n = { red } , + } +\cs_new:Nn \__sjtu_thepage: { \thepage } +\keys_define:nn { sjtu / style } + { + page-number .cs_set:Np = \__sjtu_page:n #1 , + page-number .initial:n = { {#1} } + } +\tl_set:Nn \l__sjtu_header_tl { \includegraphics [ height = 1.2 cm ] { sjtu-vi-logo- \l__sjtu_style_header_logo_color_tl .pdf } } +\tl_set:Nn \l__sjtu_leftmark_tl { \l__sjtu_info_subject_tl } +\tl_set:Nn \l__sjtu_rightmark_tl { \leftmark } \bool_if:NTF \g__sjtu_twoside_bool { - \fancyhead [ RE, LO ] - { \l__sjtu_header_logo_tl } - \fancyhead [ RO ] - { - \l__sjtu_style_header_font_tl - \__sjtu_nouppercase:n - { \MakeUppercase \l__sjtu_info_running_title_zh_tl } - } - \fancyhead [ LE ] - { - \__sjtu_nouppercase:n - { \MakeUppercase \l__sjtu_info_subject_zh_tl } - } + \fancyhead [ LO, RE ] { \l__sjtu_header_tl } + \fancyhead [ LE ] { \__sjtu_nouppercase:V \l__sjtu_leftmark_tl } + \fancyhead [ RO ] { \__sjtu_nouppercase:V \l__sjtu_rightmark_tl } } { - \fancyhead [ L ] - { \l__sjtu_header_logo_tl } - \fancyhead [ R ] - { - \l__sjtu_style_header_font_tl - \__sjtu_nouppercase:n - { \MakeUppercase \l__sjtu_info_running_title_zh_tl } - } - } -\fancyfoot [ C ] - { - \l__sjtu_style_footer_font_tl - \__sjtu_page:n { \__sjtu_thepage: } + \fancyhead [ L ] { \l__sjtu_header_tl } + \fancyhead [ R ] { \__sjtu_nouppercase:V \l__sjtu_rightmark_tl } } +\fancyfoot [ C ] { \__sjtu_page:n { \__sjtu_thepage: } } \bool_if:NTF \g__sjtu_twoside_bool { \fancypagestyle { plain } { - \fancyhead [ RE, LO ] { } + \fancyhead [ LE, RO ] { } \tl_set:Nn \headrulewidth { 0 pt } } } @@ -776,14 +574,14 @@ { beforeskip = 24 bp , afterskip = 6 bp , - format = \zihao { 4 } \bfseries \heiti , + format = \zihao { 4 } \bfseries \CJKsffamily , afterindent = true } \ctex_set:nn { subsection } { beforeskip = 12 bp , afterskip = 6 bp , - format = \zihao { -4 } \bfseries \heiti , + format = \zihao { -4 } \bfseries \CJKsffamily , afterindent = true } \ctex_set:nn { subsubsection } @@ -820,24 +618,31 @@ { \SJTU@head* {#1} [#2] } \cs_new:Npn \__sjtu_head_auxb_s:nn #1#2 { \SJTU@head* [#1] {#2} } -\cs_generate_variant:Nn \__sjtu_head_aux:n { V } -\cs_generate_variant:Nn \__sjtu_head_aux_s:n { V } -\cs_generate_variant:Nn \__sjtu_head_auxa_s:nn { Vn, VV } -\cs_generate_variant:Nn \__sjtu_head_auxb_s:nn { Vo } +\cs_generate_variant:Nn \__sjtu_head_auxa_s:nn { xn, xv } +\cs_generate_variant:Nn \__sjtu_head_auxb_s:nn { nx } \cs_new_eq:NN \__sjtu_pdf_bookmark:nn \use_none:nn \cs_new_eq:NN \__sjtu_phantom_section: \prg_do_nothing: -\ctex_if_autoindent_touched:F - { \ctex_set:n { autoindent = true } } -\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd } -\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd } -\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd } \setlist { nosep } \tl_set:Nn \textfraction { 0.15 } \tl_set:Nn \topfraction { 0.85 } \tl_set:Nn \bottomfraction { 0.65 } \tl_set:Nn \floatpagefraction { 0.60 } +\keys_define:nn { sjtu / style } + { + float-font .tl_set:N = \SJTU@style@float@font , + float-font .initial:n = \zihao { 5 } \fixedlineskip { 15.6 bp } + } \ctex_patch_cmd:Nnn \@floatboxreset { \normalsize } { \SJTU@style@float@font } +\keys_define:nn { sjtu / style } + { + caption-font .code:n = + { \DeclareCaptionFont { SJTU@font } {#1} } , + caption-font .initial:n = \zihao { 5 } \bfseries , + subcaption-font .code:n = + { \DeclareCaptionFont { SJTU@sub@font } {#1} } , + subcaption-font .initial:n = \zihao { 5 } \normalfont + } \DeclareCaptionLabelSeparator { enskip } { \enskip } \captionsetup { @@ -853,11 +658,18 @@ } \DeclareCaptionOption { aux-names } [ ] { - \tl_set:Nn \figurename { \l__sjtu_name_figure_aux_tl } - \tl_set:Nn \tablename { \l__sjtu_name_table_aux_tl } + \tl_set:Nn \figurename { \SJTU@figurename@aux } + \tl_set:Nn \tablename { \SJTU@tablename@aux } } \captionsetup [ bi-second ] { aux-names } -\NewDocumentCommand \SJTUcounterwithin +\keys_define:nn { sjtu / style } + { + float-num-sep .tl_set:N = \l__sjtu_style_fl_num_sep_tl , + float-num-sep .initial:n = { -- } , + equation-num-sep .tl_set:N = \l__sjtu_style_eq_num_sep_tl , + equation-num-sep .initial:n = { -- } + } +\NewDocumentCommand \SJTU@counterwithin { s O{ \l__sjtu_style_fl_num_sep_tl } O{ \arabic } m m } { \@ifbothcounters {#4} {#5} @@ -870,18 +682,9 @@ } } } -\cs_new_protected:Nn \__sjtu_make_fnmark: - { \hbox:n { \@thefnmark } } -\ctex_at_end_preamble:n { - \cs_set_eq:NN \__sjtu_orig_make_fntext:n \@makefntext - \cs_set:Npn \@makefntext #1 - { - \group_begin: - \cs_set_eq:NN \@makefnmark \__sjtu_make_fnmark: - \__sjtu_orig_make_fntext:n {#1} - \group_end: - } -} +\cs_set_eq:NN \__sjtu_makefnmark_plain: \@makefnmark +\cs_set_eq:NN \__sjtu_thefootnote_plain: \thefootnote +\cs_set_eq:NN \__sjtu_thempfootnote_plain: \thempfootnote \cs_new:Npn \__sjtu_footnote_number:N #1 { \int_compare:nNnTF {#1} < { 21 } @@ -898,217 +701,115 @@ } \msg_new:nnn { sjtutex } { too-many-footnotes } { Too~ many~ footnotes. } -\cs_set:Npn \thefootnote - { - \hbox:n { } - { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@footnote } - } -\cs_set:Npn \thempfootnote - { - \hbox:n { } - { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@mpfootnote } - } -\DeclareObjectType { sjtu } { 0 } -\DeclareTemplateInterface { sjtu } { component } { 0 } +\cs_new:Nn \__sjtu_makefnmark_circled: { \hbox:n { \@thefnmark } } +\keys_define:nn { sjtu / style } { - format : tokenlist = \c_empty_tl , - content : tokenlist = \c_empty_tl , - bottom-skip : skip = \c_zero_skip , - align : choice { left, right, center, normal } = center + fnmark-font .choice: , + fnmark-font / haranoaji .code:n = + { + \__sjtu_engine_case:nn + { \tl_set_eq:NN \l__sjtu_style_fnmark_font_tl \c_empty_tl } + { + \tl_set:Nn \l__sjtu_style_fnmark_font_tl + { + \CJKfontspec { HaranoAjiMincho } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold + ] + } + } + } , + fnmark-font / unknown .tl_set:N = \l__sjtu_style_fnmark_font_tl , + fnmark-font .initial:V = \c_empty_tl } -\DeclareTemplateCode { sjtu } { component } { 0 } +\cs_new:Nn \__sjtu_thefootnote_circled: + { { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@footnote } } +\cs_new:Nn \__sjtu_thempfootnote_circled: + { { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@mpfootnote } } +\keys_define:nn { sjtu / style } { - format = \l__sjtu_component_format_tl , - content = \l__sjtu_component_content_tl , - bottom-skip = \l__sjtu_component_bottom_skip , - align = + fnmark-style .choice: , + fnmark-style / plain .code:n = { - left = - \cs_set_eq:NN \l__sjtu_component_align: \raggedright , - right = - \cs_set_eq:NN \l__sjtu_component_align: \raggedleft , - center = - \cs_set_eq:NN \l__sjtu_component_align: \centering , - normal = - \cs_set_eq:NN \l__sjtu_component_align: \prg_do_nothing: + \cs_set_eq:NN \__sjtu_makefnmark: \__sjtu_makefnmark_plain: + \cs_set_eq:NN \thefootnote \__sjtu_thefootnote_plain: + \cs_set_eq:NN \thempfootnote \__sjtu_thempfootnote_plain: + } , + fnmark-style / circled .code:n = + { + \cs_set_eq:NN \__sjtu_makefnmark: \__sjtu_makefnmark_circled: + \cs_set_eq:NN \thefootnote \__sjtu_thefootnote_circled: + \cs_set_eq:NN \thempfootnote \__sjtu_thempfootnote_circled: } } +\ctex_at_end_preamble:n { + \cs_set_eq:NN \__sjtu_orig_make_fntext:n \@makefntext + \cs_set:Npn \@makefntext #1 + { + \group_begin: + \cs_set_eq:NN \@makefnmark \__sjtu_makefnmark: + \__sjtu_orig_make_fntext:n {#1} + \group_end: + } +} +\tl_new:N \l__sjtu_info_subject_tl +\clist_new:N \l__sjtu_info_keywords_clist +\keys_define:nn { sjtu / info } { - \AssignTemplateKeys - \group_begin: - \l__sjtu_component_align: - \l__sjtu_component_format_tl - \l__sjtu_component_content_tl - \par - \group_end: - \__sjtu_vspace:N \l__sjtu_component_bottom_skip - } -\DeclareTemplateInterface { sjtu } { page } { 0 } - { - bookmark : boolean = false , - bookmark-text : tokenlist = \c_empty_tl , - style : tokenlist = empty , - format : tokenlist = \linespread { 1 } \selectfont , - prefix : tokenlist , - components : commalist , - top-skip : skip = \c_zero_skip , - bottom-skip : skip = \c_zero_skip - } -\DeclareTemplateCode { sjtu } { page } { 0 } - { - bookmark = \l__sjtu_page_bookmark_bool , - bookmark-text = \l__sjtu_page_bookmark_text_tl , - style = \l__sjtu_page_style_tl , - format = \l__sjtu_page_format_tl , - prefix = \l__sjtu_page_prefix_tl , - components = \l__sjtu_page_components_clist , - top-skip = \l__sjtu_page_top_skip , - bottom-skip = \l__sjtu_page_bottom_skip - } - { - \AssignTemplateKeys - \clearpage - \bool_if:NT \l__sjtu_page_bookmark_bool - { \__sjtu_pdf_bookmark:nn { 0 } { \l__sjtu_page_bookmark_text_tl } } - \exp_args:No \thispagestyle { \l__sjtu_page_style_tl } - \__sjtu_vspace_r:N \l__sjtu_page_top_skip - \__sjtu_vspace:n { - \tex_parskip:D } - \__sjtu_vspace:n { - \tex_baselineskip:D } - \group_begin: - \l__sjtu_page_format_tl - \clist_map_inline:Nn \l__sjtu_page_components_clist - { \UseInstance { sjtu } { \l__sjtu_page_prefix_tl / ##1 } } - \group_end: - \__sjtu_vspace:N \l__sjtu_page_bottom_skip - \clearpage - } -\cs_new:Npn \__sjtu_declare_component:nnn #1#2#3 - { \DeclareInstance { sjtu } {#1/#2} { component } {#3} } -\cs_new:Npn \__sjtu_declare_page:nn #1#2 - { \DeclareInstance { sjtu } {#1} { page } {#2} } -\cs_new:Npn \__sjtu_title_page_info:nnn #1#2#3 - { - \group_begin: - \cs_set:Npn \l__sjtu_info_output_format:NNN ##1##2##3 {#3} - \clist_clear:N \l__sjtu_tmpa_clist - \clist_clear:N \l__sjtu_tmpb_clist - \dim_set:Nn \l__sjtu_tmpb_dim { 5 em } - \clist_map_inline:nn {#2} - { - \clist_put_right:No \l__sjtu_tmpa_clist - { \cs:w c__sjtu_name_ ##1 _ #1 _tl \cs_end: } - \clist_put_right:No \l__sjtu_tmpb_clist - { \cs:w l__sjtu_info_ ##1 _ #1 _tl \cs_end: } - \__sjtu_dim_set_to_wd:Nv \l__sjtu_tmpa_dim { l__sjtu_info_ ##1 _ #1 _tl } - \dim_set:Nn \l__sjtu_tmpb_dim - { \dim_max:nn { \l__sjtu_tmpa_dim } { \l__sjtu_tmpb_dim } } - } - \bool_until_do:nn - { \clist_if_empty_p:N \l__sjtu_tmpa_clist } - { - \clist_pop:NN \l__sjtu_tmpa_clist \l__sjtu_tmpa_tl - \clist_pop:NN \l__sjtu_tmpb_clist \l__sjtu_tmpb_tl - \l__sjtu_info_output_format:NNN - \l__sjtu_tmpa_tl \l__sjtu_tmpb_dim \l__sjtu_tmpb_tl - \skip_vertical:N \c_zero_dim - } - \group_end: + title .tl_set:N = \@title , + author .tl_set:N = \@author , + display-date .tl_set:N = \@date , + subject .tl_set:N = \l__sjtu_info_subject_tl , + keywords .clist_set:N = \l__sjtu_info_keywords_clist , } -\cs_generate_variant:Nn \__sjtu_title_page_info:nnn { nxn } -\clist_map_inline:nn +\file_input:n { sjtu-lang-generic- \g__sjtu_lang_tl .def } +\file_input:n { sjtu-scheme- \g__sjtu_lang_tl .def } +\keys_define:nn { sjtu / info } { - { logo } + date .code:n = { - content = + \regex_match:neTF { \d+-\d+-\d+ } {#1} { - \includegraphics [ width = 3 cm ] - { sjtu-vi-badge- \l__sjtu_style_title_logo_color_tl .pdf } - \skip_vertical:n { 0.3 cm } - \includegraphics [ width = 6.81 cm ] - { sjtu-vi-name- \l__sjtu_style_title_logo_color_tl .pdf } - } - }, - { subject } - { - format = \zihao { -2 } \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_subject_zh_tl , - bottom-skip = \c_zero_dim plus 2 fill - }, - { title } - { - format = \zihao { 2 } \bfseries \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_display_title_zh_tl , - bottom-skip = \c_zero_dim plus 3 fill - }, - { info } - { - format = \zihao { 4 } \fixedlineskip { 31.2 bp } , - content = - { - \__sjtu_title_page_info:nxn { zh } + \tl_set:Nx \@date { - author, - id, - supervisor, - \tl_if_empty:NF \l__sjtu_info_assoc_supervisor_zh_tl - { assoc_supervisor }, - department, + \exp_last_unbraced:ce + { __sjtu_date_aux_ \g__sjtu_lang_tl :w } #1 \q_stop } + } + { + \regex_match:neT { \d+-\d+ } {#1} { - \__sjtu_cjk_spread_box:nn { 5 em } { \heiti #1 } - \c__sjtu_name_info_sep_zh_tl - \__sjtu_left_aligned_box:nn {#2} {#3} + \tl_set:Nx \@date + { + \exp_last_unbraced:ce + { __sjtu_date_aux_short_ \g__sjtu_lang_tl :w } #1 \q_stop + } } - } , - bottom-skip = 31.2 bp - }, - { date } + } + } , + date .initial:x = { - format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_date_zh_tl + \int_to_arabic:n { \c_sys_year_int } - + \int_to_arabic:n { \c_sys_month_int } - + \int_to_arabic:n { \c_sys_day_int } } } - { - \__sjtu_declare_component:nnn { title / zh } #1 - } -\__sjtu_declare_page:nn { title / zh } - { - bookmark = true , - bookmark-text = \c__sjtu_name_title_page_tl , - prefix = title / zh , - components = { logo, subject, title, info, date } - } +\tl_set:NV \today \@date \bool_if:NT \g__sjtu_titlepage_bool + { \__sjtu_appto_cmd:Nn \abstract { \par } } +\__sjtu_preto_cmd:Nn \endabstract { - \RenewDocumentCommand \maketitle { } - { \UseInstance { sjtu } { title / zh } } - } -\cs_new:Nn \__sjtu_output_keywords:Nnn - { - \clist_if_empty:NF #1 + \clist_if_empty:NF \l__sjtu_info_keywords_clist { \par \mode_leave_vertical: \par \noindent - { \bfseries #2 } \clist_use:Nn #1 {#3} - } - } -\bool_if:NTF \g__sjtu_titlepage_bool - { - \DeclareDocumentEnvironment { abstract } { } - { - \clearpage - \__sjtu_head_aux_s:n { \abstractname } - } - { - \__sjtu_output_keywords:Nnn \l__sjtu_info_keywords_zh_clist - { \c__sjtu_name_keywords_tl } { \c__sjtu_name_item_sep_tl } - \clearpage - } - } - { - \__sjtu_preto_cmd:Nn \endabstract - { - \__sjtu_output_keywords:Nnn \l__sjtu_info_keywords_zh_clist - { \c__sjtu_name_keywords_tl } { \c__sjtu_name_item_sep_tl } + { + \bfseries + \c__sjtu_name_keywords_tl + \c__sjtu_name_info_sep_tl + } + \clist_use:NV \l__sjtu_info_keywords_clist \c__sjtu_name_item_sep_tl } } \DeclareDocumentCommand \tableofcontents { } @@ -1137,61 +838,17 @@ } \ctex_at_end_preamble:n { \__sjtu_update_cft_presnum: } -\newcounter { SJTU@bib } -\NewDocumentEnvironment { @bibliolist } { m } +\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } +\keys_define:nn { sjtu } { - \cs_if_exist_use:N \bibfont - \list - { \@biblabel { \arabic{ SJTU@bib } } } - { - \__sjtu_dim_set_to_wd:Nn \labelwidth { \@biblabel {#1} } - \dim_set_eq:NN \leftmargin \labelwidth - \dim_add:Nn \leftmargin { \labelsep } - \dim_if_exist:NTF \bibitemsep - { - \dim_set_eq:NN \itemsep \bibitemsep - \dim_if_exist:NT \bibparsep - { \dim_set_eq:NN \parsep \bibparsep } - } - { - \dim_if_exist:NT \bibsep - { - \dim_set_eq:NN \itemsep \bibsep - \dim_zero:N \parsep - } - } - \@nmbrlisttrue - \tl_set:Nn \@listctr { SJTU@bib } - \cs_set:Npn \p@SJTU@bib { } - \cs_set:Npn \theSJTU@bib { \arabic { SJTU@bib } } - } - \sloppy - \int_set:Nn \clubpenalty { 4000 } - \int_set_eq:NN \@clubpenalty \clubpenalty - \int_set:Nn \widowpenalty { 4000 } - \char_set_sfcode:nn { `\. } { 1000 } - } - { - \cs_set:Npn \@noitemerr - { \msg_warning:nnn { sjtutex } { empty-environment } { bibliolist } } - \endlist - } -\msg_new:nnn { sjtutex } { empty-environment } - { Empty~ `#1'~ environment. } -\NewDocumentEnvironment { bibliolist } { m +b } - { - \cs_set:Npn \@noitemerr { } - \begin { @bibliolist } {#1} - #2 - \end { @bibliolist } - } { } -\NewDocumentEnvironment { bibliolist* } { m +b } - { - \cs_set:Npn \@noitemerr { } - \begin { @bibliolist } {#1} - #2 - \end { @bibliolist } - } { } + style .meta:nn = { sjtu / style } {#1} , + info .meta:nn = { sjtu / info } {#1} , + name .meta:nn = { sjtu / name } {#1} + } +\NewDocumentCommand \subject { m } + { \keys_set:nn { sjtu / info } { subject = {#1} } } +\NewDocumentCommand \keywords { m } + { \keys_set:nn { sjtu / info } { keywords = {#1} } } \ctex_at_end_package:nn { hyperref } { \hypersetup @@ -1226,10 +883,10 @@ { \hypersetup { - pdftitle = \l__sjtu_info_title_zh_tl, - pdfsubject = \l__sjtu_info_subject_zh_tl, - pdfkeywords = \l__sjtu_info_keywords_zh_clist, - pdfauthor = \l__sjtu_info_author_zh_tl + pdftitle = \@title , + pdfauthor = \@author , + pdfsubject = \l__sjtu_info_subject_tl , + pdfkeywords = \l__sjtu_info_keywords_clist } } } @@ -1259,6 +916,7 @@ } \ctex_at_end_package:nn { amsthm } { + \__sjtu_cs_provide_eq:NN \QED \openbox \cs_if_exist:NT \__sjtu_save_openbox: { \cs_set_eq:NN \openbox \__sjtu_save_openbox: } \tl_set:Nn \qedsymbol { \ensuremath { \QED } } @@ -1270,21 +928,22 @@ \item [ \skip_horizontal:N \labelsep - \bfseries \heiti #1 \@addpunct { \enskip } + \bfseries \CJKsffamily #1 \@addpunct { \enskip } ] \ignorespaces } { \popQED \endtrivlist \legacy_if_set_false:n { @endpe } } \newtheoremstyle { sjtu } - { } { } { \normalfont } { } { \bfseries \heiti } { } { \ccwd } { } + { } { } { \normalfont } { } { \bfseries \CJKsffamily } { } { \ccwd } { } \theoremstyle { sjtu } \__sjtu_new_theorems: } \ctex_at_end_package:nn { ntheorem } { - \theoremheaderfont { \bfseries \heiti } - \theorembodyfont { \normalfont } - \theoremseparator { \enskip } + \__sjtu_cs_provide_eq:NN \QED \c_empty_tl + \theoremheaderfont { \bfseries \CJKsffamily } + \theorembodyfont { \normalfont } + \theoremseparator { \enskip } \theoremsymbol { \ensuremath { \QED } } \qedsymbol { \ensuremath { \QED } } \newtheorem* { proof } { \proofname } @@ -1309,16 +968,16 @@ } \ctex_at_end_package:nn { algorithm } { - \tl_set:Nn \fname@algorithm { \l__sjtu_name_algorithm_tl } - \tl_set:Nn \listalgorithmname { \l__sjtu_name_listalgorithm_tl } + \tl_set:Nn \fname@algorithm { \SJTU@algorithmname } + \tl_set:Nn \listalgorithmname { \SJTU@listalgorithmname } \__sjtu_newlistof:nnnnn { algorithm } { alg } { algorithm } { \fname@algorithm } { \listalgorithmname } } \ctex_at_end_package:nn { algorithm2e } { - \SetAlgorithmName { \l__sjtu_name_algorithm_tl } - { \l__sjtu_name_algorithm_tl } - { \l__sjtu_name_listalgorithm_tl } + \SetAlgorithmName { \SJTU@algorithmname } + { \SJTU@algorithmname } + { \SJTU@listalgorithmname } \SetAlgoCaptionSeparator { \enskip } \__sjtu_newlistof:nnnnn { algorithm } { alg } { algocf } { \algorithmcfname } { \listalgorithmcfname } @@ -1353,7 +1012,7 @@ } } \ctex_at_end_package:nn { nomencl } - { \tl_set:Nn \nomname { \l__sjtu_name_nom_tl } } + { \tl_set:Nn \nomname { \SJTU@nomname } } \endinput %% %% End of file `sjtuarticle.cls'. diff --git a/texmf/tex/latex/sjtutex/sjtureport.cls b/texmf/tex/latex/sjtutex/sjtureport.cls index 2d410fe7..20493a3c 100644 --- a/texmf/tex/latex/sjtutex/sjtureport.cls +++ b/texmf/tex/latex/sjtutex/sjtureport.cls @@ -26,7 +26,7 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Report template for Shanghai Jiao Tong University} \ProvidesExplClass{sjtureport} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -51,8 +51,8 @@ \skip_new:N \l__sjtu_tmpa_skip \box_new:N \l__sjtu_tmpa_box \tl_new:N \g__sjtu_lang_tl -\tl_new:N \g__sjtu_lang_aux_tl -\tl_set:Nn \g__sjtu_lang_aux_tl { zh } +\tl_const:Nn \c__sjtu_lang_de_tl { de } +\tl_const:Nn \c__sjtu_lang_ja_tl { ja } \tl_new:N \g__sjtu_zihao_tl \dim_new:N \g__sjtu_font_size_dim \dim_new:N \g__sjtu_line_skip_dim @@ -68,7 +68,6 @@ \bool_new:N \g__sjtu_slanted_uppercase_greek_bool \bool_new:N \g__sjtu_upright_integral_bool \bool_new:N \g__sjtu_integral_limits_bool -\clist_new:N \g__sjtu_options_to_ctex_class_clist \clist_set:Nn \g__sjtu_options_to_ctex_class_clist { a4paper, UTF8, scheme = plain, fontset = none } \clist_new:N \g__sjtu_options_to_packages_clist @@ -93,24 +92,22 @@ lang .choice: , lang .value_required:n = true , lang .choices:nn = - { zh, en } + { zh, en, de, ja } { \tl_gset_eq:NN \g__sjtu_lang_tl \l_keys_choice_tl - \int_compare:nNnT { \l_keys_choice_int } = { 1 } - { \tl_gset:Nn \g__sjtu_lang_aux_tl { en } } } , lang .initial:n = { zh } , zihao .choice: , zihao .value_required:n = true , zihao / -4 .code:n = { - \tl_gset:Nn \g__sjtu_zihao_tl { -4 } + \tl_gset:Nn \g__sjtu_zihao_tl {#1} \dim_gset:Nn \g__sjtu_font_size_dim { 12 bp } \dim_gset:Nn \g__sjtu_default_line_skip_dim { 20 bp } } , zihao / 5 .code:n = { - \tl_gset:Nn \g__sjtu_zihao_tl { 5 } + \tl_gset:Nn \g__sjtu_zihao_tl {#1} \dim_gset:Nn \g__sjtu_font_size_dim { 10.5 bp } \dim_gset:Nn \g__sjtu_default_line_skip_dim { 15.6 bp } } , @@ -200,7 +197,9 @@ \bool_if:NT \g__sjtu_upright_integral_bool { upint } , \bool_if:NT \g__sjtu_integral_limits_bool - { intlimits } + { intlimits } , + \tl_if_eq:NNT \g__sjtu_lang_tl \c__sjtu_lang_de_tl + { german, ngerman } } \clist_put_right:Nx \g__sjtu_options_to_ctex_class_clist { @@ -254,10 +253,12 @@ graphicx, enumitem } -\cs_generate_variant:Nn \tl_const:Nn { co, Nv } \cs_generate_variant:Nn \cs_gset:Npn { cpo } -\prg_generate_conditional_variant:Nnn \regex_match:nn { ne } { T } +\cs_generate_variant:Nn \tl_const:Nn { Nv } +\cs_generate_variant:Nn \clist_use:Nn { NV, cv } \exp_args_generate:n { Nnv } +\cs_generate_variant:Nn \exp_last_unbraced:Ne { ce } +\prg_generate_conditional_variant:Nnn \regex_match:nn { ne } { T, TF } \cs_new:Npx \__sjtu_engine_case:nn #1#2 { \bool_lazy_or:nnTF @@ -286,7 +287,7 @@ { \cs_new:Npn \__sjtu_unicode_char:n #1 { - \Unicode + \exp_not:N \Unicode { \int_div_truncate:nn {#1} { 256 } } { \int_mod:nn {#1} { 256 } } } @@ -322,6 +323,9 @@ } \cs_generate_variant:Nn \__sjtu_dim_set_to_wd:Nn { Nv } \cs_generate_variant:Nn \__sjtu_dim_add_to_wd:Nn { cv } +\cs_new:Npn \__sjtu_cs_provide_eq:NN #1#2 + { \cs_if_exist:NF #1 { \cs_set_eq:NN #1 #2 } } +\cs_generate_variant:Nn \__sjtu_cs_provide_eq:NN { cc } \cs_new_protected:Npn \__sjtu_vspace:N #1 { \skip_vertical:N #1 @@ -346,266 +350,15 @@ \skip_set:Nn \l__sjtu_tmpa_skip {#1} \__sjtu_vspace_r:N \l__sjtu_tmpa_skip } -\__sjtu_engine_case:nnn - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \bool_set_false:N \l__sjtu_tmpa_bool - \cs_set_eq:NN \SJTU@CJK@filltwosidesSymbol \CJKsymbol - \cs_set:Npn \CJKsymbol ##1 - { - \bool_if:NTF \l__sjtu_tmpa_bool - { \hfil \SJTU@CJK@filltwosidesSymbol { ##1 } } - { - \SJTU@CJK@filltwosidesSymbol { ##1 } - \bool_set_true:N \l__sjtu_tmpa_bool - } - } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \cs_set:Npn \CJKglue - { \skip_horizontal:n { \c_zero_dim plus 1 filll } } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \ltjsetparameter { kanjiskip = { \c_zero_dim plus 1 filll } } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } -\cs_new_protected:Npn \__sjtu_left_aligned_box:nn #1#2 - { - \mode_leave_vertical: - \hbox_to_wd:nn {#1} { #2 \hfil } - } \cs_new_protected:Npn \__sjtu_define_name:nn #1#2 - { \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} } -\cs_new_protected:Npn \__sjtu_define_name:nnn #1#2#3 - { - \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} - \tl_const:cn { c__sjtu_name_ #1 _en_tl } {#3} - } -\cs_new_protected:Npn \__sjtu_define_name_g:nn #1#2 { \tl_const:cn { c__sjtu_name_ #1 _tl } {#2} } -\cs_new_protected:Npn \__sjtu_define_name_g:nnn #1#2#3 - { - \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} - \tl_const:cn { c__sjtu_name_ #1 _en_tl } {#3} - \tl_gset_eq:cc - { c__sjtu_name_ #1 _tl } - { c__sjtu_name_ #1 _ \g__sjtu_lang_tl _tl } - } -\cs_new_protected:Npn \__sjtu_define_name_from_clist:nNnn #1#2#3#4 - { - \tl_const:cx { c__sjtu_name_ #1 _zh_tl } - { \clist_item:nn {#3} {#2} } - \tl_const:cx { c__sjtu_name_ #1 _en_tl } - { \clist_item:nn {#4} {#2} } - } +\cs_new_protected:Npn \__sjtu_define_name:nnn #1#2#3 + { \tl_const:cn { c__sjtu_name_ #2 _ #1 _tl } {#3} } +\cs_new_protected:Npn \__sjtu_define_name_from_clist:nnnn #1#2#3#4 + { \tl_const:cx { c__sjtu_name_ #2 _ #1 _tl } { \clist_item:nn {#4} {#3} } } +\cs_generate_variant:Nn \__sjtu_define_name:nn { nv } \cs_new_protected:Npn \__sjtu_define_symbol:nn #1#2 - { \tl_const:co { c__sjtu_symbol_ #1 _tl } { \__sjtu_unicode_char:n {#2} } } -\cs_new:Npn \__sjtu_date_aux_zh:nnn #1#2#3 - { \__zhnum_date_aux:Nnnnn \int_to_arabic:n { ~ } {#1} {#2} {#3} } -\cs_new:Npn \__sjtu_date_aux_zh:w #1-#2-#3 \q_stop - { \__sjtu_date_aux_zh:nnn {#1} {#2} {#3} } -\clist_const:Nn \c__sjtu_name_month_en_clist - { - January, February, March, April, May, June, - July, August, September, October, November, December - } -\cs_new:Npn \__sjtu_ordinal_en:n #1 - { - \int_to_arabic:n {#1} - \exp_not:N \textsuperscript - { - \int_case:nnF { \int_mod:nn {#1} { 100 } } - { - { 11 } { th } - { 12 } { th } - { 13 } { th } - } - { - \int_case:nnF { \int_mod:nn {#1} { 10 } } - { - { 1 } { st } - { 2 } { nd } - { 3 } { rd } - } - { th } - } - } - } -\cs_new:Npn \__sjtu_date_aux_en:nnn #1#2#3 - { \clist_item:Nn \c__sjtu_name_month_en_clist {#2}~ \__sjtu_ordinal_en:n {#3},~ #1 } -\cs_new:Npn \__sjtu_date_aux_en:w #1-#2-#3 \q_stop - { \__sjtu_date_aux_en:nnn {#1} {#2} {#3} } -\clist_map_inline:nn - { zh, en } - { - \tl_const:cx { c__sjtu_today_ #1 _tl } - { - \use:c { __sjtu_date_aux_ #1 :nnn } - { \int_value:w \tex_year:D } - { \tex_month:D } - { \tex_day:D } - } - } -\tl_const:Nv \c__sjtu_today_tl { c__sjtu_today_ \g__sjtu_lang_tl _tl } -\file_input:n { sjtu-name-generic.cfg } -\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } -\keys_define:nn { sjtu } - { - info .meta:nn = { sjtu / info } {#1} , - style .meta:nn = { sjtu / style } {#1} , - name .meta:nn = { sjtu / name } {#1} - } -\clist_map_inline:nn - { - title, display_title, running_title, subject, author, date, - supervisor, assoc_supervisor, department, - } - { - \tl_new:c { l__sjtu_info_ #1 _zh_tl } - } -\tl_new:N \l__sjtu_info_id_zh_tl -\clist_map_inline:nn - { keywords } - { - \clist_new:c { l__sjtu_info_ #1 _zh_clist } - } -\keys_define:nn { sjtu / info } - { - title .code:n = - { - \tl_set:Nn \l__sjtu_info_title_zh_tl {#1} - \clist_map_inline:nn - { - \l__sjtu_info_display_title_zh_tl , - \l__sjtu_info_running_title_zh_tl - } - { \tl_if_empty:NT ##1 { \tl_set:Nn ##1 {#1} } } - } , - display-title .tl_set:N = \l__sjtu_info_display_title_zh_tl , - running-title .tl_set:N = \l__sjtu_info_running_title_zh_tl , - subject .tl_set:N = \l__sjtu_info_subject_zh_tl , - keywords .clist_set:N = \l__sjtu_info_keywords_zh_clist , - author .tl_set:N = \l__sjtu_info_author_zh_tl , - id .tl_set:N = \l__sjtu_info_id_zh_tl , - supervisor .tl_set:N = \l__sjtu_info_supervisor_zh_tl , - assoc-supervisor .tl_set:N = \l__sjtu_info_assoc_supervisor_zh_tl , - department .tl_set:N = \l__sjtu_info_department_zh_tl , - date .code:n = - { - \regex_match:neT { \d{4}-\d{2}-\d{2} } {#1} - { - \tl_set:Nx \l__sjtu_info_date_zh_tl - { \exp_last_unbraced:Ne \__sjtu_date_aux_zh:w #1 \q_stop } - \tl_set:Nx \l__sjtu_info_date_en_tl - { \exp_last_unbraced:Ne \__sjtu_date_aux_en:w #1 \q_stop } - } - } , - display-date .tl_set:N = \l__sjtu_info_date_zh_tl , - display-date .initial:V = \c__sjtu_today_tl , - } -\RenewDocumentCommand \title { s +m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { title* = {#2} } } - { \keys_set_known:nn { sjtu / info } { title = {#2} } } - } -\tl_set:Nn \@title { \l__sjtu_info_title_zh_tl } -\RenewDocumentCommand \author { s m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { author* = {#2} } } - { \keys_set_known:nn { sjtu / info } { author = {#2} } } - } -\tl_set:Nn \@author { \l__sjtu_info_author_zh_tl } -\RenewDocumentCommand \date { s m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { display-date* = {#2} } } - { \keys_set_known:nn { sjtu / info } { display-date = {#2} } } - } -\tl_set:Nn \@date { \l__sjtu_info_date_zh_tl } -\tl_set:Nv \today { c__sjtu_today_ \g__sjtu_lang_tl _tl } -\keys_define:nn { sjtu / style } - { - float-font .tl_set:N = \SJTU@style@float@font , - float-font .initial:n = \zihao { 5 } \fixedlineskip { 15.6 bp } , - caption-font .code:n = - { \DeclareCaptionFont { SJTU@font } {#1} } , - caption-font .initial:n = \zihao { 5 } \bfseries , - subcaption-font .code:n = - { \DeclareCaptionFont { SJTU@sub@font } {#1} } , - subcaption-font .initial:n = \zihao { 5 } \normalfont , - fnmark-font .tl_set:N = \l__sjtu_style_fnmark_font_tl , - fnmark-font .initial:n = , - float-num-sep .tl_set:N = \l__sjtu_style_fl_num_sep_tl , - float-num-sep .initial:n = { -- } , - equation-num-sep .tl_set:N = \l__sjtu_style_eq_num_sep_tl , - equation-num-sep .initial:n = { -- } , - title-logo-color .choice: , - title-logo-color .choices:nn = - { red, blue, black } - { \tl_set_eq:NN \l__sjtu_style_title_logo_color_tl \l_keys_choice_tl } , - title-logo-color .initial:n = { red } , - header-logo-color .choice: , - header-logo-color .choices:nn = - { red, blue, black } - { \tl_set_eq:NN \l__sjtu_style_header_logo_color_tl \l_keys_choice_tl } , - header-logo-color .initial:n = { red } , - header-uppercase .choice: , - header-uppercase / true .code:n = - { \cs_gset_eq:NN \__sjtu_nouppercase:n \use:n } , - header-uppercase / false .code:n = - { \cs_gset:Nn \__sjtu_nouppercase:n { \nouppercase {##1} } } , - header-uppercase .default:n = { true } , - header-uppercase .initial:n = { false } , - header-font .tl_set:N = \l__sjtu_style_header_font_tl , - header-font .initial:n = \zihao { -5 } \sffamily , - footer-font .tl_set:N = \l__sjtu_style_footer_font_tl , - footer-font .initial:n = \zihao { -5 } , - page-number .cs_set:Np = \__sjtu_page:n #1 , - page-number .initial:n = { {#1} } - } -\keys_define:nn { sjtu / name } - { - contents .tl_set:N = \contentsname , - listfigure .tl_set:N = \listfigurename , - listtable .tl_set:N = \listtablename , - figure .tl_set:N = \figurename , - table .tl_set:N = \tablename , - abstract .tl_set:N = \abstractname , - index .tl_set:N = \indexname , - appendix .tl_set:N = \appendixname , - proof .tl_set:N = \proofname , - bib .tl_set:N = \bibname , - figure* .tl_set:N = \l__sjtu_name_figure_aux_tl , - figure* .initial:n = { 图 } , - table* .tl_set:N = \l__sjtu_name_table_aux_tl , - table* .initial:n = { 表 } , - algorithm .tl_set:N = \l__sjtu_name_algorithm_tl , - algorithm .initial:n = { Algorithm } , - listalgorithm .tl_set:N = \l__sjtu_name_listalgorithm_tl , - listalgorithm .initial:n = { List~of~Algorithms } , - } -\file_input:n { sjtu-lang-report- \g__sjtu_lang_tl .cfg } + { \tl_const:cx { c__sjtu_symbol_ #1 _tl } { \__sjtu_unicode_char:n {#2} } } \cs_new_protected:Npn \__sjtu_fontset_error:nn #1#2 { \msg_error:nnnn { sjtutex } { font-unavailable } {#1} {#2} } \msg_new:nnn { sjtutex } { font-unavailable } @@ -634,8 +387,12 @@ } \cs_new_protected:Nn \__sjtu_set_unimath_symbol: { - \cs_set_eq:NN \increment \upDelta - \cs_set_eq:NN \QED \blacksquare + \clist_map_inline:nn + { + { increment } { upDelta } , + { QED } { blacksquare } + } + { \__sjtu_cs_provide_eq:cc ##1 } } \tl_if_empty:NT \g__sjtu_math_font_tl { \tl_gset_eq:NN \g__sjtu_math_font_tl \g__sjtu_text_font_tl } @@ -700,6 +457,9 @@ \intcap\intcup\upint\lowint } } +\NewDocumentCommand \CJKrmfamily { } { \CJKfamily { \CJKrmdefault } } +\NewDocumentCommand \CJKsffamily { } { \CJKfamily { \CJKsfdefault } } +\NewDocumentCommand \CJKttfamily { } { \CJKfamily { \CJKttdefault } } \__sjtu_unicode_engine_case:nn { \xeCJK_declare_char_class:nn { CJK } @@ -710,6 +470,30 @@ { "24EA, "2460-"2473, "3251-"32BF, "25A1 } \ltjsetparameter { jacharrange = { +99 } } } +\keys_define:nn { sjtu / name } + { + contents .meta:nn = { ctex } { contentsname = {#1} } , + listfigure .meta:nn = { ctex } { listfigurename = {#1} } , + listtable .meta:nn = { ctex } { listtablename = {#1} } , + figure .meta:nn = { ctex } { figurename = {#1} } , + table .meta:nn = { ctex } { tablename = {#1} } , + abstract .meta:nn = { ctex } { abstractname = {#1} } , + index .meta:nn = { ctex } { indexname = {#1} } , + appendix .meta:nn = { ctex } { appendixname = {#1} } , + proof .meta:nn = { ctex } { proofname = {#1} } , + bib .meta:nn = { ctex } { bibname = {#1} } , + part .tl_set:N = \partname , + chapter .tl_set:N = \chaptername , + figure* .tl_set:N = \SJTU@figurename@aux , + figure* .initial:n = { 图 } , + table* .tl_set:N = \SJTU@tablename@aux , + table* .initial:n = { 表 } , + algorithm .tl_set:N = \SJTU@algorithmname , + algorithm .initial:n = { Algorithm } , + listalgorithm .tl_set:N = \SJTU@listalgorithmname , + listalgorithm .initial:n = { List~of~Algorithms } , + } + \file_input:n { sjtu-name-generic- \g__sjtu_lang_tl .def } \geometry { top = 3.5 cm, @@ -721,46 +505,64 @@ footskip = 1.0 cm } \pagestyle { fancy } -\cs_new:Nn \__sjtu_thepage: { \thepage } \fancyhf { } -\tl_set:Nn \l__sjtu_header_logo_tl +\keys_define:nn { sjtu / style } + { + header-font .tl_set:N = \l__sjtu_style_header_font_tl , + header-font .initial:n = \zihao { -5 } \sffamily , + footer-font .tl_set:N = \l__sjtu_style_footer_font_tl , + footer-font .initial:n = \zihao { -5 } + } +\fancyheadinit { \l__sjtu_style_header_font_tl } +\fancyfootinit { \l__sjtu_style_footer_font_tl } +\keys_define:nn { sjtu / style } + { + header-uppercase .choice: , + header-uppercase / true .code:n = + { \cs_set_eq:NN \__sjtu_nouppercase:n \use:n } , + header-uppercase / false .code:n = + { \cs_set:Nn \__sjtu_nouppercase:n { \nouppercase {##1} } } , + header-uppercase .default:n = { true } , + header-uppercase .initial:n = { false } + } +\cs_generate_variant:Nn \__sjtu_nouppercase:n { V } +\keys_define:nn { sjtu / style } + { + header-logo-color .choice: , + header-logo-color .choices:nn = + { red, blue, black } + { \tl_set_eq:NN \l__sjtu_style_header_logo_color_tl \l_keys_choice_tl } , + header-logo-color .initial:n = { red } , + } +\cs_new:Nn \__sjtu_thepage: { \thepage } +\keys_define:nn { sjtu / style } + { + page-number .cs_set:Np = \__sjtu_page:n #1 , + page-number .initial:n = { {#1} } + } +\tl_set:Nn \l__sjtu_header_tl { \includegraphics [ height = 1.2 cm ] { sjtu-vi-logo- \l__sjtu_style_header_logo_color_tl .pdf } } +\tl_set:Nn \l__sjtu_leftmark_tl { \l__sjtu_info_subject_tl } +\tl_set:Nn \l__sjtu_rightmark_tl { \leftmark } \bool_if:NTF \g__sjtu_twoside_bool { - \fancyhead [ RE, LO ] - { \l__sjtu_header_logo_tl } - \fancyhead [ RO ] - { - \l__sjtu_style_header_font_tl - \__sjtu_nouppercase:n { \rightmark } - } - \fancyhead [ LE ] - { - \__sjtu_nouppercase:n { \leftmark } - } + \fancyhead [ LO, RE ] { \l__sjtu_header_tl } + \fancyhead [ LE ] { \__sjtu_nouppercase:V \l__sjtu_leftmark_tl } + \fancyhead [ RO ] { \__sjtu_nouppercase:V \l__sjtu_rightmark_tl } } { - \fancyhead [ L ] - { \l__sjtu_header_logo_tl } - \fancyhead [ R ] - { - \l__sjtu_style_header_font_tl - \__sjtu_nouppercase:n { \leftmark } - } - } -\fancyfoot [ C ] - { - \l__sjtu_style_footer_font_tl - \__sjtu_page:n { \__sjtu_thepage: } + \fancyhead [ L ] { \l__sjtu_header_tl } + \fancyhead [ R ] { \__sjtu_nouppercase:V \l__sjtu_rightmark_tl } } +\fancyfoot [ C ] { \__sjtu_page:n { \__sjtu_thepage: } } \bool_if:NTF \g__sjtu_twoside_bool { \fancypagestyle { plain } { - \fancyhead [ RE, LO ] { } + \fancyhead [ LE, RO ] { } \tl_set:Nn \headrulewidth { 0 pt } } } @@ -789,7 +591,7 @@ afterskip = 18 bp , lofskip = \c_zero_skip , lotskip = \c_zero_skip , - format = \zihao { 3 } \bfseries \heiti \centering , + format = \zihao { 3 } \bfseries \CJKsffamily \centering , nameformat = , titleformat = , aftername = \quad , @@ -799,14 +601,14 @@ { beforeskip = 24 bp , afterskip = 6 bp , - format = \zihao { 4 } \bfseries \heiti , + format = \zihao { 4 } \bfseries \CJKsffamily , afterindent = true } \ctex_set:nn { subsection } { beforeskip = 12 bp , afterskip = 6 bp , - format = \zihao { -4 } \bfseries \heiti , + format = \zihao { -4 } \bfseries \CJKsffamily , afterindent = true } \ctex_set:nn { subsubsection } @@ -844,24 +646,31 @@ { \SJTU@head* {#1} [#2] } \cs_new:Npn \__sjtu_head_auxb_s:nn #1#2 { \SJTU@head* [#1] {#2} } -\cs_generate_variant:Nn \__sjtu_head_aux:n { V } -\cs_generate_variant:Nn \__sjtu_head_aux_s:n { V } -\cs_generate_variant:Nn \__sjtu_head_auxa_s:nn { Vn, VV } -\cs_generate_variant:Nn \__sjtu_head_auxb_s:nn { Vo } +\cs_generate_variant:Nn \__sjtu_head_auxa_s:nn { xn, xv } +\cs_generate_variant:Nn \__sjtu_head_auxb_s:nn { nx } \cs_new_eq:NN \__sjtu_pdf_bookmark:nn \use_none:nn \cs_new_eq:NN \__sjtu_phantom_section: \prg_do_nothing: -\ctex_if_autoindent_touched:F - { \ctex_set:n { autoindent = true } } -\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd } -\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd } -\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd } \setlist { nosep } \tl_set:Nn \textfraction { 0.15 } \tl_set:Nn \topfraction { 0.85 } \tl_set:Nn \bottomfraction { 0.65 } \tl_set:Nn \floatpagefraction { 0.60 } +\keys_define:nn { sjtu / style } + { + float-font .tl_set:N = \SJTU@style@float@font , + float-font .initial:n = \zihao { 5 } \fixedlineskip { 15.6 bp } + } \ctex_patch_cmd:Nnn \@floatboxreset { \normalsize } { \SJTU@style@float@font } +\keys_define:nn { sjtu / style } + { + caption-font .code:n = + { \DeclareCaptionFont { SJTU@font } {#1} } , + caption-font .initial:n = \zihao { 5 } \bfseries , + subcaption-font .code:n = + { \DeclareCaptionFont { SJTU@sub@font } {#1} } , + subcaption-font .initial:n = \zihao { 5 } \normalfont + } \DeclareCaptionLabelSeparator { enskip } { \enskip } \captionsetup { @@ -877,11 +686,18 @@ } \DeclareCaptionOption { aux-names } [ ] { - \tl_set:Nn \figurename { \l__sjtu_name_figure_aux_tl } - \tl_set:Nn \tablename { \l__sjtu_name_table_aux_tl } + \tl_set:Nn \figurename { \SJTU@figurename@aux } + \tl_set:Nn \tablename { \SJTU@tablename@aux } } \captionsetup [ bi-second ] { aux-names } -\NewDocumentCommand \SJTUcounterwithin +\keys_define:nn { sjtu / style } + { + float-num-sep .tl_set:N = \l__sjtu_style_fl_num_sep_tl , + float-num-sep .initial:n = { -- } , + equation-num-sep .tl_set:N = \l__sjtu_style_eq_num_sep_tl , + equation-num-sep .initial:n = { -- } + } +\NewDocumentCommand \SJTU@counterwithin { s O{ \l__sjtu_style_fl_num_sep_tl } O{ \arabic } m m } { \@ifbothcounters {#4} {#5} @@ -894,24 +710,12 @@ } } } -\cs_set:Npn \thefigure - { \thechapter \l__sjtu_style_fl_num_sep_tl \arabic { figure } } -\cs_set:Npn \thetable - { \thechapter \l__sjtu_style_fl_num_sep_tl \arabic { table } } -\cs_set:Npn \theequation - { \thechapter \l__sjtu_style_eq_num_sep_tl \arabic { equation } } -\cs_new_protected:Nn \__sjtu_make_fnmark: - { \hbox:n { \@thefnmark } } -\ctex_at_end_preamble:n { - \cs_set_eq:NN \__sjtu_orig_make_fntext:n \@makefntext - \cs_set:Npn \@makefntext #1 - { - \group_begin: - \cs_set_eq:NN \@makefnmark \__sjtu_make_fnmark: - \__sjtu_orig_make_fntext:n {#1} - \group_end: - } -} +\SJTU@counterwithin { figure } { chapter } +\SJTU@counterwithin { table } { chapter } +\SJTU@counterwithin [ \l__sjtu_style_eq_num_sep_tl ] { equation } { chapter } +\cs_set_eq:NN \__sjtu_makefnmark_plain: \@makefnmark +\cs_set_eq:NN \__sjtu_thefootnote_plain: \thefootnote +\cs_set_eq:NN \__sjtu_thempfootnote_plain: \thempfootnote \cs_new:Npn \__sjtu_footnote_number:N #1 { \int_compare:nNnTF {#1} < { 21 } @@ -928,217 +732,115 @@ } \msg_new:nnn { sjtutex } { too-many-footnotes } { Too~ many~ footnotes. } -\cs_set:Npn \thefootnote - { - \hbox:n { } - { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@footnote } - } -\cs_set:Npn \thempfootnote - { - \hbox:n { } - { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@mpfootnote } - } -\DeclareObjectType { sjtu } { 0 } -\DeclareTemplateInterface { sjtu } { component } { 0 } +\cs_new:Nn \__sjtu_makefnmark_circled: { \hbox:n { \@thefnmark } } +\keys_define:nn { sjtu / style } { - format : tokenlist = \c_empty_tl , - content : tokenlist = \c_empty_tl , - bottom-skip : skip = \c_zero_skip , - align : choice { left, right, center, normal } = center + fnmark-font .choice: , + fnmark-font / haranoaji .code:n = + { + \__sjtu_engine_case:nn + { \tl_set_eq:NN \l__sjtu_style_fnmark_font_tl \c_empty_tl } + { + \tl_set:Nn \l__sjtu_style_fnmark_font_tl + { + \CJKfontspec { HaranoAjiMincho } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold + ] + } + } + } , + fnmark-font / unknown .tl_set:N = \l__sjtu_style_fnmark_font_tl , + fnmark-font .initial:V = \c_empty_tl } -\DeclareTemplateCode { sjtu } { component } { 0 } +\cs_new:Nn \__sjtu_thefootnote_circled: + { { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@footnote } } +\cs_new:Nn \__sjtu_thempfootnote_circled: + { { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@mpfootnote } } +\keys_define:nn { sjtu / style } { - format = \l__sjtu_component_format_tl , - content = \l__sjtu_component_content_tl , - bottom-skip = \l__sjtu_component_bottom_skip , - align = + fnmark-style .choice: , + fnmark-style / plain .code:n = { - left = - \cs_set_eq:NN \l__sjtu_component_align: \raggedright , - right = - \cs_set_eq:NN \l__sjtu_component_align: \raggedleft , - center = - \cs_set_eq:NN \l__sjtu_component_align: \centering , - normal = - \cs_set_eq:NN \l__sjtu_component_align: \prg_do_nothing: + \cs_set_eq:NN \__sjtu_makefnmark: \__sjtu_makefnmark_plain: + \cs_set_eq:NN \thefootnote \__sjtu_thefootnote_plain: + \cs_set_eq:NN \thempfootnote \__sjtu_thempfootnote_plain: + } , + fnmark-style / circled .code:n = + { + \cs_set_eq:NN \__sjtu_makefnmark: \__sjtu_makefnmark_circled: + \cs_set_eq:NN \thefootnote \__sjtu_thefootnote_circled: + \cs_set_eq:NN \thempfootnote \__sjtu_thempfootnote_circled: } } +\ctex_at_end_preamble:n { + \cs_set_eq:NN \__sjtu_orig_make_fntext:n \@makefntext + \cs_set:Npn \@makefntext #1 + { + \group_begin: + \cs_set_eq:NN \@makefnmark \__sjtu_makefnmark: + \__sjtu_orig_make_fntext:n {#1} + \group_end: + } +} +\tl_new:N \l__sjtu_info_subject_tl +\clist_new:N \l__sjtu_info_keywords_clist +\keys_define:nn { sjtu / info } { - \AssignTemplateKeys - \group_begin: - \l__sjtu_component_align: - \l__sjtu_component_format_tl - \l__sjtu_component_content_tl - \par - \group_end: - \__sjtu_vspace:N \l__sjtu_component_bottom_skip - } -\DeclareTemplateInterface { sjtu } { page } { 0 } - { - bookmark : boolean = false , - bookmark-text : tokenlist = \c_empty_tl , - style : tokenlist = empty , - format : tokenlist = \linespread { 1 } \selectfont , - prefix : tokenlist , - components : commalist , - top-skip : skip = \c_zero_skip , - bottom-skip : skip = \c_zero_skip - } -\DeclareTemplateCode { sjtu } { page } { 0 } - { - bookmark = \l__sjtu_page_bookmark_bool , - bookmark-text = \l__sjtu_page_bookmark_text_tl , - style = \l__sjtu_page_style_tl , - format = \l__sjtu_page_format_tl , - prefix = \l__sjtu_page_prefix_tl , - components = \l__sjtu_page_components_clist , - top-skip = \l__sjtu_page_top_skip , - bottom-skip = \l__sjtu_page_bottom_skip - } - { - \AssignTemplateKeys - \bool_if:NTF \g__sjtu_openright_bool - { \cleardoublepage } { \clearpage } - \bool_if:NT \l__sjtu_page_bookmark_bool - { \__sjtu_pdf_bookmark:nn { 0 } { \l__sjtu_page_bookmark_text_tl } } - \exp_args:No \thispagestyle { \l__sjtu_page_style_tl } - \__sjtu_vspace_r:N \l__sjtu_page_top_skip - \__sjtu_vspace:n { - \tex_parskip:D } - \__sjtu_vspace:n { - \tex_baselineskip:D } - \group_begin: - \l__sjtu_page_format_tl - \clist_map_inline:Nn \l__sjtu_page_components_clist - { \UseInstance { sjtu } { \l__sjtu_page_prefix_tl / ##1 } } - \group_end: - \__sjtu_vspace:N \l__sjtu_page_bottom_skip - \clearpage - } -\cs_new:Npn \__sjtu_declare_component:nnn #1#2#3 - { \DeclareInstance { sjtu } {#1/#2} { component } {#3} } -\cs_new:Npn \__sjtu_declare_page:nn #1#2 - { \DeclareInstance { sjtu } {#1} { page } {#2} } -\cs_new:Npn \__sjtu_title_page_info:nnn #1#2#3 - { - \group_begin: - \cs_set:Npn \l__sjtu_info_output_format:NNN ##1##2##3 {#3} - \clist_clear:N \l__sjtu_tmpa_clist - \clist_clear:N \l__sjtu_tmpb_clist - \dim_set:Nn \l__sjtu_tmpb_dim { 5 em } - \clist_map_inline:nn {#2} - { - \clist_put_right:No \l__sjtu_tmpa_clist - { \cs:w c__sjtu_name_ ##1 _ #1 _tl \cs_end: } - \clist_put_right:No \l__sjtu_tmpb_clist - { \cs:w l__sjtu_info_ ##1 _ #1 _tl \cs_end: } - \__sjtu_dim_set_to_wd:Nv \l__sjtu_tmpa_dim { l__sjtu_info_ ##1 _ #1 _tl } - \dim_set:Nn \l__sjtu_tmpb_dim - { \dim_max:nn { \l__sjtu_tmpa_dim } { \l__sjtu_tmpb_dim } } - } - \bool_until_do:nn - { \clist_if_empty_p:N \l__sjtu_tmpa_clist } - { - \clist_pop:NN \l__sjtu_tmpa_clist \l__sjtu_tmpa_tl - \clist_pop:NN \l__sjtu_tmpb_clist \l__sjtu_tmpb_tl - \l__sjtu_info_output_format:NNN - \l__sjtu_tmpa_tl \l__sjtu_tmpb_dim \l__sjtu_tmpb_tl - \skip_vertical:N \c_zero_dim - } - \group_end: + title .tl_set:N = \@title , + author .tl_set:N = \@author , + display-date .tl_set:N = \@date , + subject .tl_set:N = \l__sjtu_info_subject_tl , + keywords .clist_set:N = \l__sjtu_info_keywords_clist , } -\cs_generate_variant:Nn \__sjtu_title_page_info:nnn { nxn } -\clist_map_inline:nn +\file_input:n { sjtu-lang-generic- \g__sjtu_lang_tl .def } +\file_input:n { sjtu-scheme- \g__sjtu_lang_tl .def } +\keys_define:nn { sjtu / info } { - { logo } + date .code:n = { - content = + \regex_match:neTF { \d+-\d+-\d+ } {#1} { - \includegraphics [ width = 3 cm ] - { sjtu-vi-badge- \l__sjtu_style_title_logo_color_tl .pdf } - \skip_vertical:n { 0.3 cm } - \includegraphics [ width = 6.81 cm ] - { sjtu-vi-name- \l__sjtu_style_title_logo_color_tl .pdf } - } - }, - { subject } - { - format = \zihao { -2 } \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_subject_zh_tl , - bottom-skip = \c_zero_dim plus 2 fill - }, - { title } - { - format = \zihao { 2 } \bfseries \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_display_title_zh_tl , - bottom-skip = \c_zero_dim plus 3 fill - }, - { info } - { - format = \zihao { 4 } \fixedlineskip { 31.2 bp } , - content = - { - \__sjtu_title_page_info:nxn { zh } + \tl_set:Nx \@date { - author, - id, - supervisor, - \tl_if_empty:NF \l__sjtu_info_assoc_supervisor_zh_tl - { assoc_supervisor }, - department, + \exp_last_unbraced:ce + { __sjtu_date_aux_ \g__sjtu_lang_tl :w } #1 \q_stop } + } + { + \regex_match:neT { \d+-\d+ } {#1} { - \__sjtu_cjk_spread_box:nn { 5 em } { \heiti #1 } - \c__sjtu_name_info_sep_zh_tl - \__sjtu_left_aligned_box:nn {#2} {#3} + \tl_set:Nx \@date + { + \exp_last_unbraced:ce + { __sjtu_date_aux_short_ \g__sjtu_lang_tl :w } #1 \q_stop + } } - } , - bottom-skip = 31.2 bp - }, - { date } + } + } , + date .initial:x = { - format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_date_zh_tl + \int_to_arabic:n { \c_sys_year_int } - + \int_to_arabic:n { \c_sys_month_int } - + \int_to_arabic:n { \c_sys_day_int } } } - { - \__sjtu_declare_component:nnn { title / zh } #1 - } -\__sjtu_declare_page:nn { title / zh } - { - bookmark = true , - bookmark-text = \c__sjtu_name_title_page_tl , - prefix = title / zh , - components = { logo, subject, title, info, date } - } +\tl_set:NV \today \@date \bool_if:NT \g__sjtu_titlepage_bool + { \__sjtu_appto_cmd:Nn \abstract { \par } } +\__sjtu_preto_cmd:Nn \endabstract { - \RenewDocumentCommand \maketitle { } - { \UseInstance { sjtu } { title / zh } } - } -\cs_new:Nn \__sjtu_output_keywords:Nnn - { - \clist_if_empty:NF #1 + \clist_if_empty:NF \l__sjtu_info_keywords_clist { \par \mode_leave_vertical: \par \noindent - { \bfseries #2 } \clist_use:Nn #1 {#3} - } - } -\bool_if:NTF \g__sjtu_titlepage_bool - { - \DeclareDocumentEnvironment { abstract } { } - { - \__sjtu_head_aux_s:n { \abstractname } - } - { - \__sjtu_output_keywords:Nnn \l__sjtu_info_keywords_zh_clist - { \c__sjtu_name_keywords_tl } { \c__sjtu_name_item_sep_tl } - \clearpage - } - } - { - \__sjtu_preto_cmd:Nn \endabstract - { - \__sjtu_output_keywords:Nnn \l__sjtu_info_keywords_zh_clist - { \c__sjtu_name_keywords_tl } { \c__sjtu_name_item_sep_tl } + { + \bfseries + \c__sjtu_name_keywords_tl + \c__sjtu_name_info_sep_tl + } + \clist_use:NV \l__sjtu_info_keywords_clist \c__sjtu_name_item_sep_tl } } \DeclareDocumentCommand \tableofcontents { } @@ -1168,61 +870,17 @@ } \ctex_at_end_preamble:n { \__sjtu_update_cft_presnum: } -\newcounter { SJTU@bib } -\NewDocumentEnvironment { @bibliolist } { m } +\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } +\keys_define:nn { sjtu } { - \cs_if_exist_use:N \bibfont - \list - { \@biblabel { \arabic{ SJTU@bib } } } - { - \__sjtu_dim_set_to_wd:Nn \labelwidth { \@biblabel {#1} } - \dim_set_eq:NN \leftmargin \labelwidth - \dim_add:Nn \leftmargin { \labelsep } - \dim_if_exist:NTF \bibitemsep - { - \dim_set_eq:NN \itemsep \bibitemsep - \dim_if_exist:NT \bibparsep - { \dim_set_eq:NN \parsep \bibparsep } - } - { - \dim_if_exist:NT \bibsep - { - \dim_set_eq:NN \itemsep \bibsep - \dim_zero:N \parsep - } - } - \@nmbrlisttrue - \tl_set:Nn \@listctr { SJTU@bib } - \cs_set:Npn \p@SJTU@bib { } - \cs_set:Npn \theSJTU@bib { \arabic { SJTU@bib } } - } - \sloppy - \int_set:Nn \clubpenalty { 4000 } - \int_set_eq:NN \@clubpenalty \clubpenalty - \int_set:Nn \widowpenalty { 4000 } - \char_set_sfcode:nn { `\. } { 1000 } - } - { - \cs_set:Npn \@noitemerr - { \msg_warning:nnn { sjtutex } { empty-environment } { bibliolist } } - \endlist - } -\msg_new:nnn { sjtutex } { empty-environment } - { Empty~ `#1'~ environment. } -\NewDocumentEnvironment { bibliolist } { m +b } - { - \cs_set:Npn \@noitemerr { } - \begin { @bibliolist } {#1} - #2 - \end { @bibliolist } - } { } -\NewDocumentEnvironment { bibliolist* } { m +b } - { - \cs_set:Npn \@noitemerr { } - \begin { @bibliolist } {#1} - #2 - \end { @bibliolist } - } { } + style .meta:nn = { sjtu / style } {#1} , + info .meta:nn = { sjtu / info } {#1} , + name .meta:nn = { sjtu / name } {#1} + } +\NewDocumentCommand \subject { m } + { \keys_set:nn { sjtu / info } { subject = {#1} } } +\NewDocumentCommand \keywords { m } + { \keys_set:nn { sjtu / info } { keywords = {#1} } } \ctex_at_end_package:nn { hyperref } { \hypersetup @@ -1257,10 +915,10 @@ { \hypersetup { - pdftitle = \l__sjtu_info_title_zh_tl, - pdfsubject = \l__sjtu_info_subject_zh_tl, - pdfkeywords = \l__sjtu_info_keywords_zh_clist, - pdfauthor = \l__sjtu_info_author_zh_tl + pdftitle = \@title , + pdfauthor = \@author , + pdfsubject = \l__sjtu_info_subject_tl , + pdfkeywords = \l__sjtu_info_keywords_clist } } } @@ -1290,6 +948,7 @@ } \ctex_at_end_package:nn { amsthm } { + \__sjtu_cs_provide_eq:NN \QED \openbox \cs_if_exist:NT \__sjtu_save_openbox: { \cs_set_eq:NN \openbox \__sjtu_save_openbox: } \tl_set:Nn \qedsymbol { \ensuremath { \QED } } @@ -1301,21 +960,22 @@ \item [ \skip_horizontal:N \labelsep - \bfseries \heiti #1 \@addpunct { \enskip } + \bfseries \CJKsffamily #1 \@addpunct { \enskip } ] \ignorespaces } { \popQED \endtrivlist \legacy_if_set_false:n { @endpe } } \newtheoremstyle { sjtu } - { } { } { \normalfont } { } { \bfseries \heiti } { } { \ccwd } { } + { } { } { \normalfont } { } { \bfseries \CJKsffamily } { } { \ccwd } { } \theoremstyle { sjtu } \__sjtu_new_theorems: } \ctex_at_end_package:nn { ntheorem } { - \theoremheaderfont { \bfseries \heiti } - \theorembodyfont { \normalfont } - \theoremseparator { \enskip } + \__sjtu_cs_provide_eq:NN \QED \c_empty_tl + \theoremheaderfont { \bfseries \CJKsffamily } + \theorembodyfont { \normalfont } + \theoremseparator { \enskip } \theoremsymbol { \ensuremath { \QED } } \qedsymbol { \ensuremath { \QED } } \newtheorem* { proof } { \proofname } @@ -1342,8 +1002,8 @@ } \ctex_at_end_package:nn { algorithm } { - \tl_set:Nn \fname@algorithm { \l__sjtu_name_algorithm_tl } - \tl_set:Nn \listalgorithmname { \l__sjtu_name_listalgorithm_tl } + \tl_set:Nn \fname@algorithm { \SJTU@algorithmname } + \tl_set:Nn \listalgorithmname { \SJTU@listalgorithmname } \__sjtu_newlistof:nnnnn { algorithm } { alg } { algorithm } { \fname@algorithm } { \listalgorithmname } } @@ -1352,9 +1012,9 @@ \ctex_at_end_package:nn { algorithm2e } { \cs_set_eq:NN \@chapter \__sjtu_save_chapter:w - \SetAlgorithmName { \l__sjtu_name_algorithm_tl } - { \l__sjtu_name_algorithm_tl } - { \l__sjtu_name_listalgorithm_tl } + \SetAlgorithmName { \SJTU@algorithmname } + { \SJTU@algorithmname } + { \SJTU@listalgorithmname } \SetAlgoCaptionSeparator { \enskip } \__sjtu_newlistof:nnnnn { algorithm } { alg } { algocf } { \algorithmcfname } { \listalgorithmcfname } @@ -1389,7 +1049,7 @@ } } \ctex_at_end_package:nn { nomencl } - { \tl_set:Nn \nomname { \l__sjtu_name_nom_tl } } + { \tl_set:Nn \nomname { \SJTU@nomname } } \endinput %% %% End of file `sjtureport.cls'. diff --git a/texmf/tex/latex/sjtutex/sjtuthesis.cls b/texmf/tex/latex/sjtutex/sjtuthesis.cls index 7f44929b..08f0ea87 100644 --- a/texmf/tex/latex/sjtutex/sjtuthesis.cls +++ b/texmf/tex/latex/sjtutex/sjtuthesis.cls @@ -26,7 +26,7 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo $Id: sjtutex.dtx 2.0-beta 2023-01-06 17:30:00Z Alexara Wu $ +\GetIdInfo $Id: sjtutex.dtx 2.0 2023-03-29 23:00:00Z Alexara Wu $ {Thesis template for Shanghai Jiao Tong University} \ProvidesExplClass{sjtuthesis} {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -52,8 +52,9 @@ \box_new:N \l__sjtu_tmpa_box \int_new:N \g__sjtu_thesis_type_int \tl_new:N \g__sjtu_lang_tl -\tl_new:N \g__sjtu_lang_aux_tl -\tl_set:Nn \g__sjtu_lang_aux_tl { zh } +\tl_const:Nn \c__sjtu_lang_de_tl { de } +\tl_const:Nn \c__sjtu_lang_ja_tl { ja } +\clist_set:Nn \g__sjtu_lang_clist { zh, en } \tl_new:N \g__sjtu_zihao_tl \dim_new:N \g__sjtu_font_size_dim \dim_new:N \g__sjtu_line_skip_dim @@ -70,7 +71,6 @@ \bool_new:N \g__sjtu_upright_integral_bool \bool_new:N \g__sjtu_integral_limits_bool \bool_new:N \g__sjtu_review_bool -\clist_new:N \g__sjtu_options_to_ctex_class_clist \clist_set:Nn \g__sjtu_options_to_ctex_class_clist { a4paper, UTF8, scheme = plain, fontset = none } \clist_new:N \g__sjtu_options_to_packages_clist @@ -99,24 +99,24 @@ lang .choice: , lang .value_required:n = true , lang .choices:nn = - { zh, en } + { zh, en, de, ja } { \tl_gset_eq:NN \g__sjtu_lang_tl \l_keys_choice_tl - \int_compare:nNnT { \l_keys_choice_int } = { 1 } - { \tl_gset:Nn \g__sjtu_lang_aux_tl { en } } + \clist_if_in:NnF \g__sjtu_lang_clist {#1} + { \clist_gput_right:Nn \g__sjtu_lang_clist {#1} } } , lang .initial:n = { zh } , zihao .choice: , zihao .value_required:n = true , zihao / -4 .code:n = { - \tl_gset:Nn \g__sjtu_zihao_tl { -4 } + \tl_gset:Nn \g__sjtu_zihao_tl {#1} \dim_gset:Nn \g__sjtu_font_size_dim { 12 bp } \dim_gset:Nn \g__sjtu_default_line_skip_dim { 20 bp } } , zihao / 5 .code:n = { - \tl_gset:Nn \g__sjtu_zihao_tl { 5 } + \tl_gset:Nn \g__sjtu_zihao_tl {#1} \dim_gset:Nn \g__sjtu_font_size_dim { 10.5 bp } \dim_gset:Nn \g__sjtu_default_line_skip_dim { 15.6 bp } } , @@ -202,7 +202,9 @@ \bool_if:NT \g__sjtu_upright_integral_bool { upint } , \bool_if:NT \g__sjtu_integral_limits_bool - { intlimits } + { intlimits } , + \tl_if_eq:NNT \g__sjtu_lang_tl \c__sjtu_lang_de_tl + { german, ngerman } } \clist_put_right:Nx \g__sjtu_options_to_ctex_class_clist { @@ -254,10 +256,12 @@ graphicx, enumitem } -\cs_generate_variant:Nn \tl_const:Nn { co, Nv } \cs_generate_variant:Nn \cs_gset:Npn { cpo } -\prg_generate_conditional_variant:Nnn \regex_match:nn { ne } { T } +\cs_generate_variant:Nn \tl_const:Nn { Nv } +\cs_generate_variant:Nn \clist_use:Nn { NV, cv } \exp_args_generate:n { Nnv } +\cs_generate_variant:Nn \exp_last_unbraced:Ne { ce } +\prg_generate_conditional_variant:Nnn \regex_match:nn { ne } { T, TF } \cs_new:Npx \__sjtu_engine_case:nn #1#2 { \bool_lazy_or:nnTF @@ -286,7 +290,7 @@ { \cs_new:Npn \__sjtu_unicode_char:n #1 { - \Unicode + \exp_not:N \Unicode { \int_div_truncate:nn {#1} { 256 } } { \int_mod:nn {#1} { 256 } } } @@ -322,6 +326,9 @@ } \cs_generate_variant:Nn \__sjtu_dim_set_to_wd:Nn { Nv } \cs_generate_variant:Nn \__sjtu_dim_add_to_wd:Nn { cv } +\cs_new:Npn \__sjtu_cs_provide_eq:NN #1#2 + { \cs_if_exist:NF #1 { \cs_set_eq:NN #1 #2 } } +\cs_generate_variant:Nn \__sjtu_cs_provide_eq:NN { cc } \cs_new_protected:Npn \__sjtu_vspace:N #1 { \skip_vertical:N #1 @@ -346,339 +353,98 @@ \skip_set:Nn \l__sjtu_tmpa_skip {#1} \__sjtu_vspace_r:N \l__sjtu_tmpa_skip } -\__sjtu_engine_case:nnn - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \bool_set_false:N \l__sjtu_tmpa_bool - \cs_set_eq:NN \SJTU@CJK@filltwosidesSymbol \CJKsymbol - \cs_set:Npn \CJKsymbol ##1 - { - \bool_if:NTF \l__sjtu_tmpa_bool - { \hfil \SJTU@CJK@filltwosidesSymbol { ##1 } } - { - \SJTU@CJK@filltwosidesSymbol { ##1 } - \bool_set_true:N \l__sjtu_tmpa_bool - } - } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \cs_set:Npn \CJKglue - { \skip_horizontal:n { \c_zero_dim plus 1 filll } } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } - { - \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 - { - \mode_leave_vertical: - \group_begin: - \ltjsetparameter { kanjiskip = { \c_zero_dim plus 1 filll } } - \hbox_to_wd:nn {#1} {#2} - \group_end: - } - } -\cs_new_protected:Npn \__sjtu_left_aligned_box:nn #1#2 - { - \mode_leave_vertical: - \hbox_to_wd:nn {#1} { #2 \hfil } - } \cs_new_protected:Npn \__sjtu_define_name:nn #1#2 - { \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} } -\cs_new_protected:Npn \__sjtu_define_name:nnn #1#2#3 - { - \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} - \tl_const:cn { c__sjtu_name_ #1 _en_tl } {#3} - } -\cs_new_protected:Npn \__sjtu_define_name_g:nn #1#2 { \tl_const:cn { c__sjtu_name_ #1 _tl } {#2} } -\cs_new_protected:Npn \__sjtu_define_name_g:nnn #1#2#3 - { - \tl_const:cn { c__sjtu_name_ #1 _zh_tl } {#2} - \tl_const:cn { c__sjtu_name_ #1 _en_tl } {#3} - \tl_gset_eq:cc - { c__sjtu_name_ #1 _tl } - { c__sjtu_name_ #1 _ \g__sjtu_lang_tl _tl } - } -\cs_new_protected:Npn \__sjtu_define_name_from_clist:nNnn #1#2#3#4 - { - \tl_const:cx { c__sjtu_name_ #1 _zh_tl } - { \clist_item:nn {#3} {#2} } - \tl_const:cx { c__sjtu_name_ #1 _en_tl } - { \clist_item:nn {#4} {#2} } - } +\cs_new_protected:Npn \__sjtu_define_name:nnn #1#2#3 + { \tl_const:cn { c__sjtu_name_ #2 _ #1 _tl } {#3} } +\cs_new_protected:Npn \__sjtu_define_name_from_clist:nnnn #1#2#3#4 + { \tl_const:cx { c__sjtu_name_ #2 _ #1 _tl } { \clist_item:nn {#4} {#3} } } +\cs_generate_variant:Nn \__sjtu_define_name:nn { nv } \cs_new_protected:Npn \__sjtu_define_symbol:nn #1#2 - { \tl_const:co { c__sjtu_symbol_ #1 _tl } { \__sjtu_unicode_char:n {#2} } } -\cs_new:Npn \__sjtu_date_aux_zh:nnn #1#2#3 - { \__zhnum_date_aux:Nnnnn \int_to_arabic:n { ~ } {#1} {#2} {#3} } -\cs_new:Npn \__sjtu_date_aux_zh:w #1-#2-#3 \q_stop - { \__sjtu_date_aux_zh:nnn {#1} {#2} {#3} } -\clist_const:Nn \c__sjtu_name_month_en_clist - { - January, February, March, April, May, June, - July, August, September, October, November, December - } -\cs_new:Npn \__sjtu_ordinal_en:n #1 + { \tl_const:cx { c__sjtu_symbol_ #1 _tl } { \__sjtu_unicode_char:n {#2} } } +\cs_new_protected:Npn \__sjtu_if_lang_valid:nTF #1 + { \clist_if_in:NnTF \g__sjtu_lang_clist {#1} } +\msg_new:nnn { sjtutex } { lang-validation } + { Invalid~ language~ argument~ `#1'! } +\DeclareObjectType { sjtu } { 0 } +\DeclareTemplateInterface { sjtu } { component } { 0 } { - \int_to_arabic:n {#1} - \exp_not:N \textsuperscript - { - \int_case:nnF { \int_mod:nn {#1} { 100 } } - { - { 11 } { th } - { 12 } { th } - { 13 } { th } - } - { - \int_case:nnF { \int_mod:nn {#1} { 10 } } - { - { 1 } { st } - { 2 } { nd } - { 3 } { rd } - } - { th } - } - } + format : tokenlist = \c_empty_tl , + content : tokenlist = \c_empty_tl , + bottom-skip : skip = \c_zero_skip , + align : choice { left, right, center, normal } = center } -\cs_new:Npn \__sjtu_date_aux_en:nnn #1#2#3 - { \clist_item:Nn \c__sjtu_name_month_en_clist {#2}~ \__sjtu_ordinal_en:n {#3},~ #1 } -\cs_new:Npn \__sjtu_date_aux_en:w #1-#2-#3 \q_stop - { \__sjtu_date_aux_en:nnn {#1} {#2} {#3} } -\clist_map_inline:nn - { zh, en } +\DeclareTemplateCode { sjtu } { component } { 0 } { - \tl_const:cx { c__sjtu_today_ #1 _tl } + format = \l__sjtu_component_format_tl , + content = \l__sjtu_component_content_tl , + bottom-skip = \l__sjtu_component_bottom_skip , + align = { - \use:c { __sjtu_date_aux_ #1 :nnn } - { \int_value:w \tex_year:D } - { \tex_month:D } - { \tex_day:D } + left = + \cs_set_eq:NN \l__sjtu_component_align: \raggedright , + right = + \cs_set_eq:NN \l__sjtu_component_align: \raggedleft , + center = + \cs_set_eq:NN \l__sjtu_component_align: \centering , + normal = + \cs_set_eq:NN \l__sjtu_component_align: \prg_do_nothing: } } -\tl_const:Nv \c__sjtu_today_tl { c__sjtu_today_ \g__sjtu_lang_tl _tl } -\file_input:n { sjtu-name-thesis.cfg } -\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } -\keys_define:nn { sjtu } - { - info .meta:nn = { sjtu / info } {#1} , - style .meta:nn = { sjtu / style } {#1} , - name .meta:nn = { sjtu / name } {#1} - } -\clist_map_inline:nn - { - title, display_title, running_title, subject, author, date, - supervisor, assoc_supervisor, department, - co_supervisor, major, degree - } - { - \tl_new:c { l__sjtu_info_ #1 _zh_tl } - \tl_new:c { l__sjtu_info_ #1 _en_tl } - } -\tl_set:co { l__sjtu_info_title_aux_tl } - { \cs:w l__sjtu_info_title_ \g__sjtu_lang_aux_tl _tl \cs_end: } -\tl_new:N \l__sjtu_info_id_zh_tl -\clist_map_inline:nn - { keywords, fund } - { - \clist_new:c { l__sjtu_info_ #1 _zh_clist } - \clist_new:c { l__sjtu_info_ #1 _en_clist } - } -\keys_define:nn { sjtu / info } { - title .code:n = - { - \tl_set:Nn \l__sjtu_info_title_zh_tl {#1} - \clist_map_inline:nn - { - \l__sjtu_info_display_title_zh_tl , - \l__sjtu_info_running_title_zh_tl - } - { \tl_if_empty:NT ##1 { \tl_set:Nn ##1 {#1} } } - } , - title* .code:n = - { - \tl_set:Nn \l__sjtu_info_title_en_tl {#1} - \clist_map_inline:nn - { - \l__sjtu_info_display_title_en_tl , - \l__sjtu_info_running_title_en_tl - } - { \tl_if_empty:NT ##1 { \tl_set:Nn ##1 {#1} } } - } , - display-title .tl_set:N = \l__sjtu_info_display_title_zh_tl , - display-title* .tl_set:N = \l__sjtu_info_display_title_en_tl , - running-title .tl_set:N = \l__sjtu_info_running_title_zh_tl , - running-title* .tl_set:N = \l__sjtu_info_running_title_en_tl , - subject .tl_set:N = \l__sjtu_info_subject_zh_tl , - subject .initial:n = - { - \c__sjtu_name_univ_zh_tl - \c__sjtu_name_degree_level_zh_tl - \c__sjtu_name_thesis_zh_tl - } , - subject* .tl_set:N = \l__sjtu_info_subject_en_tl , - subject* .initial:n = - { - A~ Dissertation~ Submitted~ to \\ - { \c__sjtu_name_univ_en_tl }~ for~ - { \c__sjtu_name_degree_level_en_tl }~ Degree - } , - keywords .clist_set:N = \l__sjtu_info_keywords_zh_clist , - keywords* .clist_set:N = \l__sjtu_info_keywords_en_clist , - author .tl_set:N = \l__sjtu_info_author_zh_tl , - author* .tl_set:N = \l__sjtu_info_author_en_tl , - id .tl_set:N = \l__sjtu_info_id_zh_tl , - supervisor .tl_set:N = \l__sjtu_info_supervisor_zh_tl , - supervisor* .tl_set:N = \l__sjtu_info_supervisor_en_tl , - assoc-supervisor .tl_set:N = \l__sjtu_info_assoc_supervisor_zh_tl , - assoc-supervisor* .tl_set:N = \l__sjtu_info_assoc_supervisor_en_tl , - co-supervisor .tl_set:N = \l__sjtu_info_co_supervisor_zh_tl , - co-supervisor* .tl_set:N = \l__sjtu_info_co_supervisor_en_tl , - degree .tl_set:N = \l__sjtu_info_degree_zh_tl , - degree* .tl_set:N = \l__sjtu_info_degree_en_tl , - department .tl_set:N = \l__sjtu_info_department_zh_tl , - department* .tl_set:N = \l__sjtu_info_department_en_tl , - major .tl_set:N = \l__sjtu_info_major_zh_tl , - major* .tl_set:N = \l__sjtu_info_major_en_tl , - fund .clist_set:N = \l__sjtu_info_fund_zh_clist , - fund* .clist_set:N = \l__sjtu_info_fund_en_clist , - date .code:n = - { - \regex_match:neT { \d{4}-\d{2}-\d{2} } {#1} - { - \tl_set:Nx \l__sjtu_info_date_zh_tl - { \exp_last_unbraced:Ne \__sjtu_date_aux_zh:w #1 \q_stop } - \tl_set:Nx \l__sjtu_info_date_en_tl - { \exp_last_unbraced:Ne \__sjtu_date_aux_en:w #1 \q_stop } - } - } , - display-date .tl_set:N = \l__sjtu_info_date_zh_tl , - display-date .initial:V = \c__sjtu_today_zh_tl , - display-date* .tl_set:N = \l__sjtu_info_date_en_tl , - display-date* .initial:V = \c__sjtu_today_en_tl - } -\RenewDocumentCommand \title { s +m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { title* = {#2} } } - { \keys_set_known:nn { sjtu / info } { title = {#2} } } - } -\tl_set:Nn \@title { \l__sjtu_info_title_zh_tl } -\RenewDocumentCommand \author { s m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { author* = {#2} } } - { \keys_set_known:nn { sjtu / info } { author = {#2} } } - } -\tl_set:Nn \@author { \l__sjtu_info_author_zh_tl } -\RenewDocumentCommand \date { s m } - { - \IfBooleanTF {#1} - { \keys_set_known:nn { sjtu / info } { display-date* = {#2} } } - { \keys_set_known:nn { sjtu / info } { display-date = {#2} } } + \AssignTemplateKeys + \group_begin: + \l__sjtu_component_align: + \l__sjtu_component_format_tl + \l__sjtu_component_content_tl + \par + \group_end: + \__sjtu_vspace:N \l__sjtu_component_bottom_skip } -\tl_set:Nn \@date { \l__sjtu_info_date_zh_tl } -\tl_set:Nv \today { c__sjtu_today_ \g__sjtu_lang_tl _tl } -\ctex_at_end_preamble:n +\DeclareTemplateInterface { sjtu } { page } { 0 } { - \bool_if:NT \g__sjtu_review_bool - { - \clist_map_inline:nn - { author, supervisor, assoc_supervisor, co_supervisor } - { - \tl_clear:c { l__sjtu_info_ #1 _zh_tl } - \tl_clear:c { l__sjtu_info_ #1 _en_tl } - } - \tl_clear:N \l__sjtu_info_id_zh_tl - \clist_clear:N \l__sjtu_info_fund_zh_clist - \clist_clear:N \l__sjtu_info_fund_en_clist - } + bookmark : boolean = false , + bookmark-text : tokenlist = \c_empty_tl , + style : tokenlist = empty , + format : tokenlist = \c_empty_tl , + prefix : tokenlist , + components : commalist , + top-skip : skip = \c_zero_skip , + bottom-skip : skip = \c_zero_skip } -\keys_define:nn { sjtu / style } +\DeclareTemplateCode { sjtu } { page } { 0 } { - float-font .tl_set:N = \SJTU@style@float@font , - float-font .initial:n = \zihao { 5 } \fixedlineskip { 15.6 bp } , - caption-font .code:n = - { \DeclareCaptionFont { SJTU@font } {#1} } , - caption-font .initial:n = \zihao { 5 } \bfseries , - subcaption-font .code:n = - { \DeclareCaptionFont { SJTU@sub@font } {#1} } , - subcaption-font .initial:n = \zihao { 5 } \normalfont , - fnmark-font .tl_set:N = \l__sjtu_style_fnmark_font_tl , - fnmark-font .initial:n = , - float-num-sep .tl_set:N = \l__sjtu_style_fl_num_sep_tl , - float-num-sep .initial:n = { -- } , - equation-num-sep .tl_set:N = \l__sjtu_style_eq_num_sep_tl , - equation-num-sep .initial:n = { -- } , - title-logo-color .choice: , - title-logo-color .choices:nn = - { red, blue, black } - { \tl_set_eq:NN \l__sjtu_style_title_logo_color_tl \l_keys_choice_tl } , - title-logo-color .initial:n = { red } , - header-logo-color .choice: , - header-logo-color .choices:nn = - { red, blue, black } - { \tl_set_eq:NN \l__sjtu_style_header_logo_color_tl \l_keys_choice_tl } , - header-logo-color .initial:n = { red } , - header-uppercase .choice: , - header-uppercase / true .code:n = - { \cs_gset_eq:NN \__sjtu_nouppercase:n \use:n } , - header-uppercase / false .code:n = - { \cs_gset:Nn \__sjtu_nouppercase:n { \nouppercase {##1} } } , - header-uppercase .default:n = { true } , - header-uppercase .initial:n = { false } , - header-font .tl_set:N = \l__sjtu_style_header_font_tl , - header-font .initial:n = \zihao { -5 } , - footer-font .tl_set:N = \l__sjtu_style_footer_font_tl , - footer-font .initial:n = \zihao { -5 } , - page-number .cs_set:Np = \__sjtu_page:n #1 , - page-number .initial:n = { {#1} } + bookmark = \l__sjtu_page_bookmark_bool , + bookmark-text = \l__sjtu_page_bookmark_text_tl , + style = \l__sjtu_page_style_tl , + format = \l__sjtu_page_format_tl , + prefix = \l__sjtu_page_prefix_tl , + components = \l__sjtu_page_components_clist , + top-skip = \l__sjtu_page_top_skip , + bottom-skip = \l__sjtu_page_bottom_skip } -\keys_define:nn { sjtu / name } { - contents .tl_set:N = \contentsname , - listfigure .tl_set:N = \listfigurename , - listtable .tl_set:N = \listtablename , - figure .tl_set:N = \figurename , - table .tl_set:N = \tablename , - index .tl_set:N = \indexname , - appendix .tl_set:N = \appendixname , - proof .tl_set:N = \proofname , - bib .tl_set:N = \bibname , - figure* .tl_set:N = \l__sjtu_name_figure_aux_tl , - figure* .initial:n = { 图 } , - table* .tl_set:N = \l__sjtu_name_table_aux_tl , - table* .initial:n = { 表 } , - algorithm .tl_set:N = \l__sjtu_name_algorithm_tl , - algorithm .initial:n = { Algorithm } , - listalgorithm .tl_set:N = \l__sjtu_name_listalgorithm_tl , - listalgorithm .initial:n = { List~of~Algorithms } , - abbr .tl_set:N = \l__sjtu_name_abbr_tl , - abbr .initial:n = { Abbreviations } , - nom .tl_set:N = \l__sjtu_name_nom_tl , - nom .initial:n = { Nomenclature } , - summary .tl_set:N = \l__sjtu_name_summary_tl , - summary .initial:n = { Summary } , - ack .tl_set:N = \l__sjtu_name_ack_tl , - ack .initial:n = { Acknowledgements } , - resume .tl_set:N = \l__sjtu_name_resume_tl , - resume .initial:n = { Resume } , - digest .tl_set:N = \l__sjtu_name_digest_tl , - digest .initial:n = { Digest } , - achv .tl_set:N = \l__sjtu_name_achv_tl , - achv .initial:n = { List~of~Research~Achievements }, + \AssignTemplateKeys + \bool_if:NTF \g__sjtu_openright_bool + { \cleardoublepage } { \clearpage } + \bool_if:NT \l__sjtu_page_bookmark_bool + { \__sjtu_pdf_bookmark:nn { 0 } { \l__sjtu_page_bookmark_text_tl } } + \exp_args:No \thispagestyle { \l__sjtu_page_style_tl } + \__sjtu_vspace_r:N \l__sjtu_page_top_skip + \__sjtu_vspace:n { - \tex_parskip:D } + \__sjtu_vspace:n { - \tex_baselineskip:D } + \group_begin: + \l__sjtu_page_format_tl + \clist_map_inline:Nn \l__sjtu_page_components_clist + { \UseInstance { sjtu } { \l__sjtu_page_prefix_tl / ##1 } } + \group_end: + \__sjtu_vspace:N \l__sjtu_page_bottom_skip + \clearpage } -\file_input:n { sjtu-lang-thesis- \g__sjtu_lang_tl .cfg } +\cs_new:Npn \__sjtu_declare_component:nnn #1#2#3 + { \DeclareInstance { sjtu } {#1/#2} { component } {#3} } +\cs_new:Npn \__sjtu_declare_page:nn #1#2 + { \DeclareInstance { sjtu } {#1} { page } {#2} } \cs_new_protected:Npn \__sjtu_fontset_error:nn #1#2 { \msg_error:nnnn { sjtutex } { font-unavailable } {#1} {#2} } \msg_new:nnn { sjtutex } { font-unavailable } @@ -707,8 +473,12 @@ } \cs_new_protected:Nn \__sjtu_set_unimath_symbol: { - \cs_set_eq:NN \increment \upDelta - \cs_set_eq:NN \QED \blacksquare + \clist_map_inline:nn + { + { increment } { upDelta } , + { QED } { blacksquare } + } + { \__sjtu_cs_provide_eq:cc ##1 } } \tl_if_empty:NT \g__sjtu_math_font_tl { \tl_gset_eq:NN \g__sjtu_math_font_tl \g__sjtu_text_font_tl } @@ -773,6 +543,9 @@ \intcap\intcup\upint\lowint } } +\NewDocumentCommand \CJKrmfamily { } { \CJKfamily { \CJKrmdefault } } +\NewDocumentCommand \CJKsffamily { } { \CJKfamily { \CJKsfdefault } } +\NewDocumentCommand \CJKttfamily { } { \CJKfamily { \CJKttdefault } } \__sjtu_unicode_engine_case:nn { \xeCJK_declare_char_class:nn { CJK } @@ -783,6 +556,45 @@ { "24EA, "2460-"2473, "3251-"32BF, "25A1 } \ltjsetparameter { jacharrange = { +99 } } } +\keys_define:nn { sjtu / name } + { + contents .meta:nn = { ctex } { contentsname = {#1} } , + listfigure .meta:nn = { ctex } { listfigurename = {#1} } , + listtable .meta:nn = { ctex } { listtablename = {#1} } , + figure .meta:nn = { ctex } { figurename = {#1} } , + table .meta:nn = { ctex } { tablename = {#1} } , + index .meta:nn = { ctex } { indexname = {#1} } , + appendix .meta:nn = { ctex } { appendixname = {#1} } , + proof .meta:nn = { ctex } { proofname = {#1} } , + bib .meta:nn = { ctex } { bibname = {#1} } , + part .tl_set:N = \partname , + chapter .tl_set:N = \chaptername , + figure* .tl_set:N = \SJTU@figurename@aux , + figure* .initial:n = { 图 } , + table* .tl_set:N = \SJTU@tablename@aux , + table* .initial:n = { 表 } , + algorithm .tl_set:N = \SJTU@algorithmname , + algorithm .initial:n = { Algorithm } , + listalgorithm .tl_set:N = \SJTU@listalgorithmname , + listalgorithm .initial:n = { List~of~Algorithms } , + abbr .tl_set:N = \SJTU@abbrname , + abbr .initial:n = { Abbreviations } , + nom .tl_set:N = \SJTU@nomname , + nom .initial:n = { Nomenclature } , + ack .tl_set:N = \SJTU@ackname , + ack .initial:n = { Acknowledgements } , + resume .tl_set:N = \SJTU@resumename , + resume .initial:n = { Resume } , + digest .tl_set:N = \SJTU@digestname , + digest .initial:n = { Digest } , + achv .tl_set:N = \SJTU@achvname , + achv .initial:n = { List~of~Research~Achievements }, + } +\clist_map_inline:Nn \g__sjtu_lang_clist + { \file_input:n { sjtu-name-thesis- #1 .def } } +\clist_map_inline:nn + { title_page, declaration, abstract } + { \__sjtu_define_name:nv {#1} { c__sjtu_name_ #1 _ \g__sjtu_lang_tl _tl } } \geometry { top = 3.5 cm, @@ -795,29 +607,53 @@ footskip = 1.0 cm } \pagestyle { fancy } -\cs_new:Nn \__sjtu_thepage: { \thepage } \fancyhf { } -\bool_if:NTF \g__sjtu_twoside_bool +\keys_define:nn { sjtu / style } { - \fancyhead [ RE, LO ] - { \l__sjtu_style_header_font_tl \l__sjtu_info_subject_zh_tl } - \fancyhead [ RO, LE ] - { \l__sjtu_style_header_font_tl \__sjtu_nouppercase:n { \leftmark } } + header-font .tl_set:N = \l__sjtu_style_header_font_tl , + header-font .initial:n = \zihao { -5 } , + footer-font .tl_set:N = \l__sjtu_style_footer_font_tl , + footer-font .initial:n = \zihao { -5 } } +\fancyheadinit { \l__sjtu_style_header_font_tl } +\fancyfootinit { \l__sjtu_style_footer_font_tl } +\keys_define:nn { sjtu / style } { - \fancyhead [ L ] - { \l__sjtu_style_header_font_tl \l__sjtu_info_subject_zh_tl } - \fancyhead [ R ] - { - \l__sjtu_style_header_font_tl - \__sjtu_nouppercase:n { \leftmark } - } + header-uppercase .choice: , + header-uppercase / true .code:n = + { \cs_set_eq:NN \__sjtu_nouppercase:n \use:n } , + header-uppercase / false .code:n = + { \cs_set:Nn \__sjtu_nouppercase:n { \nouppercase {##1} } } , + header-uppercase .default:n = { true } , + header-uppercase .initial:n = { false } + } +\cs_generate_variant:Nn \__sjtu_nouppercase:n { V } +\cs_new:Nn \__sjtu_thepage: { \thepage } +\keys_define:nn { sjtu / style } + { + page-number .cs_set:Np = \__sjtu_page:n #1 , + page-number .initial:n = { {#1} } } -\fancyfoot [ C ] +\tl_set:Nn \l__sjtu_header_tl + { + { + \__sjtu_set_cjk_default_zh: \normalfont + \l__sjtu_info_subject_zh_tl + } + } +\tl_set:Nn \l__sjtu_leftmark_tl { \leftmark } +\tl_set:Nn \l__sjtu_rightmark_tl { \leftmark } +\bool_if:NTF \g__sjtu_twoside_bool { - \l__sjtu_style_footer_font_tl - \__sjtu_page:n { \__sjtu_thepage: } + \fancyhead [ LO, RE ] { \l__sjtu_header_tl } + \fancyhead [ LE ] { \__sjtu_nouppercase:V \l__sjtu_leftmark_tl } + \fancyhead [ RO ] { \__sjtu_nouppercase:V \l__sjtu_rightmark_tl } } + { + \fancyhead [ L ] { \l__sjtu_header_tl } + \fancyhead [ R ] { \__sjtu_nouppercase:V \l__sjtu_rightmark_tl } + } +\fancyfoot [ C ] { \__sjtu_page:n { \__sjtu_thepage: } } \cs_set:Npn \headrule { \hrule height 2.25 pt width \headwidth @@ -826,22 +662,6 @@ \skip_vertical:n { -3.75 pt } } \cs_new_eq:NN \ps@SJTU@null \prg_do_nothing: -\clist_map_inline:nn - { zh, en } - { - \cs_new:cpn { ps@SJTU@fund@ #1 } - { - \ps@empty - \cs_set:Npn \@oddfoot - { - \begin{minipage} { \textwidth } - \centering \zihao { - 5 } - \clist_use:cn { l__sjtu_info_fund_ #1 _clist } { \par } - \end{minipage} - } - \cs_set_eq:NN \@evenfoot \@oddfoot - } - } \RenewDocumentCommand \cleardoublepage { } { \clearpage @@ -866,7 +686,7 @@ afterskip = 18 bp , lofskip = \c_zero_skip , lotskip = \c_zero_skip , - format = \zihao { 3 } \bfseries \heiti \centering , + format = \zihao { 3 } \bfseries \CJKsffamily \centering , nameformat = , titleformat = , aftername = \quad , @@ -876,14 +696,14 @@ { beforeskip = 24 bp , afterskip = 6 bp , - format = \zihao { 4 } \bfseries \heiti , + format = \zihao { 4 } \bfseries \CJKsffamily , afterindent = true } \ctex_set:nn { subsection } { beforeskip = 12 bp , afterskip = 6 bp , - format = \zihao { -4 } \bfseries \heiti , + format = \zihao { -4 } \bfseries \CJKsffamily , afterindent = true } \ctex_set:nn { subsubsection } @@ -921,24 +741,31 @@ { \SJTU@head* {#1} [#2] } \cs_new:Npn \__sjtu_head_auxb_s:nn #1#2 { \SJTU@head* [#1] {#2} } -\cs_generate_variant:Nn \__sjtu_head_aux:n { V } -\cs_generate_variant:Nn \__sjtu_head_aux_s:n { V } -\cs_generate_variant:Nn \__sjtu_head_auxa_s:nn { Vn, VV } -\cs_generate_variant:Nn \__sjtu_head_auxb_s:nn { Vo } +\cs_generate_variant:Nn \__sjtu_head_auxa_s:nn { xn, xv } +\cs_generate_variant:Nn \__sjtu_head_auxb_s:nn { nx } \cs_new_eq:NN \__sjtu_pdf_bookmark:nn \use_none:nn \cs_new_eq:NN \__sjtu_phantom_section: \prg_do_nothing: -\ctex_if_autoindent_touched:F - { \ctex_set:n { autoindent = true } } -\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd } -\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd } -\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd } \setlist { nosep } \tl_set:Nn \textfraction { 0.15 } \tl_set:Nn \topfraction { 0.85 } \tl_set:Nn \bottomfraction { 0.65 } \tl_set:Nn \floatpagefraction { 0.60 } +\keys_define:nn { sjtu / style } + { + float-font .tl_set:N = \SJTU@style@float@font , + float-font .initial:n = \zihao { 5 } \fixedlineskip { 15.6 bp } + } \ctex_patch_cmd:Nnn \@floatboxreset { \normalsize } { \SJTU@style@float@font } +\keys_define:nn { sjtu / style } + { + caption-font .code:n = + { \DeclareCaptionFont { SJTU@font } {#1} } , + caption-font .initial:n = \zihao { 5 } \bfseries , + subcaption-font .code:n = + { \DeclareCaptionFont { SJTU@sub@font } {#1} } , + subcaption-font .initial:n = \zihao { 5 } \normalfont + } \DeclareCaptionLabelSeparator { enskip } { \enskip } \captionsetup { @@ -954,11 +781,18 @@ } \DeclareCaptionOption { aux-names } [ ] { - \tl_set:Nn \figurename { \l__sjtu_name_figure_aux_tl } - \tl_set:Nn \tablename { \l__sjtu_name_table_aux_tl } + \tl_set:Nn \figurename { \SJTU@figurename@aux } + \tl_set:Nn \tablename { \SJTU@tablename@aux } } \captionsetup [ bi-second ] { aux-names } -\NewDocumentCommand \SJTUcounterwithin +\keys_define:nn { sjtu / style } + { + float-num-sep .tl_set:N = \l__sjtu_style_fl_num_sep_tl , + float-num-sep .initial:n = { -- } , + equation-num-sep .tl_set:N = \l__sjtu_style_eq_num_sep_tl , + equation-num-sep .initial:n = { -- } + } +\NewDocumentCommand \SJTU@counterwithin { s O{ \l__sjtu_style_fl_num_sep_tl } O{ \arabic } m m } { \@ifbothcounters {#4} {#5} @@ -971,12 +805,9 @@ } } } -\cs_set:Npn \thefigure - { \thechapter \l__sjtu_style_fl_num_sep_tl \arabic { figure } } -\cs_set:Npn \thetable - { \thechapter \l__sjtu_style_fl_num_sep_tl \arabic { table } } -\cs_set:Npn \theequation - { \thechapter \l__sjtu_style_eq_num_sep_tl \arabic { equation } } +\SJTU@counterwithin { figure } { chapter } +\SJTU@counterwithin { table } { chapter } +\SJTU@counterwithin [ \l__sjtu_style_eq_num_sep_tl ] { equation } { chapter } \cs_new_protected:Nn \__sjtu_counter_without_chapter: { \counterwithout { section } { chapter } @@ -986,124 +817,218 @@ \counterwithout { table } { chapter } \setcounter { table } { 0 } } -\cs_new_protected:Nn \__sjtu_make_fnmark: - { \hbox:n { \@thefnmark } } +\cs_set_eq:NN \__sjtu_makefnmark_plain: \@makefnmark +\cs_set_eq:NN \__sjtu_thefootnote_plain: \thefootnote +\cs_set_eq:NN \__sjtu_thempfootnote_plain: \thempfootnote +\cs_new:Npn \__sjtu_footnote_number:N #1 + { + \int_compare:nNnTF {#1} < { 21 } + { \__sjtu_unicode_char:n { \int_eval:n { "2460 - 1 + #1 } } } + { + \int_compare:nNnTF {#1} < { 36 } + { \__sjtu_unicode_char:n { \int_eval:n { "3251 - 21 + #1 } } } + { + \int_compare:nNnTF {#1} < { 51 } + { \__sjtu_unicode_char:n { \int_eval:n { "32B1 - 36 + #1 } } } + { \msg_warning:nn { sjtutex } { too-many-footnotes } } + } + } + } +\msg_new:nnn { sjtutex } { too-many-footnotes } + { Too~ many~ footnotes. } +\cs_new:Nn \__sjtu_makefnmark_circled: { \hbox:n { \@thefnmark } } +\keys_define:nn { sjtu / style } + { + fnmark-font .choice: , + fnmark-font / haranoaji .code:n = + { + \__sjtu_engine_case:nn + { \tl_set_eq:NN \l__sjtu_style_fnmark_font_tl \c_empty_tl } + { + \tl_set:Nn \l__sjtu_style_fnmark_font_tl + { + \CJKfontspec { HaranoAjiMincho } + [ + Extension = .otf , + UprightFont = *-Regular , + BoldFont = *-Bold + ] + } + } + } , + fnmark-font / unknown .tl_set:N = \l__sjtu_style_fnmark_font_tl , + fnmark-font .initial:V = \c_empty_tl + } +\cs_new:Nn \__sjtu_thefootnote_circled: + { { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@footnote } } +\cs_new:Nn \__sjtu_thempfootnote_circled: + { { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@mpfootnote } } +\keys_define:nn { sjtu / style } + { + fnmark-style .choice: , + fnmark-style / plain .code:n = + { + \cs_set_eq:NN \__sjtu_makefnmark: \__sjtu_makefnmark_plain: + \cs_set_eq:NN \thefootnote \__sjtu_thefootnote_plain: + \cs_set_eq:NN \thempfootnote \__sjtu_thempfootnote_plain: + } , + fnmark-style / circled .code:n = + { + \cs_set_eq:NN \__sjtu_makefnmark: \__sjtu_makefnmark_circled: + \cs_set_eq:NN \thefootnote \__sjtu_thefootnote_circled: + \cs_set_eq:NN \thempfootnote \__sjtu_thempfootnote_circled: + } + } \ctex_at_end_preamble:n { \cs_set_eq:NN \__sjtu_orig_make_fntext:n \@makefntext \cs_set:Npn \@makefntext #1 { \group_begin: - \cs_set_eq:NN \@makefnmark \__sjtu_make_fnmark: + \cs_set_eq:NN \@makefnmark \__sjtu_makefnmark: \__sjtu_orig_make_fntext:n {#1} \group_end: } } -\cs_new:Npn \__sjtu_footnote_number:N #1 +\cs_new:Npn \__sjtu_info_keys_define:n #1 { - \int_compare:nNnTF {#1} < { 21 } - { \__sjtu_unicode_char:n { \int_eval:n { "2460 - 1 + #1 } } } + \clist_map_inline:nn { - \int_compare:nNnTF {#1} < { 36 } - { \__sjtu_unicode_char:n { \int_eval:n { "3251 - 21 + #1 } } } + title, display_title, subject, author, date, + supervisor, assoc_supervisor, department, + co_supervisor, major, degree + } + { \tl_new:c { l__sjtu_info_ ##1 _ #1 _tl } } + \clist_map_inline:nn + { keywords, fund } + { \clist_new:c { l__sjtu_info_ ##1 _ #1 _clist } } + \keys_define:nn { sjtu } + { info / #1 .meta:nn = { sjtu / info / #1 } {##1} } + \keys_define:nn { sjtu / info } + { #1 .meta:nn = { sjtu / info / #1 } {##1} } + \keys_define:nn { sjtu / info / #1 } + { + title .code:n = { - \int_compare:nNnTF {#1} < { 51 } - { \__sjtu_unicode_char:n { \int_eval:n { "32B1 - 36 + #1 } } } - { \msg_warning:nn { sjtutex } { too-many-footnotes } } - } + \tl_set:cn { l__sjtu_info_title_ #1 _tl } {##1} + \tl_if_empty:cT { l__sjtu_info_display_title_ #1 _tl } + { \tl_set:cn { l__sjtu_info_display_title_ #1 _tl } {##1} } + } , + display-title .tl_set:c = l__sjtu_info_display_title_ #1 _tl , + subject .tl_set:c = l__sjtu_info_subject_ #1 _tl , + keywords .clist_set:c = l__sjtu_info_keywords_ #1 _clist , + author .tl_set:c = l__sjtu_info_author_ #1 _tl , + id .meta:nn = { sjtu / info } { id = {##1} } , + supervisor .tl_set:c = l__sjtu_info_supervisor_ #1 _tl , + assoc-supervisor .tl_set:c = l__sjtu_info_assoc_supervisor_ #1 _tl , + co-supervisor .tl_set:c = l__sjtu_info_co_supervisor_ #1 _tl , + degree .tl_set:c = l__sjtu_info_degree_ #1 _tl , + department .tl_set:c = l__sjtu_info_department_ #1 _tl , + major .tl_set:c = l__sjtu_info_major_ #1 _tl , + fund .clist_set:c = l__sjtu_info_fund_ #1 _clist , + date .meta:nn = { sjtu / info } { date = {##1} } , + display-date .tl_set:c = l__sjtu_info_date_ #1 _tl , } } -\msg_new:nnn { sjtutex } { too-many-footnotes } - { Too~ many~ footnotes. } -\cs_set:Npn \thefootnote - { - \hbox:n { } - { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@footnote } - } -\cs_set:Npn \thempfootnote - { - \hbox:n { } - { \l__sjtu_style_fnmark_font_tl \__sjtu_footnote_number:N \c@mpfootnote } - } -\DeclareObjectType { sjtu } { 0 } -\DeclareTemplateInterface { sjtu } { component } { 0 } +\tl_new:N \l__sjtu_info_id_zh_tl +\keys_define:nn { sjtu / info } + { id .tl_set:N = \l__sjtu_info_id_zh_tl } +\clist_set:Nn \l__sjtu_info_supervisors_clist { supervisor } +\ctex_at_end_preamble:n { - format : tokenlist = \c_empty_tl , - content : tokenlist = \c_empty_tl , - bottom-skip : skip = \c_zero_skip , - align : choice { left, right, center, normal } = center + \bool_if:NT \g__sjtu_review_bool + { + \clist_map_inline:Nn \g__sjtu_lang_clist + { + \clist_map_inline:nn + { author, supervisor, assoc_supervisor, co_supervisor } + { \tl_clear:c { l__sjtu_info_ ##1 _ #1 _tl } } + \clist_clear:c { l__sjtu_info_fund_ #1 _clist } + } + \tl_clear:N \l__sjtu_info_id_zh_tl + } } -\DeclareTemplateCode { sjtu } { component } { 0 } +\clist_map_inline:Nn \g__sjtu_lang_clist + { \file_input:n { sjtu-lang-thesis- #1 .def } } +\file_input:n { sjtu-scheme- \g__sjtu_lang_tl .def } +\keys_define:nn { sjtu / info } { - format = \l__sjtu_component_format_tl , - content = \l__sjtu_component_content_tl , - bottom-skip = \l__sjtu_component_bottom_skip , - align = + date .code:n = { - left = - \cs_set_eq:NN \l__sjtu_component_align: \raggedright , - right = - \cs_set_eq:NN \l__sjtu_component_align: \raggedleft , - center = - \cs_set_eq:NN \l__sjtu_component_align: \centering , - normal = - \cs_set_eq:NN \l__sjtu_component_align: \prg_do_nothing: + \regex_match:neTF { \d+-\d+-\d+ } {#1} + { + \clist_map_inline:Nn \g__sjtu_lang_clist + { + \tl_set:cx { l__sjtu_info_date_ ##1 _tl } + { \exp_last_unbraced:ce { __sjtu_date_aux_ ##1 :w } #1 \q_stop } + } + } + { + \regex_match:neT { \d+-\d+ } {#1} + { + \clist_map_inline:Nn \g__sjtu_lang_clist + { + \tl_set:cx { l__sjtu_info_date_ ##1 _tl } + { \exp_last_unbraced:ce { __sjtu_date_aux_short_ ##1 :w } #1 \q_stop } + } + } + } + } , + date .initial:x = + { + \int_to_arabic:n { \c_sys_year_int } - + \int_to_arabic:n { \c_sys_month_int } - + \int_to_arabic:n { \c_sys_day_int } } } +\tl_set:Nv \today { l__sjtu_info_date_ \g__sjtu_lang_tl _tl } +\__sjtu_engine_case:nnn { - \AssignTemplateKeys - \group_begin: - \l__sjtu_component_align: - \l__sjtu_component_format_tl - \l__sjtu_component_content_tl - \par - \group_end: - \__sjtu_vspace:N \l__sjtu_component_bottom_skip + \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 + { + \mode_leave_vertical: + \group_begin: + \bool_set_false:N \l__sjtu_tmpa_bool + \cs_set_eq:NN \SJTU@CJK@filltwosidesSymbol \CJKsymbol + \cs_set:Npn \CJKsymbol ##1 + { + \bool_if:NTF \l__sjtu_tmpa_bool + { \hfil \SJTU@CJK@filltwosidesSymbol { ##1 } } + { + \SJTU@CJK@filltwosidesSymbol { ##1 } + \bool_set_true:N \l__sjtu_tmpa_bool + } + } + \hbox_to_wd:nn {#1} {#2} + \group_end: + } } -\DeclareTemplateInterface { sjtu } { page } { 0 } { - bookmark : boolean = false , - bookmark-text : tokenlist = \c_empty_tl , - style : tokenlist = empty , - format : tokenlist = \linespread { 1 } \selectfont , - prefix : tokenlist , - components : commalist , - top-skip : skip = \c_zero_skip , - bottom-skip : skip = \c_zero_skip + \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 + { + \mode_leave_vertical: + \group_begin: + \cs_set:Npn \CJKglue + { \skip_horizontal:n { \c_zero_dim plus 1 filll } } + \hbox_to_wd:nn {#1} {#2} + \group_end: + } } -\DeclareTemplateCode { sjtu } { page } { 0 } { - bookmark = \l__sjtu_page_bookmark_bool , - bookmark-text = \l__sjtu_page_bookmark_text_tl , - style = \l__sjtu_page_style_tl , - format = \l__sjtu_page_format_tl , - prefix = \l__sjtu_page_prefix_tl , - components = \l__sjtu_page_components_clist , - top-skip = \l__sjtu_page_top_skip , - bottom-skip = \l__sjtu_page_bottom_skip + \cs_new_protected:Npn \__sjtu_cjk_spread_box:nn #1#2 + { + \mode_leave_vertical: + \group_begin: + \ltjsetparameter { kanjiskip = { \c_zero_dim plus 1 filll } } + \hbox_to_wd:nn {#1} {#2} + \group_end: + } } +\cs_new_protected:Npn \__sjtu_left_aligned_box:nn #1#2 { - \AssignTemplateKeys - \bool_if:NTF \g__sjtu_openright_bool - { \cleardoublepage } { \clearpage } - \bool_if:NT \l__sjtu_page_bookmark_bool - { \__sjtu_pdf_bookmark:nn { 0 } { \l__sjtu_page_bookmark_text_tl } } - \exp_args:No \thispagestyle { \l__sjtu_page_style_tl } - \__sjtu_vspace_r:N \l__sjtu_page_top_skip - \__sjtu_vspace:n { - \tex_parskip:D } - \__sjtu_vspace:n { - \tex_baselineskip:D } - \group_begin: - \l__sjtu_page_format_tl - \clist_map_inline:Nn \l__sjtu_page_components_clist - { \UseInstance { sjtu } { \l__sjtu_page_prefix_tl / ##1 } } - \group_end: - \__sjtu_vspace:N \l__sjtu_page_bottom_skip - \clearpage + \mode_leave_vertical: + \hbox_to_wd:nn {#1} { #2 \hfil } } -\cs_new:Npn \__sjtu_declare_component:nnn #1#2#3 - { \DeclareInstance { sjtu } {#1/#2} { component } {#3} } -\cs_new:Npn \__sjtu_declare_page:nn #1#2 - { \DeclareInstance { sjtu } {#1} { page } {#2} } -\cs_new:Npn \__sjtu_title_page_info:nnn #1#2#3 +\cs_new:Npn \__sjtu_title_page_info_i:nnn #1#2#3 { \group_begin: \cs_set:Npn \l__sjtu_info_output_format:NNN ##1##2##3 {#3} @@ -1131,132 +1056,35 @@ } \group_end: } -\cs_generate_variant:Nn \__sjtu_title_page_info:nnn { nxn } -\clist_map_inline:nn - { - { logo } - { - content = - { - \includegraphics [ width = 3 cm ] - { sjtu-vi-badge- \l__sjtu_style_title_logo_color_tl .pdf } - } - }, - { subject } - { - format = \zihao { -2 } \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_subject_zh_tl , - bottom-skip = \c_zero_dim plus 2 fill - }, - { title } - { - format = \zihao { 2 } \bfseries \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_display_title_zh_tl , - bottom-skip = \c_zero_dim plus 3 fill - }, - { info } - { - format = \zihao { 4 } \fixedlineskip { 31.2 bp } , - content = - { - \__sjtu_title_page_info:nxn { zh } - { - author, - id, - supervisor, - \tl_if_empty:NF \l__sjtu_info_assoc_supervisor_zh_tl - { assoc_supervisor }, - \tl_if_empty:NF \l__sjtu_info_co_supervisor_zh_tl - { co_supervisor }, - department, - major, - \int_compare:nNnF { \g__sjtu_thesis_type_int } = { 1 } - { degree } - } - { - \__sjtu_cjk_spread_box:nn { 5 em } { \heiti #1 } - \c__sjtu_name_info_sep_zh_tl - \__sjtu_left_aligned_box:nn {#2} {#3} - } - } , - bottom-skip = 31.2 bp - }, - { date } - { - format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_date_zh_tl - } - } - { - \__sjtu_declare_component:nnn { title / zh } #1 - } -\__sjtu_declare_page:nn { title / zh } - { - bookmark = true , - bookmark-text = \c__sjtu_name_title_page_tl , - style = SJTU@fund@zh , - prefix = title / zh , - components = { logo, subject, title, info, date } - } -\clist_map_inline:nn - { - { subject } - { - format = \zihao { 4 } \bfseries \fixedlineskip { 31.2 bp } , - content = \l__sjtu_info_subject_en_tl , - bottom-skip = \c_zero_dim plus 2 fill - }, - { title } - { - format = \zihao { -2 } \bfseries \fixedlineskip { 31.2 bp } , - content = \MakeUppercase \l__sjtu_info_display_title_en_tl , - bottom-skip = \c_zero_dim plus 2 fill - }, - { info } - { - format = \zihao { 3 } \fixedlineskip { 31.2 bp } , - content = - { - \__sjtu_title_page_info:nxn { en } - { - author, supervisor, - \tl_if_empty:NF \l__sjtu_info_assoc_supervisor_en_tl - { assoc_supervisor }, - \tl_if_empty:NF \l__sjtu_info_co_supervisor_en_tl - { co_supervisor } - } - { { \bfseries #1 \c__sjtu_name_info_sep_en_tl } {#3} } - } , - bottom-skip = \c_zero_dim plus 3 fill - }, - { date } - { - format = \zihao { 3 } \fixedlineskip { 31.2 bp } , - content = - { - \l__sjtu_info_department_en_tl - \skip_vertical:N \c_zero_skip - \c__sjtu_name_univ_en_tl - \skip_vertical:N \c_zero_skip - \c__sjtu_name_address_en_tl - \skip_vertical:N \c_zero_skip - \l__sjtu_info_date_en_tl - } - }, - } +\cs_new:Npn \__sjtu_title_page_info_ii:n #1 { - \__sjtu_declare_component:nnn { title / en } #1 + \tl_use:c { l__sjtu_info_department_ #1 _tl } + \skip_vertical:N \c_zero_skip + \tl_use:c { c__sjtu_name_univ_ #1 _tl } + \skip_vertical:N \c_zero_skip + \tl_use:c { c__sjtu_name_address_ #1 _tl } + \skip_vertical:N \c_zero_skip + \tl_use:c { l__sjtu_info_date_ #1 _tl } } -\__sjtu_declare_page:nn { title / en } +\cs_generate_variant:Nn \__sjtu_title_page_info_i:nnn { nxn } +\keys_define:nn { sjtu / style } { - style = SJTU@fund@en , - prefix = title / en , - components = { subject, title, info, date } + title-logo-color .choice: , + title-logo-color .choices:nn = + { red, blue, black } + { \tl_set_eq:NN \l__sjtu_style_title_logo_color_tl \l_keys_choice_tl } , + title-logo-color .initial:n = { red } } \RenewDocumentCommand \maketitle { } { - \UseInstance { sjtu } { title / zh } - \UseInstance { sjtu } { title / en } + \clist_map_inline:nn + { assoc_supervisor, co_supervisor } + { + \tl_if_empty:cF { l__sjtu_info_ ##1 _zh_tl } + { \clist_put_right:Nn \l__sjtu_info_supervisors_clist {##1} } + } + \clist_map_inline:Nn \g__sjtu_lang_clist + { \UseInstance { sjtu } { title / ##1 } } } \cs_new_protected:Npn \__sjtu_signature:N #1 { @@ -1333,7 +1161,8 @@ \__sjtu_declare_page:nn { copyright } { bookmark = true , - bookmark-text = \c__sjtu_name_decl_tl , + bookmark-text = \c__sjtu_name_declaration_tl , + format = \linespread { 1 } \__sjtu_set_language_zh: , prefix = copyright , components = { @@ -1357,7 +1186,7 @@ { \bool_if:NTF \g__sjtu_openright_bool { \cleardoublepage } { \clearpage } - \__sjtu_pdf_bookmark:nn { 0 } { \c__sjtu_name_decl_tl } + \__sjtu_pdf_bookmark:nn { 0 } { \c__sjtu_name_declaration_tl } \includepdf {#1} } { @@ -1367,26 +1196,48 @@ } } } -\cs_new:Nn \__sjtu_output_keywords:Nnn +\bool_new:N \l__sjtu_abstract_bookmark_bool +\DeclareDocumentEnvironment { abstract } { O{ zh } +b } { - \clist_if_empty:NF #1 + \__sjtu_if_lang_valid:nTF {#1} { - \par \mode_leave_vertical: \par \noindent - { \bfseries #2 } \clist_use:Nn #1 {#3} + \use:c { __sjtu_set_language_ #1 : } + \ctex_set:nn { chapter } { format += \sffamily } + \bool_if:NTF \l__sjtu_abstract_bookmark_bool + { + \__sjtu_head_auxa_s:xn + { + \exp_not:N \MakeUppercase + { \exp_not:v { c__sjtu_name_abstract_ #1 _tl } } + } + { } + } + { + \__sjtu_head_auxa_s:xv + { + \exp_not:N \MakeUppercase + { \exp_not:v { c__sjtu_name_abstract_ #1 _tl } } + } + { c__sjtu_name_abstract_tl } + \bool_gset_true:N \l__sjtu_abstract_bookmark_bool + } + #2 + \clist_if_empty:cF { l__sjtu_info_keywords_ #1 _clist } + { + \par \mode_leave_vertical: \par \noindent + { + \bfseries + \tl_use:c { c__sjtu_name_keywords_ #1 _tl } + \tl_use:c { c__sjtu_name_info_sep_ #1 _tl } + } + \clist_use:cv { l__sjtu_info_keywords_ #1 _clist } + { c__sjtu_name_item_sep_ #1 _tl } + } } - } -\DeclareDocumentEnvironment { abstract } { } - { \__sjtu_head_auxa_s:VV \c__sjtu_name_abstract_zh_tl \c__sjtu_name_abstract_tl } - { - \__sjtu_output_keywords:Nnn \l__sjtu_info_keywords_zh_clist - { \c__sjtu_name_keywords_zh_tl } { \c__sjtu_name_item_sep_zh_tl } - } + { \msg_error:nnn { sjtutex } { lang-validation } {#1} } + } { } \DeclareDocumentEnvironment { abstract* } { } - { \__sjtu_head_auxa_s:Vn \c__sjtu_name_abstract_en_tl { } } - { - \__sjtu_output_keywords:Nnn \l__sjtu_info_keywords_en_clist - { \c__sjtu_name_keywords_en_tl } { \c__sjtu_name_item_sep_en_tl } - } + { \abstract [ en ] } { \endabstract } \DeclareDocumentCommand \tableofcontents { } { \__sjtu_head_aux_s:n { \contentsname } @@ -1414,34 +1265,32 @@ } \ctex_at_end_preamble:n { \__sjtu_update_cft_presnum: } -\NewDocumentEnvironment { abbreviation } { } +\NewDocumentEnvironment { abbreviation } { O{ \SJTU@abbrname } } { - \__sjtu_head_aux:V \l__sjtu_name_abbr_tl + \chapter {#1} \tl_clear:N \SJTU@style@float@font } { } -\NewDocumentEnvironment { abbreviation* } { } +\NewDocumentEnvironment { abbreviation* } { O{ \SJTU@abbrname } } { - \__sjtu_head_aux_s:V \l__sjtu_name_abbr_tl + \__sjtu_head_aux_s:n {#1} \tl_clear:N \SJTU@style@float@font } { } -\NewDocumentEnvironment { nomenclature } { } +\NewDocumentEnvironment { nomenclature } { O{ \SJTU@nomname } } { - \__sjtu_head_aux:V \l__sjtu_name_nom_tl + \chapter {#1} \tl_clear:N \SJTU@style@float@font } { } -\NewDocumentEnvironment { nomenclature* } { } +\NewDocumentEnvironment { nomenclature* } { O{ \SJTU@nomname } } { - \__sjtu_head_aux_s:V \l__sjtu_name_nom_tl + \__sjtu_head_aux_s:n {#1} \tl_clear:N \SJTU@style@float@font } { } -\NewDocumentEnvironment { summary } { } - { \__sjtu_head_aux:V \l__sjtu_name_summary_tl } { } -\NewDocumentEnvironment { acknowledgements } { +b } +\NewDocumentEnvironment { acknowledgements } { O{ \SJTU@ackname } +b } { \bool_if:NF \g__sjtu_review_bool { - \__sjtu_head_aux:V \l__sjtu_name_ack_tl - #1 + \__sjtu_head_aux:n {#1} + #2 } } { } \newcounter { SJTU@bib } @@ -1449,11 +1298,24 @@ { \cs_if_exist_use:N \bibfont \list - { \@biblabel { \arabic{ SJTU@bib } } } { - \__sjtu_dim_set_to_wd:Nn \labelwidth { \@biblabel {#1} } - \dim_set_eq:NN \leftmargin \labelwidth - \dim_add:Nn \leftmargin { \labelsep } + \tl_if_blank:nTF {#1} + { \hfill } + { \@biblabel { \arabic{ SJTU@bib } } } + } + { + \tl_if_blank:nTF {#1} + { + \dim_if_exist:NTF \bibhang + { \dim_set_eq:NN \leftmargin \bibhang } + { \dim_set:Nn \leftmargin { 1 em } } + \dim_set:Nn \itemindent { - \leftmargin } + } + { + \__sjtu_dim_set_to_wd:Nn \labelwidth { \@biblabel {#1} } + \dim_set_eq:NN \leftmargin \labelwidth + \dim_add:Nn \leftmargin { \labelsep } + } \dim_if_exist:NTF \bibitemsep { \dim_set_eq:NN \itemsep \bibitemsep @@ -1485,10 +1347,20 @@ } \msg_new:nnn { sjtutex } { empty-environment } { Empty~ `#1'~ environment. } -\NewDocumentEnvironment { achievements } { } - { \__sjtu_head_aux:V \l__sjtu_name_achv_tl } { } +\bool_new:N \l__sjtu_achievements_bool +\NewDocumentEnvironment { achievements } { O{ \SJTU@achvname } } + { + \__sjtu_head_aux:n {#1} + \setcounter { SJTU@bib } { 0 } + \bool_set_true:N \l__sjtu_achievements_bool + } { } \NewDocumentEnvironment { bibliolist } { m +b } { + \bool_if:NF \l__sjtu_achievements_bool + { + \msg_error:nnnn { sjtutex } { environment-validation } + { bibliolist } { achievements } + } \bool_if:NF \g__sjtu_review_bool { \cs_set:Npn \@noitemerr { } @@ -1499,6 +1371,11 @@ } { } \NewDocumentEnvironment { bibliolist* } { m +b } { + \bool_if:NF \l__sjtu_achievements_bool + { + \msg_error:nnnn { sjtutex } { environment-validation } + { bibliolist* } { achievements } + } \bool_if:NT \g__sjtu_review_bool { \cs_set:Npn \@noitemerr { } @@ -1507,29 +1384,83 @@ \end { @bibliolist } } } { } -\NewDocumentEnvironment { resume } { +b } +\msg_new:nnn { sjtutex } { environment-validation } + { `#1'~ is~ only~ valid~ in~ `#2'~ environment. } +\NewDocumentEnvironment { resume } { O{ \SJTU@resumename } +b } { \bool_if:NF \g__sjtu_review_bool { - \__sjtu_head_aux:V \l__sjtu_name_resume_tl - #1 + \__sjtu_head_aux:n {#1} + #2 } } { } -\NewDocumentEnvironment { digest } { +b } +\NewDocumentEnvironment { digest } { O{ en } +b } { - \AtEndDocument + \__sjtu_if_lang_valid:nTF {#1} { - \bool_if:NTF \g__sjtu_openright_bool - { \cleardoublepage } { \clearpage } - \pagenumbering { roman } - \cs_gset:Nn \__sjtu_thepage: { \arabic { page } } - \cs_gset_eq:NN \addcontentsline \use_none:nnn - \__sjtu_counter_without_chapter: - \__sjtu_head_auxb_s:Vo \l__sjtu_name_digest_tl - { \exp_args:NV \MakeUppercase \l__sjtu_info_title_aux_tl } - #1 + \AtEndDocument + { + \use:c { __sjtu_set_language_ #1 : } + \bool_if:NTF \g__sjtu_openright_bool + { \cleardoublepage } { \clearpage } + \pagenumbering { roman } + \cs_gset:Nn \__sjtu_thepage: { \arabic { page } } + \cs_gset_eq:NN \addcontentsline \use_none:nnn + \__sjtu_counter_without_chapter: + \__sjtu_head_auxb_s:nx { \SJTU@digestname } + { + \exp_not:N \MakeUppercase + { \exp_not:v { l__sjtu_info_title_ #1 _tl } } + } + #2 + } } + { \msg_error:nnn { sjtutex } { lang-validation } {#1} } } { } +\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } +\keys_define:nn { sjtu } + { + style .meta:nn = { sjtu / style } {#1} , + info .meta:nn = { sjtu / info } {#1} , + name .meta:nn = { sjtu / name } {#1} + } +\keys_define:nn { sjtu / info } + { + title .meta:n = { zh / title = {#1} } , + title* .meta:n = { en / title = {#1} } , + display-title .meta:n = { zh / display-title = {#1} } , + display-title* .meta:n = { en / display-title = {#1} } , + subject .meta:n = { zh / subject = {#1} } , + subject* .meta:n = { en / subject = {#1} } , + keywords .meta:n = { zh / keywords = {#1} } , + keywords* .meta:n = { en / keywords = {#1} } , + author .meta:n = { zh / author = {#1} } , + author* .meta:n = { en / author = {#1} } , + supervisor .meta:n = { zh / supervisor = {#1} } , + supervisor* .meta:n = { en / supervisor = {#1} } , + assoc-supervisor .meta:n = { zh / assoc-supervisor = {#1} } , + assoc-supervisor* .meta:n = { en / assoc-supervisor = {#1} } , + co-supervisor .meta:n = { zh / co-supervisor = {#1} } , + co-supervisor* .meta:n = { en / co-supervisor = {#1} } , + degree .meta:n = { zh / degree = {#1} } , + degree* .meta:n = { en / degree = {#1} } , + department .meta:n = { zh / department = {#1} } , + department* .meta:n = { en / department = {#1} } , + major .meta:n = { zh / major = {#1} } , + major* .meta:n = { en / major = {#1} } , + fund .meta:n = { zh / fund = {#1} } , + fund* .meta:n = { en / fund = {#1} } , + display-date .meta:n = { zh / date = {#1} } , + display-date* .meta:n = { en / date = {#1} } + } +\keys_define:nn { sjtu / name } + { + abbreviation .meta:n = { abbr = {#1} } , + nomenclature .meta:n = { nom = {#1} } , + acknowledgements .meta:n = { ack = {#1} } , + publications .meta:n = { achv = {#1} } , + achievements .meta:n = { achv = {#1} } + } \ctex_at_end_package:nn { hyperref } { \hypersetup @@ -1564,10 +1495,10 @@ { \hypersetup { - pdftitle = \l__sjtu_info_title_zh_tl, - pdfsubject = \l__sjtu_info_subject_zh_tl, - pdfkeywords = \l__sjtu_info_keywords_zh_clist, - pdfauthor = \l__sjtu_info_author_zh_tl + pdftitle = \l__sjtu_info_title_zh_tl , + pdfauthor = \l__sjtu_info_author_zh_tl , + pdfsubject = \l__sjtu_info_subject_zh_tl , + pdfkeywords = \l__sjtu_info_keywords_zh_clist } } } @@ -1597,6 +1528,7 @@ } \ctex_at_end_package:nn { amsthm } { + \__sjtu_cs_provide_eq:NN \QED \openbox \cs_if_exist:NT \__sjtu_save_openbox: { \cs_set_eq:NN \openbox \__sjtu_save_openbox: } \tl_set:Nn \qedsymbol { \ensuremath { \QED } } @@ -1608,21 +1540,22 @@ \item [ \skip_horizontal:N \labelsep - \bfseries \heiti #1 \@addpunct { \enskip } + \bfseries \CJKsffamily #1 \@addpunct { \enskip } ] \ignorespaces } { \popQED \endtrivlist \legacy_if_set_false:n { @endpe } } \newtheoremstyle { sjtu } - { } { } { \normalfont } { } { \bfseries \heiti } { } { \ccwd } { } + { } { } { \normalfont } { } { \bfseries \CJKsffamily } { } { \ccwd } { } \theoremstyle { sjtu } \__sjtu_new_theorems: } \ctex_at_end_package:nn { ntheorem } { - \theoremheaderfont { \bfseries \heiti } - \theorembodyfont { \normalfont } - \theoremseparator { \enskip } + \__sjtu_cs_provide_eq:NN \QED \c_empty_tl + \theoremheaderfont { \bfseries \CJKsffamily } + \theorembodyfont { \normalfont } + \theoremseparator { \enskip } \theoremsymbol { \ensuremath { \QED } } \qedsymbol { \ensuremath { \QED } } \newtheorem* { proof } { \proofname } @@ -1654,8 +1587,8 @@ } \ctex_at_end_package:nn { algorithm } { - \tl_set:Nn \fname@algorithm { \l__sjtu_name_algorithm_tl } - \tl_set:Nn \listalgorithmname { \l__sjtu_name_listalgorithm_tl } + \tl_set:Nn \fname@algorithm { \SJTU@algorithmname } + \tl_set:Nn \listalgorithmname { \SJTU@listalgorithmname } \__sjtu_newlistof:nnnnn { algorithm } { alg } { algorithm } { \fname@algorithm } { \listalgorithmname } } @@ -1664,9 +1597,9 @@ \ctex_at_end_package:nn { algorithm2e } { \cs_set_eq:NN \@chapter \__sjtu_save_chapter:w - \SetAlgorithmName { \l__sjtu_name_algorithm_tl } - { \l__sjtu_name_algorithm_tl } - { \l__sjtu_name_listalgorithm_tl } + \SetAlgorithmName { \SJTU@algorithmname } + { \SJTU@algorithmname } + { \SJTU@listalgorithmname } \SetAlgoCaptionSeparator { \enskip } \__sjtu_newlistof:nnnnn { algorithm } { alg } { algocf } { \algorithmcfname } { \listalgorithmcfname } @@ -1701,7 +1634,7 @@ } } \ctex_at_end_package:nn { nomencl } - { \tl_set:Nn \nomname { \l__sjtu_name_nom_tl } } + { \tl_set:Nn \nomname { \SJTU@nomname } } \endinput %% %% End of file `sjtuthesis.cls'.