diff --git a/.gitignore b/.gitignore index 17d48fb..9c12575 100644 --- a/.gitignore +++ b/.gitignore @@ -3,14 +3,14 @@ package-lock.json node_modules/ dist/ -thuthesis*.zip -thuthesis-ctan/ +sysuthesis*.zip +sysuthesis-ctan/ ## generated files: dtx-style.sty -thuthesis.cls -thuthesis.pdf -thuthesis-example.pdf +# sysuthesis.cls +# sysuthesis.pdf +# sysuthesis-example.pdf spine.pdf *.hd diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ad74b5..a88e14f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,15 @@ ## [Unreleased] +## [v1.1.1] - 2023-10-18 +### Add + - 添加封面和封底扫描版 +### Merge + - 合并ThuThesis v7.4.0 + ## [v1.1.0] - 2022-11-16 ### Merge -- 合并Thu-Thesis v7.3.1 +- 合并ThuThesis v7.3.1 ## [v1.0.1] - 2021-10-09 ### Added @@ -27,7 +33,8 @@ - 改变研究生的titlepage和copyrightpage -[Unreleased]: https://github.com/DapengFeng/sysuthesis/compare/v1.1.0...HEAD +[Unreleased]: https://github.com/DapengFeng/sysuthesis/compare/v1.1.1...HEAD +[v1.1.1]: https://github.com/DapengFeng/sysuthesis/releases/tag/v1.1.1 [v1.1.0]: https://github.com/DapengFeng/sysuthesis/releases/tag/v1.1.0 [v1.0.1]: https://github.com/DapengFeng/sysuthesis/releases/tag/v1.0.1 [v1.0.0]: https://github.com/DapengFeng/sysuthesis/releases/tag/v1.0.0 \ No newline at end of file diff --git a/Makefile b/Makefile index 3013a29..7b0cc19 100755 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SOURCES = $(PACKAGE).ins $(PACKAGE).dtx CLSFILE = dtx-style.sty $(PACKAGE).cls LATEXMK = latexmk -SHELL := /bin/bash +SHELL := /usr/bin/env bash NPM ?= npm # make deletion work on Windows diff --git a/spine.tex b/spine.tex new file mode 100644 index 0000000..993370b --- /dev/null +++ b/spine.tex @@ -0,0 +1,19 @@ +% !TeX encoding = UTF-8 +% !TeX program = xelatex +% !TeX spellcheck = en_US + +\documentclass[degree=master]{sysuthesis} + +\input{sysusetup.tex} + +% \sysusetup{ +% spine-font = {\zihao{3}}, +% spine-title = {书脊的标题}, +% spine-author = {书脊的作者姓名}, +% } + +\begin{document} + +\spine + +\end{document} diff --git a/sysusetup.tex b/sysusetup.tex index 4cace21..1818d73 100644 --- a/sysusetup.tex +++ b/sysusetup.tex @@ -22,7 +22,7 @@ title* = {An Introduction to \LaTeX{} Thesis Template of Sun Yat-sen University v\version}, % - % 学位 + % 学科门类 % 1. 学术型 % - 中文 % 需注明所属的学科门类,例如: @@ -39,8 +39,8 @@ % Doctor of Education, Master of Engineering % 3. 本科生不需要填写 % - degree-name = {工学博士}, - degree-name* = {Doctor of Philosophy}, + degree-category = {工学博士}, + degree-category* = {Doctor of Philosophy}, % % 培养单位 % 填写所属院系的全名 @@ -48,17 +48,20 @@ department = {计算机科学与技术系}, % % 学科 - % 1. 学术型学位 - % 获得一级学科授权的学科填写一级学科名称,其他填写二级学科名称 - % 2. 工程硕士 - % 工程领域名称 - % 3. 其他专业型学位 - % 不填写此项 - % 4. 本科生填写专业名称,第二学位论文需标注“(第二学位)” + % 1. 研究生学术型学位,获得一级学科授权的学科填写一级学科名称,其他填写二级学科名称 + % 2. 本科生填写专业名称,第二学位论文需标注“(第二学位)” % discipline = {计算机科学与技术}, discipline* = {Computer Science and Technology}, % + % 专业领域 + % 1. 设置专业领域的专业学位类别,填写相应专业领域名称 + % 2. 2019 级及之前工程硕士学位论文,在 `engineering-field` 填写相应工程领域名称 + % 3. 其他专业学位类别的学位论文无需此信息 + % + % professional-field = {计算机技术}, + % professional-field* = {Computer Technology}, + % % 姓名 % author = {[姓名]}, diff --git a/sysuthesis-example.pdf b/sysuthesis-example.pdf index 1a2845b..7da8614 100644 Binary files a/sysuthesis-example.pdf and b/sysuthesis-example.pdf differ diff --git a/sysuthesis.cls b/sysuthesis.cls index fca1ae6..592f51a 100644 --- a/sysuthesis.cls +++ b/sysuthesis.cls @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2022 by Dapeng Feng +%% Copyright (C) 2023 by Dapeng Feng %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -21,10 +21,10 @@ %% To produce the documentation run the original source files ending with `.dtx' %% through LaTeX. %% -\newcommand\sysuthesisversion{1.1.0} +\newcommand\sysuthesisversion{1.1.1} \NeedsTeXFormat{LaTeX2e}[2017/04/15] \ProvidesClass{sysuthesis} -[2022/11/16 {\sysuthesisversion} Sun Yat-sen University Thesis Template] +[2023/10/18 {\sysuthesisversion} Sun Yat-sen University Thesis Template] \newcommand\sysu@error[1]{% \ClassError{sysuthesis}{#1}{}% } @@ -360,11 +360,9 @@ } } \AtEndOfPackageFile*{natbib}{ - \ifsysu@degree@bachelor - \@ifpackageloaded{apacite}{}{ - \RequirePackage{bibunits} - } - \fi + \@ifpackageloaded{apacite}{}{ + \RequirePackage{bibunits} + } } \newcommand\sysu@package@conflict[2]{% \AtEndOfPackageFile*{#1}{% @@ -712,7 +710,7 @@ \newcommand\sysu@set@font@times{% \setmainfont{Times New Roman}% \setsansfont{Arial}% - \ifsysu@system@mac + \ifsysu@fontset@mac \setmonofont{Menlo}[Scale = MatchLowercase]% \else \setmonofont{Courier New}[Scale = MatchLowercase]% @@ -1218,7 +1216,7 @@ \newcommand\square{\mdlgwhtsquare}% \newcommand\blacksquare{\mdlgblksquare}% \AtBeginDocument{% - \renewcommand\checkmark{\ensuremath{✓}}% + \renewcommand\checkmark{\ensuremath{\symbol{"2713}}}% }% \renewcommand\sysu@qed{\ensuremath{\QED}}% }% @@ -2090,14 +2088,29 @@ committee* = { name = committee@en, }, - degree-name = { + degree-category = { default = {工学博士}, - name = degree@name, + name = degree@category, }, - degree-name* = { + degree-category* = { default = {Doctor of Philosophy}, - name = degree@name@en, + name = degree@category@en, + }, + % 为了向后兼容 + degree-name = { + name = degree@category, + }, + degree-name* = { + name = degree@category@en, }, +} +\sysu@option@hook{degree-name}{% + \sysu@warning{`degree-name' is deprecated. Use `degree-category' instead.} +} +\sysu@option@hook{degree-name*}{% + \sysu@warning{`degree-name*' is deprecated. Use `degree-category*' instead.} +} +\sysu@define@key{ department = { default = {计算机科学与技术系}, }, @@ -2108,6 +2121,34 @@ % default = {Computer Science and Technology}, name = discipline@en, }, +} +\sysu@option@hook{discipline}{% + \ifsysu@degree@type@professional + \sysu@warning{`discipline' for professional degree is deprecated. Use `professional-field' instead.} + \let\sysu@professional@field\sysu@discipline + \let\sysu@discipline\@empty + \fi +} +\sysu@option@hook{discipline*}{% + \ifsysu@degree@type@professional + \sysu@warning{`discipline*' for professional degree is deprecated. Use `professional-field*' instead.} + \let\sysu@professional@field@en\sysu@discipline@en + \let\sysu@discipline@en\@empty + \fi +} +\sysu@define@key{ + professional-field = { + name = professional@field, + }, + professional-field* = { + name = professional@field@en, + }, + engineering-field = { + name = engineering@field, + }, + engineering-field* = { + name = engineering@field@en, + }, date = { default = {\the\year-\two@digits{\month}-\two@digits{\day}}, }, @@ -2203,8 +2244,19 @@ \stepcounter{sysu@csl@count}% } \newcommand\sysu@name@title@format[2]{% - \sysu@pad{3cm}{\sysu@stretch{4em}{#1}}% - \sysu@stretch{3em}{#2}% + \ifsysu@degree@type@professional + % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp + \sysu@stretch{67.6bp}{#1}% + \hspace{9.8bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{9.8bp}}% + #2% + \endgroup + \else + \sysu@pad{3cm}{\sysu@stretch{4em}{#1}}% + \sysu@stretch{3em}{#2}% + \fi } \newcommand\sysu@name@title[1]{% \setcounter{sysu@csl@count}{0}% @@ -2268,12 +2320,24 @@ \ifsysu@degree@graduate \ifsysu@thesis@type@thesis \ifsysu@degree@type@academic - \sysu@titlepage@graduate@academic + \ifsysu@degree@doctor + \sysu@titlepage@doctor@academic + \else + \sysu@titlepage@master@academic + \fi \else - \ifx\sysu@discipline\@empty - \sysu@titlepage@graduate@professional + \ifsysu@degree@doctor + \sysu@titlepage@doctor@professional \else - \sysu@titlepage@graduate@academic + \ifx\sysu@professional@field\@empty + \ifx\sysu@engineering@field\@empty + \sysu@titlepage@master@professional@without@field + \else + \sysu@titlepage@master@professional@with@field + \fi + \else + \sysu@titlepage@master@professional@with@field + \fi \fi \fi \else @@ -2298,7 +2362,7 @@ \fi \sysu@reset@main@language } -\newcommand\sysu@titlepage@graduate@academic{% +\newcommand\sysu@titlepage@doctor@academic{% \newgeometry{ top = 2cm, bottom = 3.25cm, @@ -2324,10 +2388,10 @@ \endgroup \vskip -9.2pt% \vskip 24.1pt% - \sysu@titlepage@degree + \sysu@titlepage@degree\par \vfill \parbox[t][7.25cm][t]{\textwidth}{% - \centering\fangsong\fontsize{16bp}{31.2bp}\selectfont + \fangsong\fontsize{16bp}{31.2bp}\selectfont \sysu@titlepage@info }\par \vfill @@ -2336,7 +2400,7 @@ \clearpage \restoregeometry } -\newcommand\sysu@titlepage@graduate@professional{% +\newcommand\sysu@titlepage@doctor@professional{% \newgeometry{ top = 2cm, bottom = 3.25cm, @@ -2365,12 +2429,160 @@ \vskip 25.5pt% \sysu@titlepage@degree \vfill - \parbox[t][5.24cm][t]{\textwidth}{% - \centering\fangsong\fontsize{16bp}{1cm}\selectfont + \parbox[b][5.24cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{1cm}\selectfont \sysu@titlepage@info }\par + \vskip 2.22cm% + \parbox[t][1.0cm][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \endgroup + \clearpage + \restoregeometry +} +\newcommand\sysu@titlepage@master@academic{% + \newgeometry{ + top = 2cm, + bottom = 6cm, + hmargin = 3.5cm, + }% + \thispagestyle{empty}% + \null\vskip 10bp% + \begingroup + \centering + \parbox[t][55bp][t]{\textwidth}{% + \hskip -23bp% + \sysu@titlepage@secret + }\par + \vskip 34pt% + \begingroup + % 1.21 倍行距 + \sffamily\fontsize{26bp}{40.898bp}\selectfont + \sysu@title\par + \endgroup + \ifsysu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \sysu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 18pt% + \sysu@titlepage@degree\par + \vfill + \parbox[t][7.05cm][t]{\textwidth}{% + % 表格行高 1cm = 28.35bp + \fangsong\fontsize{16bp}{28.35bp}\selectfont + \sysu@titlepage@info + }\par + \parbox[t][37bp][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \endgroup + \clearpage + \restoregeometry +} +\newcommand\sysu@titlepage@master@professional@without@field{% + \newgeometry{ + top = 2cm, + bottom = 6cm, + hmargin = 3.5cm, + }% + \thispagestyle{empty}% + \null\vskip 15bp% + \begingroup + \centering + \parbox[t][41bp][t]{\textwidth}{% + \hskip -23bp% + \sysu@titlepage@secret + }\par + \vskip 1.5cm% + \begingroup + % 1.21 倍行距,无网格 + \sffamily\fontsize{26bp}{40.9bp}\selectfont + \sysu@title\par + \endgroup + \ifsysu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \sysu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 25.5pt% + \sysu@titlepage@degree \vfill - \parbox[t][1.25cm][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \parbox[b][5.24cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{1cm}\selectfont + \sysu@titlepage@info + }\par + \vskip 2.22cm% + \parbox[t][35.5bp][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \endgroup + \clearpage + \restoregeometry +} +\newcommand\sysu@titlepage@master@professional@with@field{% + \newgeometry{ + top = 2cm, + bottom = 6cm, + hmargin = 3.5cm, + }% + \thispagestyle{empty}% + \null\vskip 10bp% + \begingroup + \centering + \parbox[t][46bp][t]{\textwidth}{% + \hskip -23bp% + \sysu@titlepage@secret + }\par + \vskip 1.5cm% + \begingroup + % 1.21 倍行距,无网格 + \sffamily\fontsize{26bp}{40.9bp}\selectfont + \sysu@title\par + \endgroup + \ifsysu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \sysu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 25.5pt% + \sysu@titlepage@degree + \vskip 119bp% + \parbox[b][5.24cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{31bp}\selectfont + \renewcommand\sysu@info@item@format[2]{% + \begingroup + \renewcommand\CJKglue{\hspace{##1}}% + ##2% + \endgroup + }% + \renewcommand\sysu@name@title@format[2]{% + % 字距 9bp,共 16bp * 3 + 9bp * 2 = 66bp + \sysu@stretch{66bp}{##1}% + \hspace{22bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{16bp}}% + ##2% + \endgroup + }% + \sysu@titlepage@info@tabular{65bp}{86.5bp}{81bp}{30.5bp}{% + \sysu@info@item{培养单位}{\sysu@info@item@format{1bp}}{\sysu@department}% + \sysu@info@item{专业领域}{\sysu@info@item@format{2bp}}{\sysu@professional@field}% + \sysu@info@item{工程领域}{\sysu@info@item@format{2bp}}{\sysu@engineering@field}% + \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% + \sysu@info@item{学号}{}{\sysu@student@id}% + \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% + \sysu@info@item{副指导教师}{\sysu@name@title}{\sysu@associate@supervisor}% + \sysu@info@item{联合指导教师}{\sysu@name@title}{\sysu@co@supervisor}% + }\par + }\par + \vfill + \parbox[t][33.5bp][t]{\textwidth}{\centering\sysu@titlepage@date}\par \endgroup \clearpage \restoregeometry @@ -2425,7 +2637,7 @@ \ifx\sysu@secret@level\@empty \phantom{秘密}% \else - \sysu@secret@level★\makebox[3em][c]{\sysu@secret@year}年% + \sysu@secret@level\symbol{"2605}\makebox[3em][c]{\sysu@secret@year}年% \fi\par } \newcommand\sysu@titlepage@degree{% @@ -2439,7 +2651,7 @@ \renewcommand\CJKglue{\hspace{1bp}}% \fi \ifsysu@thesis@type@thesis - (申请中山大学\sysu@degree@name + (申请中山大学\sysu@degree@category \ifsysu@degree@type@professional 专业% \fi @@ -2475,29 +2687,35 @@ \ifsysu@degree@type@academic \sysu@titlepage@info@master@academic \else - \ifx\sysu@discipline\@empty - \sysu@titlepage@info@master@other + \ifx\sysu@professional@field\@empty + \ifx\sysu@engineering@field\@empty + \sysu@titlepage@info@master@professional@without@field + \else + \sysu@titlepage@info@master@professional@with@field + \fi \else - \sysu@titlepage@info@master@engineer + \sysu@titlepage@info@master@professional@with@field \fi \fi \fi } -\newcommand\sysu@titlepage@info@tabular[4]{% +\newcommand\sysu@titlepage@info@tabular[5]{% \def\sysu@info@item##1##2##3{% \ifx##3\@empty\else - \sysu@pad{#1}{\sysu@fixed@box{#2}{##1}}% - \sysu@pad{#3}{:}% + \sysu@pad{#2}{\sysu@fixed@box{#3}{##1}}% + \sysu@pad{#4}{:}% ##2{##3}\\ \fi }% + \hspace{#1}% \begin{tabular}{l}% \renewcommand\arraystretch{1}% - #4% + #5% \end{tabular}% } +\newcommand\sysu@info@item@format[1]{#1} \newcommand\sysu@titlepage@info@doctor@academic{% - \sysu@titlepage@info@tabular{2.8cm}{2.8cm}{0.82cm}{% + \sysu@titlepage@info@tabular{2.3cm}{2.85cm}{2.75cm}{0.77cm}{% \sysu@info@item{培养单位}{}{\sysu@department}% \sysu@info@item{学科}{}{\sysu@discipline}% \sysu@info@item{研究生}{\sysu@name@title}{\sysu@author}% @@ -2509,20 +2727,36 @@ }\par } \newcommand\sysu@titlepage@info@doctor@professional{% - \sysu@titlepage@info@tabular{3.03cm}{5em}{1.52cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% + \sysu@titlepage@info@tabular{2.3cm}{3.1cm}{5em}{1.42cm}{% + \sysu@info@item{培养单位}{}{{\sysu@department}}% \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% \sysu@info@item{学号}{}{\sysu@student@id}% \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% \sysu@info@item{副指导教师}{\sysu@name@title}{\sysu@associate@supervisor}% - \sysu@info@item{联合导师}{\sysu@name@title}{\sysu@co@supervisor}% + \sysu@info@item{联合指导教师}{\sysu@name@title}{\sysu@co@supervisor}% \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% }\par } \newcommand\sysu@titlepage@info@master@academic{% - \sysu@titlepage@info@tabular{3.59cm}{5.5em}{0.82cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% - \sysu@info@item{学科}{}{\sysu@discipline}% + \renewcommand\sysu@info@item@format[2]{% + \begingroup + \renewcommand\CJKglue{\hspace{##1}}% + ##2% + \endgroup + } + \renewcommand\sysu@name@title@format[2]{% + % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp + \sysu@stretch{67.6bp}{##1}% + \hspace{9.8bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{6bp}}% + ##2% + \endgroup + }% + \sysu@titlepage@info@tabular{58bp}{3.59cm}{5.5em}{0.82cm}{% + \sysu@info@item{培养单位}{\sysu@info@item@format{1bp}}{\sysu@department}% + \sysu@info@item{学科}{\sysu@info@item@format{2bp}}{\sysu@discipline}% \sysu@info@item{研究生}{\sysu@name@title}{\sysu@author}% \sysu@info@item{学号}{}{\sysu@student@id}% \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% @@ -2531,10 +2765,25 @@ \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% }\par } -\newcommand\sysu@titlepage@info@master@engineer{% - \sysu@titlepage@info@tabular{2.8cm}{2.8cm}{1.34cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% - \sysu@info@item{工程领域}{}{\sysu@discipline}% +\newcommand\sysu@titlepage@info@master@professional@without@field{% + \renewcommand\sysu@info@item@format[2]{% + \begingroup + \renewcommand\CJKglue{\hspace{##1}}% + ##2% + \endgroup + } + \renewcommand\sysu@name@title@format[2]{% + % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp + \sysu@stretch{67.6bp}{##1}% + \hspace{9.8bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{6bp}}% + ##2% + \endgroup + }% + \sysu@titlepage@info@tabular{58bp}{3.28cm}{5em}{1.52cm}{% + \sysu@info@item{培养单位}{\sysu@info@item@format{1bp}}{\sysu@department}% \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% \sysu@info@item{学号}{}{\sysu@student@id}% \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% @@ -2543,16 +2792,7 @@ \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% }\par } -\newcommand\sysu@titlepage@info@master@other{% - \sysu@titlepage@info@tabular{3.28cm}{5em}{1.52cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% - \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% - \sysu@info@item{学号}{}{\sysu@student@id}% - \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% - \sysu@info@item{副指导教师}{\sysu@name@title}{\sysu@associate@supervisor}% - \sysu@info@item{联合指导教师}{\sysu@name@title}{\sysu@co@supervisor}% - \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% - }\par +\newcommand\sysu@titlepage@info@master@professional@with@field{% } \newcommand\sysu@titlepage@date{% \begingroup @@ -2569,7 +2809,7 @@ \newgeometry{ top = 5.5cm, bottom = 5cm, - hmargin = 3.6cm, + hmargin = 3.4cm, }% \thispagestyle{empty}% \sysusetup{language = english}% @@ -2585,49 +2825,51 @@ \newcommand\sysu@titlepage@en@graduate@academic{% \begingroup \centering - \null\vskip -0.7cm% - \sysu@titlepage@en@title - \vfill + \null\vskip -0.31cm% + \parbox[t][143bp][t]{\textwidth}{% + \centering\sysu@titlepage@en@title + }\par \sanhao[1.725]% \sysu@titlepage@en@degree - \vskip 0.13cm% + \vskip 3bp% in\par - \vskip 0.1cm% + \vskip 3.5bp% {\bfseries\sffamily\sysu@discipline@en\par} - \vskip 0.7cm% + \vfill {\sffamily by\par} \vskip 0.24cm% {\sffamily\bfseries\sysu@author@en\par}% - \vskip 0.14cm% - \parbox[t][3.07cm][t]{\textwidth}{% - \centering\xiaosan[2.1]% + \vskip 0.18cm% + \parbox[t][3.0cm][t]{\textwidth}{% + \xiaosan[2.1]% \sysu@titlepage@en@supervisor }\par \sysu@titlepage@en@date - \vskip 0.65cm% + \vskip 0.7cm% \endgroup } \newcommand\sysu@titlepage@en@graduate@professional{% \begingroup \centering - \null\vskip -0.7cm% - \sysu@titlepage@en@title - \vfill + \null\vskip -0.31cm% + \parbox[t][143bp][t]{\textwidth}{% + \centering\sysu@titlepage@en@title + }\par \sanhao[1.725]% \sysu@titlepage@en@degree - \vskip 1.1cm% + \vfill {\sffamily by\par} \vskip 0.24cm% {\sffamily\bfseries\sysu@author@en\par}% - \ifx\sysu@discipline@en\empty + \ifx\sysu@professional@field@en\empty \vskip 1.95cm% \else \vskip -0.1cm% - {\sffamily\bfseries(\sysu@discipline@en)\par}% + {\sffamily\bfseries(\sysu@professional@field@en)\par}% \vskip 1.1cm% \fi \parbox[t][3.37cm][t]{\textwidth}{% - \centering\xiaosan[1.82]% + \xiaosan[1.82]% \sysu@titlepage@en@supervisor }\par \sysu@titlepage@en@date @@ -2636,7 +2878,8 @@ } \newcommand\sysu@titlepage@en@title{% \begingroup - \sffamily\bfseries\fontsize{20bp}{31bp}\selectfont + % 对齐到网格,每行 15.6bp + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont \sysu@title@en\par \endgroup } @@ -2656,10 +2899,11 @@ professional \fi degree of\par - {\sffamily\bfseries\sysu@degree@name@en\par}% + {\sffamily\bfseries\sysu@degree@category@en\par}% } \newcommand\sysu@titlepage@en@supervisor{% - \begin{tabular}{r@{\makebox[0.71cm][l]{:}}l}% + \hspace{1.27cm}% + \begin{tabular}{r@{\makebox[20.5bp][l]{\hspace{2bp}:}}l}% \renewcommand\arraystretch{1}% \sysu@thesis@name@en{} Supervisor & \sysu@supervisor@en \\ \ifx\sysu@associate@supervisor@en\@empty\else @@ -3019,6 +3263,7 @@ \textbf{关键词:}% \fi \sysu@clist@use{\sysu@keywords}{;}% + \gdef\sysu@keywords{}% \ifsysu@degree@bachelor \cleardoublepage \fi @@ -3082,6 +3327,7 @@ \newcommand{\sysu@backdate}{日\hspace{1em}期:} \newenvironment{acknowledgements}{% \@mainmatterfalse + \sysu@end@appendix@ref@section \ifsysu@degree@bachelor \cleardoublepage \fi @@ -3124,6 +3370,7 @@ \newif\ifsysu@statement@exists \newcommand\statement[1][]{% \@mainmatterfalse + \sysu@end@appendix@ref@section \sysu@statement@existstrue \ifsysu@degree@bachelor \cleardoublepage @@ -3246,16 +3493,33 @@ {\sysu@equation@name~\thecontentslabel}{} {\nobreak\sysu@leaders\nobreak\thecontentspage} \contentsuse{equation}{loe} - \sysu@define@key{ - cite-style = { - name = cite@style, - choices = { - super, - inline, - author-year, - } +\sysu@define@key{ + cite-style = { + name = cite@style, + choices = { + super, + inline, + author-year, } } +} +\def\bibliographystyle#1{% + \gdef\bu@bibstyle{#1}% + \ifx\@begindocumenthook\@undefined\else + \expandafter\AtBeginDocument + \fi + {\if@filesw + \immediate\write\@auxout{\string\bibstyle{#1}}% + \immediate\write\@auxout{\string\gdef\string\bu@bibstyle{#1}}% + \fi}% +} +\def\bibliography#1{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}% + \immediate\write\@auxout{\string\gdef\string\bu@bibdata{#1}}% + \fi + \gdef\bu@bibdata{#1}% + \@input@{\jobname.bbl}} \PassOptionsToPackage{compress}{natbib} \AtEndOfPackageFile*{natbib}{ \DeclareRobustCommand\inlinecite{\@inlinecite} @@ -3643,6 +3907,56 @@ appendix-figure-in-lof = false, }% } +\newcommand\sysu@end@appendix@ref@section{} +\AtEndOfPackageFile*{bibunits}{ + \ifsysu@degree@graduate + \newcommand\sysu@appendix@bib@num@format[1]{[\@Alph\c@chapter.#1]\hfill} + \g@addto@macro\appendix{% + \renewcommand\@bibunitname{\jobname-appendix-\@alph\c@chapter}% + \bibliographyunit[\chapter]% + \renewcommand\citenumfont{\@Alph\c@chapter.}% + \renewcommand\bibsection{% + \ctexset{section/numbering = false}% + \section{\bibname}% + \ctexset{section/numbering = true}% + }% + \renewcommand\@extra@binfo{@-\@alph\c@chapter}% + \renewcommand\@extra@b@citeb{@-\@alph\c@chapter}% + \let\bibnumfmt\sysu@appendix@bib@num@format + \let\bibliographystyle\defaultbibliographystyle + \let\bibliography\sysu@appendix@bibliography + } + \renewcommand\sysu@end@appendix@ref@section{% + \bibliographyunit\relax + } + \providecommand\printbibliography{\putbib\relax}% + \AtEndDocument{\sysu@end@appendix@ref@section} + % \let\@xtestdef\@gobbletwo % This doesn't work + \def\bibunits@rerun@warning{\relax} + \fi +} +\PassOptionsToPackage{defernumbers = true}{biblatex} +\AtEndOfPackageFile*{biblatex}{ + \ifsysu@degree@graduate + \DeclareRefcontext{appendix}{} + \g@addto@macro\appendix{% + \pretocmd\chapter{% + \newrefsection + \@tempcnta=\c@chapter + \advance\@tempcnta\@ne + \newrefcontext[labelprefix = {\@Alph\@tempcnta.}]{appendix}% + }{}{\sysu@patch@error{\chapter}}% + \defbibheading{bibliography}[\bibname]{% + \ctexset{section/numbering = false}% + \section{#1}% + \ctexset{section/numbering = true}% + }% + } + % \renewcommand\sysu@end@appendix@ref@section{% + % \endrefsection + % } + \fi +} \@ifpackagelater{titletoc}{2019/07/14}{ \newcommand\sysu@print@contents[5]{% \printcontents[#1]{#2}{#3}[#4]{}% @@ -3690,9 +4004,10 @@ }, }% \section{摘要}% - \quotation - }{% - \endquotation + \par + \ifx\sysu@keywords\@empty\else + \textbf{关键词:}\sysu@clist@use{\sysu@keywords}{;}\par + \fi }% \sysu@set@partial@toc@format \renewcommand\tableofcontents{% @@ -3767,6 +4082,7 @@ \newcommand\sysu@appendix@bibliography[1]{\putbib[#1]} \newenvironment{resume}{% \@mainmatterfalse + \sysu@end@appendix@ref@section \sysu@chapter*{\sysu@resume@name}% \ctexset{ section = { @@ -3782,17 +4098,20 @@ aftertitle = :, }, }% - \ifsysu@degree@graduate - \fontsize{12bp}{16bp}\selectfont - \fi \setlist[achievements]{ - topsep = 6bp, - itemsep = 6bp, - leftmargin = 1cm, - labelwidth = 1cm, - labelsep = 0pt, - align = left, - label = [\arabic*], + topsep = 6bp, + itemsep = 6bp, + leftmargin = 1cm, + labelwidth = 1cm, + labelsep = 0pt, + first = { + \ifsysu@degree@graduate + \fontsize{12bp}{16bp}\selectfont + \fi + }, + align = left, + label = [\arabic*], + resume = achievements, }% \else \ctexset{ @@ -3809,12 +4128,13 @@ \sffamily\fontsize{15bp}{20bp}\selectfont \fi \setlist[achievements]{ - topsep = 0bp, - itemsep = 0bp, - leftmargin = 1.75cm, - labelsep = 0.5cm, - align = right, - label = [\arabic*], + topsep = 0bp, + itemsep = 0bp, + leftmargin = 1.75cm, + labelsep = 0.5cm, + align = right, + label = [\arabic*], + resume = achievements, }% \fi }{} @@ -3846,6 +4166,7 @@ \sysu@error{The "\protect\publicationskip" is obsolete. Do not use it}% } \NewEnviron{comments}[1][]{% + \sysu@end@appendix@ref@section \ifsysu@degree@graduate \@mainmatterfalse \kv@define@key{sysu@comments}{name}{\let\sysu@comments@name\kv@value}% @@ -3862,6 +4183,7 @@ \fi } \NewEnviron{resolution}{% + \sysu@end@appendix@ref@section \ifsysu@degree@graduate \@mainmatterfalse \chapter{\sysu@resolution@name}% @@ -3886,21 +4208,21 @@ \sysu@pdfbookmark{0}{综合论文训练记录表}% \includepdf[pages=-]{\sysu@record@file}% } +\PassOptionsToPackage{ + linktoc = all, + bookmarksdepth = 2, + bookmarksnumbered = true, + bookmarksopen = true, + bookmarksopenlevel = 1, + bookmarksdepth = 3, + unicode = true, + psdextra = true, + breaklinks = true, + plainpages = false, + pdfdisplaydoctitle = true, + hidelinks, +}{hyperref} \AtEndOfPackageFile*{hyperref}{ - \hypersetup{ - linktoc = all, - bookmarksdepth = 2, - bookmarksnumbered = true, - bookmarksopen = true, - bookmarksopenlevel = 1, - bookmarksdepth = 3, - unicode = true, - psdextra = true, - breaklinks = true, - plainpages = false, - pdfdisplaydoctitle = true, - hidelinks, - }% \newcounter{sysu@bookmark} \renewcommand\sysu@pdfbookmark[2]{% \phantomsection @@ -3933,14 +4255,14 @@ \hypersetup{ pdftitle = \sysu@title, pdfauthor = \sysu@author, - pdfsubject = \sysu@degree@name, + pdfsubject = \sysu@degree@category, pdfkeywords = \sysu@keywords, }% \else \hypersetup{ pdftitle = \sysu@title@en, pdfauthor = \sysu@author@en, - pdfsubject = \sysu@degree@name@en, + pdfsubject = \sysu@degree@category@en, pdfkeywords = \sysu@keywords@en, }% \fi diff --git a/sysuthesis.dtx b/sysuthesis.dtx index a75a580..1239488 100644 --- a/sysuthesis.dtx +++ b/sysuthesis.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2021-2022 by Dapeng Feng +% Copyright (C) 2021-2023 by Dapeng Feng % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c @@ -14,8 +14,8 @@ % % \iffalse %<*driver> -\newcommand\sysuthesisversion{1.1.0} -\ProvidesFile{sysuthesis.dtx}[2022/11/16 {\sysuthesisversion} Sun Yat-sen University Thesis Template] +\newcommand\sysuthesisversion{1.1.1} +\ProvidesFile{sysuthesis.dtx}[2023/10/18 {\sysuthesisversion} Sun Yat-sen University Thesis Template] \documentclass{ltxdoc} \usepackage{dtx-style} @@ -99,7 +99,7 @@ % \textbf{Thesis} Template)是为了帮助中山大学毕业生撰写毕业论文而编写 % 的 \LaTeX{} 论文模板。 % -% 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处,或者想提出改进建议, +% 本文档将尽量完整地介绍模板的使用方法,如有不清楚之处,或者想提出改进建议, % 可以在 \href{https://github.com/DapengFeng/sysuthesis/issues/}{GitHub Issues} % 参与讨论或提问。 % 有兴趣者都可以参与完善此手册,也非常欢迎对代码的贡献。 @@ -437,15 +437,15 @@ % \end{latex} % % \subsubsection{申请学位名称} -% \label{sec:degree-name} -% 学位名称的设置比较复杂,见表~\ref{tab:degree-name}。 +% \label{sec:degree-category} +% 学位名称的设置比较复杂,见表~\ref{tab:degree-category}。 % % \begin{table}[h] % \caption{学位名称的要求} -% \label{tab:degree-name} +% \label{tab:degree-category} % \begin{tabular}{p{2cm}p{6cm}p{6cm}} % \toprule -% 学位类型 & degree-name & degree-name* \\ +% 学位类型 & degree-category & degree-category* \\ % \midrule % 学术型博士 & 需注明所属的学科门类,例如: % 哲学、经济学、法学、教育学、文学、历史学、理学、工学、农学、医学、 @@ -453,7 +453,7 @@ % & Doctor of Philosophy \\ % \midrule % 学术型硕士 & 同上 -% & 哲学、文学、历史学、法学、教育学、艺术学门类,公共管理学科 +% & 哲学、文学、历史学、法学、教育学、艺术学门类 % 填写“Master of Arts“,其它填写“Master of Science” \\ % \midrule % 专业型研究生学位 & 专业学位的名称,例如:教育博士、工程硕士 @@ -466,8 +466,8 @@ % % \begin{latex} % \sysusetup{ -% degree-name = {您要申请什么学位}, -% degree-name* = {Degree in English}, +% degree-category = {您要申请什么学位}, +% degree-category* = {Degree in English}, % } % \end{latex} % @@ -482,10 +482,8 @@ % \subsubsection{学科名称} % % \begin{itemize} -% \item 学术型学位:获得一级学科授权的学科填写一级学科名称,其他填写二级学科名称; -% \item 工程硕士:工程领域名称; -% \item 其他专业型学位:- -% \item 本科生:专业名称,第二学位论文需标注“(第二学位)” +% \item 研究生学术型学位:获得一级学科授权的学科填写一级学科名称,其他填写二级学科名称; +% \item 本科生:专业名称,第二学位论文需标注“(第二学位)”。 % \end{itemize} % % \begin{latex} @@ -495,6 +493,24 @@ % } % \end{latex} % +% \subsubsection{专业领域} +% +% 仅用于研究生专业型学位。 +% +% \begin{itemize} +% \item 设置专业领域的专业学位类别,填写相应专业领域名称; +% \item 2019 级及之前工程硕士学位论文,在 \option{engineering-field} 填写相应工程领域名称; +% \item 其他专业学位类别的学位论文无需此信息。 +% \end{itemize} +% +% \begin{latex} +% \sysusetup{ +% professional-field = {专业领域}, +% professional-field* = {Professional field}, +% } +% \end{latex} +% +% % \subsubsection{作者姓名} % 作者姓名。 % \begin{latex} @@ -1248,10 +1264,10 @@ % % \subsection{基本信息} % \begin{macrocode} -%\newcommand\sysuthesisversion{1.1.0} +%\newcommand\sysuthesisversion{1.1.1} %\NeedsTeXFormat{LaTeX2e}[2017/04/15] %\ProvidesClass{sysuthesis} -%[2022/11/16 {\sysuthesisversion} Sun Yat-sen University Thesis Template] +%[2023/10/18 {\sysuthesisversion} Sun Yat-sen University Thesis Template] % \end{macrocode} % % 报错 @@ -1803,11 +1819,9 @@ } } \AtEndOfPackageFile*{natbib}{ - \ifsysu@degree@bachelor - \@ifpackageloaded{apacite}{}{ - \RequirePackage{bibunits} - } - \fi + \@ifpackageloaded{apacite}{}{ + \RequirePackage{bibunits} + } } % \end{macrocode} % @@ -2304,7 +2318,7 @@ \newcommand\sysu@set@font@times{% \setmainfont{Times New Roman}% \setsansfont{Arial}% - \ifsysu@system@mac + \ifsysu@fontset@mac \setmonofont{Menlo}[Scale = MatchLowercase]% \else \setmonofont{Courier New}[Scale = MatchLowercase]% @@ -2897,7 +2911,7 @@ \newcommand\square{\mdlgwhtsquare}% \newcommand\blacksquare{\mdlgblksquare}% \AtBeginDocument{% - \renewcommand\checkmark{\ensuremath{✓}}% + \renewcommand\checkmark{\ensuremath{\symbol{"2713}}}% }% % \end{macrocode} % @@ -4128,24 +4142,39 @@ % % 学位中英文。 % \begin{macrocode} - degree-name = { + degree-category = { default = {工学博士}, - name = degree@name, + name = degree@category, }, - degree-name* = { + degree-category* = { default = {Doctor of Philosophy}, - name = degree@name@en, + name = degree@category@en, + }, + % 为了向后兼容 + degree-name = { + name = degree@category, + }, + degree-name* = { + name = degree@category@en, }, +} +\sysu@option@hook{degree-name}{% + \sysu@warning{`degree-name' is deprecated. Use `degree-category' instead.} +} +\sysu@option@hook{degree-name*}{% + \sysu@warning{`degree-name*' is deprecated. Use `degree-category*' instead.} +} % \end{macrocode} % % 院系中英文名称。 % \begin{macrocode} +\sysu@define@key{ department = { default = {计算机科学与技术系}, }, % \end{macrocode} % -% 专业中英文名称。 +% 学科中英文名称。 % \begin{macrocode} discipline = { % default = {计算机科学与技术}, @@ -4154,6 +4183,42 @@ % default = {Computer Science and Technology}, name = discipline@en, }, +} +\sysu@option@hook{discipline}{% + \ifsysu@degree@type@professional + \sysu@warning{`discipline' for professional degree is deprecated. Use `professional-field' instead.} + \let\sysu@professional@field\sysu@discipline + \let\sysu@discipline\@empty + \fi +} +\sysu@option@hook{discipline*}{% + \ifsysu@degree@type@professional + \sysu@warning{`discipline*' for professional degree is deprecated. Use `professional-field*' instead.} + \let\sysu@professional@field@en\sysu@discipline@en + \let\sysu@discipline@en\@empty + \fi +} +% \end{macrocode} +% +% 专业领域。 +% \begin{macrocode} +\sysu@define@key{ + professional-field = { + name = professional@field, + }, + professional-field* = { + name = professional@field@en, + }, +% \end{macrocode} +% +% 工程领域。 +% \begin{macrocode} + engineering-field = { + name = engineering@field, + }, + engineering-field* = { + name = engineering@field@en, + }, % \end{macrocode} % % 论文成文日期。 @@ -4288,8 +4353,19 @@ \stepcounter{sysu@csl@count}% } \newcommand\sysu@name@title@format[2]{% - \sysu@pad{3cm}{\sysu@stretch{4em}{#1}}% - \sysu@stretch{3em}{#2}% + \ifsysu@degree@type@professional + % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp + \sysu@stretch{67.6bp}{#1}% + \hspace{9.8bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{9.8bp}}% + #2% + \endgroup + \else + \sysu@pad{3cm}{\sysu@stretch{4em}{#1}}% + \sysu@stretch{3em}{#2}% + \fi } \newcommand\sysu@name@title[1]{% \setcounter{sysu@csl@count}{0}% @@ -4382,12 +4458,24 @@ \ifsysu@degree@graduate \ifsysu@thesis@type@thesis \ifsysu@degree@type@academic - \sysu@titlepage@graduate@academic + \ifsysu@degree@doctor + \sysu@titlepage@doctor@academic + \else + \sysu@titlepage@master@academic + \fi \else - \ifx\sysu@discipline\@empty - \sysu@titlepage@graduate@professional + \ifsysu@degree@doctor + \sysu@titlepage@doctor@professional \else - \sysu@titlepage@graduate@academic + \ifx\sysu@professional@field\@empty + \ifx\sysu@engineering@field\@empty + \sysu@titlepage@master@professional@without@field + \else + \sysu@titlepage@master@professional@with@field + \fi + \else + \sysu@titlepage@master@professional@with@field + \fi \fi \fi \else @@ -4421,7 +4509,7 @@ % 然而作为事实标准的 Word 模板的页边距是上下 6.0 厘米,左右 4.0 厘米。 % 这里缩小上边距以方便排版保密信息。 % \begin{macrocode} -\newcommand\sysu@titlepage@graduate@academic{% +\newcommand\sysu@titlepage@doctor@academic{% \newgeometry{ top = 2cm, bottom = 3.25cm, @@ -4447,10 +4535,10 @@ \endgroup \vskip -9.2pt% \vskip 24.1pt% - \sysu@titlepage@degree + \sysu@titlepage@degree\par \vfill \parbox[t][7.25cm][t]{\textwidth}{% - \centering\fangsong\fontsize{16bp}{31.2bp}\selectfont + \fangsong\fontsize{16bp}{31.2bp}\selectfont \sysu@titlepage@info }\par \vfill @@ -4463,7 +4551,7 @@ % % 专业型学位论文中文封面 % \begin{macrocode} -\newcommand\sysu@titlepage@graduate@professional{% +\newcommand\sysu@titlepage@doctor@professional{% \newgeometry{ top = 2cm, bottom = 3.25cm, @@ -4492,12 +4580,172 @@ \vskip 25.5pt% \sysu@titlepage@degree \vfill - \parbox[t][5.24cm][t]{\textwidth}{% - \centering\fangsong\fontsize{16bp}{1cm}\selectfont + \parbox[b][5.24cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{1cm}\selectfont \sysu@titlepage@info }\par + \vskip 2.22cm% + \parbox[t][1.0cm][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \endgroup + \clearpage + \restoregeometry +} +% \end{macrocode} +% +% 学术型硕士 +% \begin{macrocode} +\newcommand\sysu@titlepage@master@academic{% + \newgeometry{ + top = 2cm, + bottom = 6cm, + hmargin = 3.5cm, + }% + \thispagestyle{empty}% + \null\vskip 10bp% + \begingroup + \centering + \parbox[t][55bp][t]{\textwidth}{% + \hskip -23bp% + \sysu@titlepage@secret + }\par + \vskip 34pt% + \begingroup + % 1.21 倍行距 + \sffamily\fontsize{26bp}{40.898bp}\selectfont + \sysu@title\par + \endgroup + \ifsysu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \sysu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 18pt% + \sysu@titlepage@degree\par + \vfill + \parbox[t][7.05cm][t]{\textwidth}{% + % 表格行高 1cm = 28.35bp + \fangsong\fontsize{16bp}{28.35bp}\selectfont + \sysu@titlepage@info + }\par + \parbox[t][37bp][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \endgroup + \clearpage + \restoregeometry +} +% \end{macrocode} +% +% 专业型硕士 +% \begin{macrocode} +\newcommand\sysu@titlepage@master@professional@without@field{% + \newgeometry{ + top = 2cm, + bottom = 6cm, + hmargin = 3.5cm, + }% + \thispagestyle{empty}% + \null\vskip 15bp% + \begingroup + \centering + \parbox[t][41bp][t]{\textwidth}{% + \hskip -23bp% + \sysu@titlepage@secret + }\par + \vskip 1.5cm% + \begingroup + % 1.21 倍行距,无网格 + \sffamily\fontsize{26bp}{40.9bp}\selectfont + \sysu@title\par + \endgroup + \ifsysu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \sysu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 25.5pt% + \sysu@titlepage@degree + \vfill + \parbox[b][5.24cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{1cm}\selectfont + \sysu@titlepage@info + }\par + \vskip 2.22cm% + \parbox[t][35.5bp][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \endgroup + \clearpage + \restoregeometry +} +% \end{macrocode} +% +% 专业型硕士(有专业领域) +% \begin{macrocode} +\newcommand\sysu@titlepage@master@professional@with@field{% + \newgeometry{ + top = 2cm, + bottom = 6cm, + hmargin = 3.5cm, + }% + \thispagestyle{empty}% + \null\vskip 10bp% + \begingroup + \centering + \parbox[t][46bp][t]{\textwidth}{% + \hskip -23bp% + \sysu@titlepage@secret + }\par + \vskip 1.5cm% + \begingroup + % 1.21 倍行距,无网格 + \sffamily\fontsize{26bp}{40.9bp}\selectfont + \sysu@title\par + \endgroup + \ifsysu@main@language@english + \vskip 5.4pt% + \begingroup + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont + \sysu@title@en\par + \endgroup + \vskip -9.2pt% + \fi + \vskip 25.5pt% + \sysu@titlepage@degree + \vskip 119bp% + \parbox[b][5.24cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{31bp}\selectfont + \renewcommand\sysu@info@item@format[2]{% + \begingroup + \renewcommand\CJKglue{\hspace{##1}}% + ##2% + \endgroup + }% + \renewcommand\sysu@name@title@format[2]{% + % 字距 9bp,共 16bp * 3 + 9bp * 2 = 66bp + \sysu@stretch{66bp}{##1}% + \hspace{22bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{16bp}}% + ##2% + \endgroup + }% + \sysu@titlepage@info@tabular{65bp}{86.5bp}{81bp}{30.5bp}{% + \sysu@info@item{培养单位}{\sysu@info@item@format{1bp}}{\sysu@department}% + \sysu@info@item{专业领域}{\sysu@info@item@format{2bp}}{\sysu@professional@field}% + \sysu@info@item{工程领域}{\sysu@info@item@format{2bp}}{\sysu@engineering@field}% + \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% + \sysu@info@item{学号}{}{\sysu@student@id}% + \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% + \sysu@info@item{副指导教师}{\sysu@name@title}{\sysu@associate@supervisor}% + \sysu@info@item{联合指导教师}{\sysu@name@title}{\sysu@co@supervisor}% + }\par + }\par \vfill - \parbox[t][1.25cm][t]{\textwidth}{\centering\sysu@titlepage@date}\par + \parbox[t][33.5bp][t]{\textwidth}{\centering\sysu@titlepage@date}\par \endgroup \clearpage \restoregeometry @@ -4559,7 +4807,7 @@ \ifx\sysu@secret@level\@empty \phantom{秘密}% \else - \sysu@secret@level★\makebox[3em][c]{\sysu@secret@year}年% + \sysu@secret@level\symbol{"2605}\makebox[3em][c]{\sysu@secret@year}年% \fi\par } % \end{macrocode} @@ -4578,7 +4826,7 @@ \renewcommand\CJKglue{\hspace{1bp}}% \fi \ifsysu@thesis@type@thesis - (申请中山大学\sysu@degree@name + (申请中山大学\sysu@degree@category \ifsysu@degree@type@professional 专业% \fi @@ -4618,10 +4866,14 @@ \ifsysu@degree@type@academic \sysu@titlepage@info@master@academic \else - \ifx\sysu@discipline\@empty - \sysu@titlepage@info@master@other + \ifx\sysu@professional@field\@empty + \ifx\sysu@engineering@field\@empty + \sysu@titlepage@info@master@professional@without@field + \else + \sysu@titlepage@info@master@professional@with@field + \fi \else - \sysu@titlepage@info@master@engineer + \sysu@titlepage@info@master@professional@with@field \fi \fi \fi @@ -4629,22 +4881,29 @@ % \end{macrocode} % % 标题页作者信息表 +% \texttt{\#1}: 表格左侧至版心的距离;\\ +% \texttt{\#2}: “培养方案”的边框宽度;\\ +% \texttt{\#3}: “培养方案”的文字宽度;\\ +% \texttt{\#4}: 冒号的边框;\\ +% \texttt{\#5}: 表格内容。 % \begin{macrocode} -\newcommand\sysu@titlepage@info@tabular[4]{% +\newcommand\sysu@titlepage@info@tabular[5]{% \def\sysu@info@item##1##2##3{% \ifx##3\@empty\else - \sysu@pad{#1}{\sysu@fixed@box{#2}{##1}}% - \sysu@pad{#3}{:}% + \sysu@pad{#2}{\sysu@fixed@box{#3}{##1}}% + \sysu@pad{#4}{:}% ##2{##3}\\ \fi }% + \hspace{#1}% \begin{tabular}{l}% \renewcommand\arraystretch{1}% - #4% + #5% \end{tabular}% } +\newcommand\sysu@info@item@format[1]{#1} \newcommand\sysu@titlepage@info@doctor@academic{% - \sysu@titlepage@info@tabular{2.8cm}{2.8cm}{0.82cm}{% + \sysu@titlepage@info@tabular{2.3cm}{2.85cm}{2.75cm}{0.77cm}{% \sysu@info@item{培养单位}{}{\sysu@department}% \sysu@info@item{学科}{}{\sysu@discipline}% \sysu@info@item{研究生}{\sysu@name@title}{\sysu@author}% @@ -4656,20 +4915,36 @@ }\par } \newcommand\sysu@titlepage@info@doctor@professional{% - \sysu@titlepage@info@tabular{3.03cm}{5em}{1.52cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% + \sysu@titlepage@info@tabular{2.3cm}{3.1cm}{5em}{1.42cm}{% + \sysu@info@item{培养单位}{}{{\sysu@department}}% \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% \sysu@info@item{学号}{}{\sysu@student@id}% \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% \sysu@info@item{副指导教师}{\sysu@name@title}{\sysu@associate@supervisor}% - \sysu@info@item{联合导师}{\sysu@name@title}{\sysu@co@supervisor}% + \sysu@info@item{联合指导教师}{\sysu@name@title}{\sysu@co@supervisor}% \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% }\par } \newcommand\sysu@titlepage@info@master@academic{% - \sysu@titlepage@info@tabular{3.59cm}{5.5em}{0.82cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% - \sysu@info@item{学科}{}{\sysu@discipline}% + \renewcommand\sysu@info@item@format[2]{% + \begingroup + \renewcommand\CJKglue{\hspace{##1}}% + ##2% + \endgroup + } + \renewcommand\sysu@name@title@format[2]{% + % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp + \sysu@stretch{67.6bp}{##1}% + \hspace{9.8bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{6bp}}% + ##2% + \endgroup + }% + \sysu@titlepage@info@tabular{58bp}{3.59cm}{5.5em}{0.82cm}{% + \sysu@info@item{培养单位}{\sysu@info@item@format{1bp}}{\sysu@department}% + \sysu@info@item{学科}{\sysu@info@item@format{2bp}}{\sysu@discipline}% \sysu@info@item{研究生}{\sysu@name@title}{\sysu@author}% \sysu@info@item{学号}{}{\sysu@student@id}% \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% @@ -4678,10 +4953,26 @@ \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% }\par } -\newcommand\sysu@titlepage@info@master@engineer{% - \sysu@titlepage@info@tabular{2.8cm}{2.8cm}{1.34cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% - \sysu@info@item{工程领域}{}{\sysu@discipline}% +% 无专业领域 +\newcommand\sysu@titlepage@info@master@professional@without@field{% + \renewcommand\sysu@info@item@format[2]{% + \begingroup + \renewcommand\CJKglue{\hspace{##1}}% + ##2% + \endgroup + } + \renewcommand\sysu@name@title@format[2]{% + % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp + \sysu@stretch{67.6bp}{##1}% + \hspace{9.8bp}% + % 字距 6bp + \begingroup + \renewcommand\CJKglue{\hspace{6bp}}% + ##2% + \endgroup + }% + \sysu@titlepage@info@tabular{58bp}{3.28cm}{5em}{1.52cm}{% + \sysu@info@item{培养单位}{\sysu@info@item@format{1bp}}{\sysu@department}% \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% \sysu@info@item{学号}{}{\sysu@student@id}% \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% @@ -4690,16 +4981,8 @@ \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% }\par } -\newcommand\sysu@titlepage@info@master@other{% - \sysu@titlepage@info@tabular{3.28cm}{5em}{1.52cm}{% - \sysu@info@item{培养单位}{}{\sysu@department}% - \sysu@info@item{申请人}{\sysu@name@title}{\sysu@author}% - \sysu@info@item{学号}{}{\sysu@student@id}% - \sysu@info@item{指导教师}{\sysu@name@title}{\sysu@supervisor}% - \sysu@info@item{副指导教师}{\sysu@name@title}{\sysu@associate@supervisor}% - \sysu@info@item{联合指导教师}{\sysu@name@title}{\sysu@co@supervisor}% - \sysu@info@item{答辩委员会}{\sysu@name@title}{\sysu@committee}% - }\par +% 有专业领域 +\newcommand\sysu@titlepage@info@master@professional@with@field{% } % \end{macrocode} % @@ -4726,7 +5009,7 @@ \newgeometry{ top = 5.5cm, bottom = 5cm, - hmargin = 3.6cm, + hmargin = 3.4cm, }% \thispagestyle{empty}% \sysusetup{language = english}% @@ -4742,49 +5025,51 @@ \newcommand\sysu@titlepage@en@graduate@academic{% \begingroup \centering - \null\vskip -0.7cm% - \sysu@titlepage@en@title - \vfill + \null\vskip -0.31cm% + \parbox[t][143bp][t]{\textwidth}{% + \centering\sysu@titlepage@en@title + }\par \sanhao[1.725]% \sysu@titlepage@en@degree - \vskip 0.13cm% + \vskip 3bp% in\par - \vskip 0.1cm% + \vskip 3.5bp% {\bfseries\sffamily\sysu@discipline@en\par} - \vskip 0.7cm% + \vfill {\sffamily by\par} \vskip 0.24cm% {\sffamily\bfseries\sysu@author@en\par}% - \vskip 0.14cm% - \parbox[t][3.07cm][t]{\textwidth}{% - \centering\xiaosan[2.1]% + \vskip 0.18cm% + \parbox[t][3.0cm][t]{\textwidth}{% + \xiaosan[2.1]% \sysu@titlepage@en@supervisor }\par \sysu@titlepage@en@date - \vskip 0.65cm% + \vskip 0.7cm% \endgroup } \newcommand\sysu@titlepage@en@graduate@professional{% \begingroup \centering - \null\vskip -0.7cm% - \sysu@titlepage@en@title - \vfill + \null\vskip -0.31cm% + \parbox[t][143bp][t]{\textwidth}{% + \centering\sysu@titlepage@en@title + }\par \sanhao[1.725]% \sysu@titlepage@en@degree - \vskip 1.1cm% + \vfill {\sffamily by\par} \vskip 0.24cm% {\sffamily\bfseries\sysu@author@en\par}% - \ifx\sysu@discipline@en\empty + \ifx\sysu@professional@field@en\empty \vskip 1.95cm% \else \vskip -0.1cm% - {\sffamily\bfseries(\sysu@discipline@en)\par}% + {\sffamily\bfseries(\sysu@professional@field@en)\par}% \vskip 1.1cm% \fi \parbox[t][3.37cm][t]{\textwidth}{% - \centering\xiaosan[1.82]% + \xiaosan[1.82]% \sysu@titlepage@en@supervisor }\par \sysu@titlepage@en@date @@ -4793,7 +5078,8 @@ } \newcommand\sysu@titlepage@en@title{% \begingroup - \sffamily\bfseries\fontsize{20bp}{31bp}\selectfont + % 对齐到网格,每行 15.6bp + \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont \sysu@title@en\par \endgroup } @@ -4813,10 +5099,11 @@ professional \fi degree of\par - {\sffamily\bfseries\sysu@degree@name@en\par}% + {\sffamily\bfseries\sysu@degree@category@en\par}% } \newcommand\sysu@titlepage@en@supervisor{% - \begin{tabular}{r@{\makebox[0.71cm][l]{:}}l}% + \hspace{1.27cm}% + \begin{tabular}{r@{\makebox[20.5bp][l]{\hspace{2bp}:}}l}% \renewcommand\arraystretch{1}% \sysu@thesis@name@en{} Supervisor & \sysu@supervisor@en \\ \ifx\sysu@associate@supervisor@en\@empty\else @@ -5238,6 +5525,7 @@ \textbf{关键词:}% \fi \sysu@clist@use{\sysu@keywords}{;}% + \gdef\sysu@keywords{}% \ifsysu@degree@bachelor \cleardoublepage \fi @@ -5330,6 +5618,7 @@ % \begin{macrocode} \newenvironment{acknowledgements}{% \@mainmatterfalse + \sysu@end@appendix@ref@section \ifsysu@degree@bachelor \cleardoublepage \fi @@ -5378,6 +5667,7 @@ \newif\ifsysu@statement@exists \newcommand\statement[1][]{% \@mainmatterfalse + \sysu@end@appendix@ref@section \sysu@statement@existstrue \ifsysu@degree@bachelor \cleardoublepage @@ -5568,20 +5858,40 @@ % % 设置 \option{cite-style} 的接口,只对 \BibTeX{} 的编译方式有效。 % \begin{macrocode} - \sysu@define@key{ - cite-style = { - name = cite@style, - choices = { - super, - inline, - author-year, - } +\sysu@define@key{ + cite-style = { + name = cite@style, + choices = { + super, + inline, + author-year, } } +} % \end{macrocode} % % \subsubsection{BibTeX + \pkg{natbib} 宏包} % +% \begin{macrocode} +\def\bibliographystyle#1{% + \gdef\bu@bibstyle{#1}% + \ifx\@begindocumenthook\@undefined\else + \expandafter\AtBeginDocument + \fi + {\if@filesw + \immediate\write\@auxout{\string\bibstyle{#1}}% + \immediate\write\@auxout{\string\gdef\string\bu@bibstyle{#1}}% + \fi}% +} +\def\bibliography#1{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}% + \immediate\write\@auxout{\string\gdef\string\bu@bibdata{#1}}% + \fi + \gdef\bu@bibdata{#1}% + \@input@{\jobname.bbl}} +% \end{macrocode} +% % \BibTeX{} 和 \pkg{natbib} 宏包的配置。 % \begin{macrocode} \PassOptionsToPackage{compress}{natbib} @@ -6085,6 +6395,68 @@ } % \end{macrocode} % +% 附录中的参考文献等另行编序号。 +% \begin{macrocode} +\newcommand\sysu@end@appendix@ref@section{} +% \end{macrocode} +% +% 如果正文和附录引用了同一文献,\pkg{bibunits} 会给出无意义的警告,这里消除警告。 +% \begin{macrocode} +\AtEndOfPackageFile*{bibunits}{ + \ifsysu@degree@graduate + \newcommand\sysu@appendix@bib@num@format[1]{[\@Alph\c@chapter.#1]\hfill} + \g@addto@macro\appendix{% + \renewcommand\@bibunitname{\jobname-appendix-\@alph\c@chapter}% + \bibliographyunit[\chapter]% + \renewcommand\citenumfont{\@Alph\c@chapter.}% + \renewcommand\bibsection{% + \ctexset{section/numbering = false}% + \section{\bibname}% + \ctexset{section/numbering = true}% + }% + \renewcommand\@extra@binfo{@-\@alph\c@chapter}% + \renewcommand\@extra@b@citeb{@-\@alph\c@chapter}% + \let\bibnumfmt\sysu@appendix@bib@num@format + \let\bibliographystyle\defaultbibliographystyle + \let\bibliography\sysu@appendix@bibliography + } + \renewcommand\sysu@end@appendix@ref@section{% + \bibliographyunit\relax + } + \providecommand\printbibliography{\putbib\relax}% + \AtEndDocument{\sysu@end@appendix@ref@section} +% \end{macrocode} +% +% 如果正文和附录引用了同一文献,\pkg{bibunits} 会给出无意义的警告,这里消除警告。 +% \begin{macrocode} + % \let\@xtestdef\@gobbletwo % This doesn't work + \def\bibunits@rerun@warning{\relax} + \fi +} +\PassOptionsToPackage{defernumbers = true}{biblatex} +\AtEndOfPackageFile*{biblatex}{ + \ifsysu@degree@graduate + \DeclareRefcontext{appendix}{} + \g@addto@macro\appendix{% + \pretocmd\chapter{% + \newrefsection + \@tempcnta=\c@chapter + \advance\@tempcnta\@ne + \newrefcontext[labelprefix = {\@Alph\@tempcnta.}]{appendix}% + }{}{\sysu@patch@error{\chapter}}% + \defbibheading{bibliography}[\bibname]{% + \ctexset{section/numbering = false}% + \section{#1}% + \ctexset{section/numbering = true}% + }% + } + % \renewcommand\sysu@end@appendix@ref@section{% + % \endrefsection + % } + \fi +} +% \end{macrocode} +% % 本科生《写作指南》有独特的要求:附录 A 为外文资料的调研阅读报告或书面翻译, % 并且要分别附上独立的参考文献和外文资料的原文索引。 % 所以这里定义 \env{survey} 和 \env{translation} 专门处理这两种情况, @@ -6151,9 +6523,10 @@ }, }% \section{摘要}% - \quotation - }{% - \endquotation + \par + \ifx\sysu@keywords\@empty\else + \textbf{关键词:}\sysu@clist@use{\sysu@keywords}{;}\par + \fi }% \sysu@set@partial@toc@format \renewcommand\tableofcontents{% @@ -6258,6 +6631,7 @@ % \begin{macrocode} \newenvironment{resume}{% \@mainmatterfalse + \sysu@end@appendix@ref@section \sysu@chapter*{\sysu@resume@name}% \ctexset{ section = { @@ -6273,17 +6647,20 @@ aftertitle = :, }, }% - \ifsysu@degree@graduate - \fontsize{12bp}{16bp}\selectfont - \fi \setlist[achievements]{ - topsep = 6bp, - itemsep = 6bp, - leftmargin = 1cm, - labelwidth = 1cm, - labelsep = 0pt, - align = left, - label = [\arabic*], + topsep = 6bp, + itemsep = 6bp, + leftmargin = 1cm, + labelwidth = 1cm, + labelsep = 0pt, + first = { + \ifsysu@degree@graduate + \fontsize{12bp}{16bp}\selectfont + \fi + }, + align = left, + label = [\arabic*], + resume = achievements, }% \else \ctexset{ @@ -6300,12 +6677,13 @@ \sffamily\fontsize{15bp}{20bp}\selectfont \fi \setlist[achievements]{ - topsep = 0bp, - itemsep = 0bp, - leftmargin = 1.75cm, - labelsep = 0.5cm, - align = right, - label = [\arabic*], + topsep = 0bp, + itemsep = 0bp, + leftmargin = 1.75cm, + labelsep = 0.5cm, + align = right, + label = [\arabic*], + resume = achievements, }% \fi }{} @@ -6356,6 +6734,7 @@ % \begin{environment}{comments} % \begin{macrocode} \NewEnviron{comments}[1][]{% + \sysu@end@appendix@ref@section \ifsysu@degree@graduate \@mainmatterfalse \kv@define@key{sysu@comments}{name}{\let\sysu@comments@name\kv@value}% @@ -6378,6 +6757,7 @@ % \begin{environment}{resolution} % \begin{macrocode} \NewEnviron{resolution}{% + \sysu@end@appendix@ref@section \ifsysu@degree@graduate \@mainmatterfalse \chapter{\sysu@resolution@name}% @@ -6421,22 +6801,25 @@ % % \subsubsection{\pkg{hyperref} 宏包} % -% \begin{macrocode} +% 使用 \cs{PassOptionsToPackage} 的方式进行配置,允许用户在 \cs{usepackage} +% 覆盖配置(\href{https://github.com/tuna/thuthesis/issues/863}{tuna/thuthesis\#863})。 +% +% \begin{macrocode} +\PassOptionsToPackage{ + linktoc = all, + bookmarksdepth = 2, + bookmarksnumbered = true, + bookmarksopen = true, + bookmarksopenlevel = 1, + bookmarksdepth = 3, + unicode = true, + psdextra = true, + breaklinks = true, + plainpages = false, + pdfdisplaydoctitle = true, + hidelinks, +}{hyperref} \AtEndOfPackageFile*{hyperref}{ - \hypersetup{ - linktoc = all, - bookmarksdepth = 2, - bookmarksnumbered = true, - bookmarksopen = true, - bookmarksopenlevel = 1, - bookmarksdepth = 3, - unicode = true, - psdextra = true, - breaklinks = true, - plainpages = false, - pdfdisplaydoctitle = true, - hidelinks, - }% \newcounter{sysu@bookmark} \renewcommand\sysu@pdfbookmark[2]{% \phantomsection @@ -6478,14 +6861,14 @@ \hypersetup{ pdftitle = \sysu@title, pdfauthor = \sysu@author, - pdfsubject = \sysu@degree@name, + pdfsubject = \sysu@degree@category, pdfkeywords = \sysu@keywords, }% \else \hypersetup{ pdftitle = \sysu@title@en, pdfauthor = \sysu@author@en, - pdfsubject = \sysu@degree@name@en, + pdfsubject = \sysu@degree@category@en, pdfkeywords = \sysu@keywords@en, }% \fi @@ -6857,35 +7240,29 @@ pdfdisplaydoctitle = true }% -\ifthenelse{\equal{\@nameuse{g__ctex_fontset_tl}}{mac}}{ - \setmainfont{Palatino} - \setsansfont[Scale=MatchLowercase]{Helvetica} - \setmonofont[Scale=MatchLowercase]{Menlo} -}{ - \setmainfont[ - Extension = .otf, - UprightFont = *-regular, - BoldFont = *-bold, - ItalicFont = *-italic, - BoldItalicFont = *-bolditalic, - ]{texgyrepagella} - \setsansfont[ - Extension = .otf, - UprightFont = *-regular, - BoldFont = *-bold, - ItalicFont = *-italic, - BoldItalicFont = *-bolditalic, - ]{texgyreheros} - \setmonofont[ - Extension = .otf, - UprightFont = *-regular, - BoldFont = *-bold, - ItalicFont = *-italic, - BoldItalicFont = *-bolditalic, - Scale = MatchLowercase, - Ligatures = CommonOff, - ]{texgyrecursor} -} +\setmainfont[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, +]{texgyrepagella} +\setsansfont[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, +]{texgyreheros} +\setmonofont[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + Scale = MatchLowercase, + Ligatures = CommonOff, +]{texgyrecursor} \unimathsetup{ math-style=ISO, bold-style=ISO, diff --git a/sysuthesis.pdf b/sysuthesis.pdf index a37e6e5..2d344c0 100644 Binary files a/sysuthesis.pdf and b/sysuthesis.pdf differ