diff options
author | Karl Berry <karl@freefriends.org> | 2024-03-29 21:34:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-03-29 21:34:54 +0000 |
commit | 59e30b63db8a55f8b463dfd85e7a17ace98d5622 (patch) | |
tree | bbd9b59412103726aef27ffa9e774aa5fa7cab21 /Master/texmf-dist/tex | |
parent | 0e4dbb54833adb2b9b17df67b3882d83fb9c188b (diff) |
thuthesis (29mar24)
git-svn-id: svn://tug.org/texlive/trunk@70808 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls | 737 |
1 files changed, 278 insertions, 459 deletions
diff --git a/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls b/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls index 35614ddded8..21ba7d4aee8 100644 --- a/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls +++ b/Master/texmf-dist/tex/latex/thuthesis/thuthesis.cls @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2005-2023 by Tsinghua University TUNA Association <tuna@tsinghua.edu.cn> +%% Copyright (C) 2005-2024 by Tsinghua University TUNA Association <tuna@tsinghua.edu.cn> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -23,13 +23,16 @@ %% \NeedsTeXFormat{LaTeX2e}[2017/04/15] \ProvidesClass{thuthesis} -[2023/05/15 7.4.0 Tsinghua University Thesis Template] +[2024/03/29 7.5.0 Tsinghua University Thesis Template] \newcommand\thu@error[1]{% \ClassError{thuthesis}{#1}{}% } \newcommand\thu@warning[1]{% \ClassWarning{thuthesis}{#1}% } +\newcommand\thu@debug[1]{% + \typeout{Package thuthesis Info: #1}% +} \newcommand\thu@patch@error[1]{% \thu@error{Failed to patch command \protect#1}% } @@ -58,7 +61,7 @@ } \hyphenation{Thu-Thesis} \def\thuthesis{ThuThesis} -\def\version{7.4.0} +\def\version{7.5.0} \RequirePackage{kvdefinekeys} \RequirePackage{kvsetkeys} \RequirePackage{kvoptions} @@ -203,6 +206,7 @@ choices = { auto, windows, + windows-local, mac, mac-word, noto, @@ -211,6 +215,10 @@ }, default = auto, }, + windows-font-dir = { + name = windows@font@dir, + default = {.}, + }, math-font = { name = math@font, choices = { @@ -658,9 +666,10 @@ \thusetup{system = windows} } } + \thu@debug{Detected system: \thu@system} \fi -\newcommand\thu@mac@word@font@path{% - /Applications/Microsoft Word.app/Contents/Resources/DFonts/% +\newcommand\thu@mac@word@font@dir{% + /Applications/Microsoft Word.app/Contents/Resources/DFonts% } \ifthu@fontset@auto \ifthu@system@windows @@ -669,21 +678,26 @@ \IfFontExistsTF{SimSun}{ \thusetup{fontset = windows} }{ - \IfFileExists{\thu@mac@word@font@path/SimSun.ttf}{ - \thusetup{fontset = windows} + \IfFileExists{\thu@windows@font@dir/Simsun.ttc}{ + \thusetup{fontset = windows, cjk-font = windows-local} }{ - \ifthu@system@mac - \thusetup{fontset = mac} - \else - \IfFontExistsTF{Noto Serif CJK SC}{ - \thusetup{fontset = ubuntu} - }{ - \thusetup{fontset = fandol} - } - \fi + \IfFileExists{\thu@mac@word@font@dir/Simsun.ttc}{ + \thusetup{fontset = windows, cjk-font = mac-word} + }{ + \ifthu@system@mac + \thusetup{fontset = mac} + \else + \IfFontExistsTF{Noto Serif CJK SC}{ + \thusetup{fontset = ubuntu} + }{ + \thusetup{fontset = fandol} + } + \fi + } } } \fi + \thu@debug{Detected fontset: \thu@fontset} \fi \newcommand\thu@set@font{% \@nameuse{thu@set@font@\thu@font}% @@ -890,11 +904,6 @@ \newcommand\thu@set@font@newtx{% \RequirePackage{newtxtext}% } -\ExplSyntaxOn -\@ifpackageloaded { xeCJK } - { \msg_redirect_name:nnn { fontspec } { no-script } { info } } - { } -\ExplSyntaxOff \ifthu@cjk@font@auto \ifthu@fontset@mac \thusetup{cjk-font = mac} @@ -903,10 +912,14 @@ \IfFontExistsTF{SimSun}{ \thusetup{cjk-font = windows} }{ - \IfFileExists{\thu@mac@word@font@path/SimSun.ttf}{ - \thusetup{cjk-font = mac-word} + \IfFileExists{\thu@windows@font@dir/Simsun.ttc}{ + \thusetup{cjk-font = windows-local} }{ - \thu@error{Cannot find "SimSun" font} + \IfFileExists{\thu@mac@word@font@dir/Simsun.ttc}{ + \thusetup{cjk-font = mac-word} + }{ + \thu@error{Cannot find "SimSun" font} + } } } \else @@ -917,6 +930,7 @@ \fi \fi \fi + \thu@debug{Detected CJK font: \thu@cjk@font} \fi \newcommand\thu@set@cjk@font@windows{% \setCJKmainfont{SimSun}[ @@ -930,29 +944,70 @@ \setCJKfamilyfont{zhkai}{KaiTi}% \setCJKfamilyfont{zhfs}{FangSong}% } -\@namedef{thu@set@cjk@font@mac-word}{% - \setCJKmainfont{SimSun}[% - Path = \thu@mac@word@font@path, - AutoFakeBold = 3, - ItalicFont = KaiTi, - ]% +\@namedef{thu@set@cjk@font@windows-local}{% + \IfFileExists{\thu@windows@font@dir/Kaiti.ttf}{ + \setCJKmainfont{SimSun}[% + Path = \thu@windows@font@dir/, + Extension = .ttc, + AutoFakeBold = 3, + ItalicFont = Kaiti, + ItalicFeatures = {Extension = .ttf}, + ]% + \setCJKmonofont{Fangsong}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhkai}{Kaiti}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhfs}{Fangsong}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + }{ + \setCJKmainfont{SimSun}[% + Path = \thu@windows@font@dir/, + Extension = .ttc, + AutoFakeBold = 3, + ItalicFont = Simkai, + ItalicFeatures = {Extension = .ttf}, + ]% + \setCJKmonofont{Simfang}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhkai}{Simkai}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + \setCJKfamilyfont{zhfs}{Simfang}[ + Path = \thu@windows@font@dir/, + Extension = .ttf, + ]% + } \setCJKsansfont{SimHei}[% - Path = \thu@mac@word@font@path, + Path = \thu@windows@font@dir/, + Extension = .ttf, AutoFakeBold = 3, ]% - \setCJKmonofont{FangSong}[Path=\thu@mac@word@font@path]% \setCJKfamilyfont{zhsong}{SimSun}[% - Path = \thu@mac@word@font@path, + Path = \thu@windows@font@dir/, + Extension = .ttc, AutoFakeBold = 3, ]% \setCJKfamilyfont{zhhei}{SimHei}[% - Path = \thu@mac@word@font@path, + Path = \thu@windows@font@dir/, + Extension = .ttf, AutoFakeBold = 3, ]% - \setCJKfamilyfont{zhkai}{KaiTi}[Path = \thu@mac@word@font@path]% - \setCJKfamilyfont{zhfs}{FangSong}[Path = \thu@mac@word@font@path]% +} +\@namedef{thu@set@cjk@font@mac-word}{% + \let\thu@windows@font@dir\thu@mac@word@font@dir + \@nameuse{thu@set@cjk@font@windows-local}% } \newcommand\thu@set@cjk@font@mac{% + \defaultCJKfontfeatures{}% \setCJKmainfont{Songti SC}[ UprightFont = * Light, BoldFont = * Bold, @@ -984,19 +1039,30 @@ ]% } \newcommand\thu@set@cjk@font@noto{% + \defaultCJKfontfeatures{}% \setCJKmainfont{Noto Serif CJK SC}[ UprightFont = * Light, BoldFont = * Bold, ItalicFont = FandolKai-Regular, ItalicFeatures = {Extension = .otf}, + Script = CJK, + ]% + \setCJKsansfont{Noto Sans CJK SC}[ + BoldFont = * Medium, + Script = CJK, + ]% + \setCJKmonofont{Noto Sans Mono CJK SC}[ + Script = CJK, ]% - \setCJKsansfont{Noto Sans CJK SC}[BoldFont = * Medium]% - \setCJKmonofont{Noto Sans Mono CJK SC}% \setCJKfamilyfont{zhsong}{Noto Serif CJK SC}[ UprightFont = * Light, UprightFont = * Bold, + Script = CJK, + ]% + \setCJKfamilyfont{zhhei}{Noto Sans CJK SC}[ + BoldFont = * Medium, + Script = CJK, ]% - \setCJKfamilyfont{zhhei}{Noto Sans CJK SC}[BoldFont = * Medium]% \setCJKfamilyfont{zhfs}{FandolFang}[ Extension = .otf, UprightFont = *-Regular, @@ -1007,6 +1073,7 @@ ]% } \newcommand\thu@set@cjk@font@fandol{% + \defaultCJKfontfeatures{}% \setCJKmainfont{FandolSong}[ Extension = .otf, UprightFont = *-Regular, @@ -2000,7 +2067,7 @@ \else \ifthu@main@language@chinese \titlecontents{chapter} - [\z@]{\addvspace{6bp}\sffamily} + [\z@]{\sffamily} {\contentspush{\thecontentslabel\quad}}{} {\rmfamily\thu@leaders\thecontentspage}% \titlecontents{section} @@ -2013,7 +2080,7 @@ {\thu@leaders\thecontentspage}% \else \titlecontents{chapter} - [\z@]{\addvspace{6bp}\heiti} + [\z@]{\heiti} {\contentspush{\MakeUppercase{\thecontentslabel}\space}\MakeUppercase}{\MakeUppercase} {\rmfamily\thu@leaders\thecontentspage}% \titlecontents{section} @@ -2236,19 +2303,8 @@ \stepcounter{thu@csl@count}% } \newcommand\thu@name@title@format[2]{% - \ifthu@degree@type@professional - % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp - \thu@stretch{67.6bp}{#1}% - \hspace{9.8bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{9.8bp}}% - #2% - \endgroup - \else - \thu@pad{3cm}{\thu@stretch{4em}{#1}}% - \thu@stretch{3em}{#2}% - \fi + \thu@pad{3cm}{\thu@stretch{4em}{#1}}% + \thu@stretch{3em}{#2}% } \newcommand\thu@name@title[1]{% \setcounter{thu@csl@count}{0}% @@ -2263,7 +2319,7 @@ \thu@pdfbookmark{-1}{\thu@title}% \thu@titlepage \ifthu@include@spine@true - \thu@spine + \spine \fi \ifthu@degree@graduate \ifthu@thesis@type@thesis @@ -2276,38 +2332,23 @@ \newcommand\thu@titlepage{% \thusetup{language = chinese}% \ifthu@degree@graduate + % 研究生 \ifthu@thesis@type@thesis - \ifthu@degree@type@academic - \ifthu@degree@doctor - \thu@titlepage@doctor@academic - \else - \thu@titlepage@master@academic - \fi - \else - \ifthu@degree@doctor - \thu@titlepage@doctor@professional - \else - \ifx\thu@professional@field\@empty - \ifx\thu@engineering@field\@empty - \thu@titlepage@master@professional@without@field - \else - \thu@titlepage@master@professional@with@field - \fi - \else - \thu@titlepage@master@professional@with@field - \fi - \fi - \fi + % 学位论文 + \thu@titlepage@thesis \else \ifthu@thesis@type@proposal + % 选题报告 \thu@titlepage@proposal \fi \fi \else \ifthu@degree@bachelor + % 本科生 \thu@titlepage@bachelor \else \ifthu@degree@postdoc + % 博后 \thu@cover@postdoc \cleardoublepage \thu@titlepage@postdoc @@ -2316,7 +2357,7 @@ \fi \thu@reset@main@language } -\newcommand\thu@titlepage@doctor@academic{% +\newcommand\thu@titlepage@thesis{% \newgeometry{ top = 2cm, bottom = 6cm, @@ -2344,202 +2385,21 @@ \vskip -9.2pt% \fi \vskip 24.1pt% - \thu@titlepage@degree\par + \thu@title@page@degree@category\par \vfill - \parbox[t][7.25cm][t]{\textwidth}{% - \fangsong\fontsize{16bp}{31.2bp}\selectfont - \thu@titlepage@info - }\par - \parbox[t][1.03cm][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -\newcommand\thu@titlepage@doctor@professional{% - \newgeometry{ - top = 2cm, - bottom = 6cm, - hmargin = 3.5cm, - }% - \thispagestyle{empty}% - \null\vskip 0.45cm% - \begingroup - \centering - \parbox[t][1.52cm][t]{\textwidth}{% - \hskip -0.69cm% - \thu@titlepage@secret - }\par - \vskip 1.5cm% - \begingroup - % 1.21 倍行距,无网格 - \sffamily\fontsize{26bp}{40.9bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 25.5pt% - \thu@titlepage@degree - \vfill - \parbox[b][5.24cm][b]{\textwidth}{% - \fangsong\fontsize{16bp}{1cm}\selectfont - \thu@titlepage@info - }\par - \vskip 2.22cm% - \parbox[t][1.0cm][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -\newcommand\thu@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% - \thu@titlepage@secret - }\par - \vskip 34pt% - \begingroup - % 1.21 倍行距 - \sffamily\fontsize{26bp}{40.898bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 18pt% - \thu@titlepage@degree\par - \vfill - \parbox[t][7.05cm][t]{\textwidth}{% - % 表格行高 1cm = 28.35bp - \fangsong\fontsize{16bp}{28.35bp}\selectfont - \thu@titlepage@info - }\par - \parbox[t][37bp][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -\newcommand\thu@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% - \thu@titlepage@secret - }\par - \vskip 1.5cm% - \begingroup - % 1.21 倍行距,无网格 - \sffamily\fontsize{26bp}{40.9bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 25.5pt% - \thu@titlepage@degree - \vfill - \parbox[b][5.24cm][b]{\textwidth}{% - \fangsong\fontsize{16bp}{1cm}\selectfont - \thu@titlepage@info - }\par - \vskip 2.22cm% - \parbox[t][35.5bp][t]{\textwidth}{\centering\thu@titlepage@date}\par - \endgroup - \clearpage - \restoregeometry -} -\newcommand\thu@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% - \thu@titlepage@secret - }\par - \vskip 1.5cm% - \begingroup - % 1.21 倍行距,无网格 - \sffamily\fontsize{26bp}{40.9bp}\selectfont - \thu@title\par - \endgroup - \ifthu@main@language@english - \vskip 5.4pt% - \begingroup - \sffamily\bfseries\fontsize{20bp}{31.2bp}\selectfont - \thu@title@en\par - \endgroup - \vskip -9.2pt% - \fi - \vskip 25.5pt% - \thu@titlepage@degree - \vskip 119bp% - \parbox[b][5.24cm][b]{\textwidth}{% - \fangsong\fontsize{16bp}{31bp}\selectfont - \renewcommand\thu@info@item@format[2]{% - \begingroup - \renewcommand\CJKglue{\hspace{##1}}% - ##2% - \endgroup - }% - \renewcommand\thu@name@title@format[2]{% - % 字距 9bp,共 16bp * 3 + 9bp * 2 = 66bp - \thu@stretch{66bp}{##1}% - \hspace{22bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{16bp}}% - ##2% - \endgroup - }% - \thu@titlepage@info@tabular{65bp}{86.5bp}{81bp}{30.5bp}{% - \thu@info@item{培养单位}{\thu@info@item@format{1bp}}{\thu@department}% - \thu@info@item{专业领域}{\thu@info@item@format{2bp}}{\thu@professional@field}% - \thu@info@item{工程领域}{\thu@info@item@format{2bp}}{\thu@engineering@field}% - \thu@info@item{申请人}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% + \ifthu@degree@type@academic + \parbox[t][7.25cm][t]{\textwidth}{% + \fangsong\fontsize{16bp}{31.2bp}\selectfont + \thu@titlepage@info }\par - }\par - \vfill - \parbox[t][33.5bp][t]{\textwidth}{\centering\thu@titlepage@date}\par + \else + \parbox[t][5.25cm][b]{\textwidth}{% + \fangsong\fontsize{16bp}{31.2bp}\selectfont + \thu@titlepage@info + }\par + \vskip 62pt% + \fi + \parbox[t][1.03cm][t]{\textwidth}{\centering\thu@titlepage@date}\par \endgroup \clearpage \restoregeometry @@ -2562,7 +2422,7 @@ \thu@title\par }% \vskip 0.85cm% - \thu@titlepage@degree + \thu@title@page@degree@category \vfill \parbox[t][8.5cm][t]{\textwidth}{% \centering @@ -2597,9 +2457,9 @@ \thu@secret@level\symbol{"2605}\makebox[3em][c]{\thu@secret@year}年% \fi\par } -\newcommand\thu@titlepage@degree{% +\newcommand\thu@title@page@degree@category{% \begingroup - \xiaoer + \fontsize{16bp}{22bp}\selectfont \ifLuaTeX \fontspec{\CJK@family}% \ltjsetparameter{kanjiskip = {1bp}}% @@ -2630,27 +2490,21 @@ \endgroup } \newcommand\thu@titlepage@info{% - \ifthu@degree@doctor - \ifthu@degree@type@academic - \thu@titlepage@info@doctor@academic - \else - \thu@titlepage@info@doctor@professional - \fi - \else + \thu@titlepage@info@tabular{2.3cm}{2.85cm}{2.75cm}{0.77cm}{% + \thu@info@item{培养单位}{}{\thu@department}% \ifthu@degree@type@academic - \thu@titlepage@info@master@academic + \thu@info@item{学科}{}{\thu@discipline}% + \thu@info@item{研究生}{\thu@name@title}{\thu@author}% \else - \ifx\thu@professional@field\@empty - \ifx\thu@engineering@field\@empty - \thu@titlepage@info@master@professional@without@field - \else - \thu@titlepage@info@master@professional@with@field - \fi - \else - \thu@titlepage@info@master@professional@with@field - \fi + \thu@info@item{专业领域}{}{\thu@professional@field}% + \thu@info@item{工程领域}{}{\thu@engineering@field}% + \thu@info@item{申请人}{\thu@name@title}{\thu@author}% \fi - \fi + \thu@info@item{学号}{}{\thu@student@id}% + \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% + \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% + \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% + }\par } \newcommand\thu@titlepage@info@tabular[5]{% \def\thu@info@item##1##2##3{% @@ -2666,83 +2520,6 @@ #5% \end{tabular}% } -\newcommand\thu@info@item@format[1]{#1} -\newcommand\thu@titlepage@info@doctor@academic{% - \thu@titlepage@info@tabular{2.3cm}{2.85cm}{2.75cm}{0.77cm}{% - \thu@info@item{培养单位}{}{\thu@department}% - \thu@info@item{学科}{}{\thu@discipline}% - \thu@info@item{研究生}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合导师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -\newcommand\thu@titlepage@info@doctor@professional{% - \thu@titlepage@info@tabular{2.3cm}{3.1cm}{5em}{1.42cm}{% - \thu@info@item{培养单位}{}{{\thu@department}}% - \thu@info@item{申请人}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -\newcommand\thu@titlepage@info@master@academic{% - \renewcommand\thu@info@item@format[2]{% - \begingroup - \renewcommand\CJKglue{\hspace{##1}}% - ##2% - \endgroup - } - \renewcommand\thu@name@title@format[2]{% - % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp - \thu@stretch{67.6bp}{##1}% - \hspace{9.8bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{6bp}}% - ##2% - \endgroup - }% - \thu@titlepage@info@tabular{58bp}{3.59cm}{5.5em}{0.82cm}{% - \thu@info@item{培养单位}{\thu@info@item@format{1bp}}{\thu@department}% - \thu@info@item{学科}{\thu@info@item@format{2bp}}{\thu@discipline}% - \thu@info@item{研究生}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -\newcommand\thu@titlepage@info@master@professional@without@field{% - \renewcommand\thu@info@item@format[2]{% - \begingroup - \renewcommand\CJKglue{\hspace{##1}}% - ##2% - \endgroup - } - \renewcommand\thu@name@title@format[2]{% - % 字距 9.8bp,共 16bp * 3 + 9.8bp * 2 = 67.5bp - \thu@stretch{67.6bp}{##1}% - \hspace{9.8bp}% - % 字距 6bp - \begingroup - \renewcommand\CJKglue{\hspace{6bp}}% - ##2% - \endgroup - }% - \thu@titlepage@info@tabular{58bp}{3.28cm}{5em}{1.52cm}{% - \thu@info@item{培养单位}{\thu@info@item@format{1bp}}{\thu@department}% - \thu@info@item{申请人}{\thu@name@title}{\thu@author}% - \thu@info@item{学号}{}{\thu@student@id}% - \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% - \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% - \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% - }\par -} -\newcommand\thu@titlepage@info@master@professional@with@field{% -} \newcommand\thu@titlepage@date{% \begingroup \sanhao @@ -2790,6 +2567,7 @@ {\sffamily\bfseries\thu@author@en\par}% \vskip 0.18cm% \parbox[t][3.0cm][t]{\textwidth}{% + \centering \xiaosan[2.1]% \thu@titlepage@en@supervisor }\par @@ -2818,6 +2596,7 @@ \vskip 1.1cm% \fi \parbox[t][3.37cm][t]{\textwidth}{% + \centering \xiaosan[1.82]% \thu@titlepage@en@supervisor }\par @@ -2851,7 +2630,6 @@ {\sffamily\bfseries\thu@degree@category@en\par}% } \newcommand\thu@titlepage@en@supervisor{% - \hspace{1.27cm}% \begin{tabular}{r@{\makebox[20.5bp][l]{\hspace{2bp}:}}l}% \renewcommand\arraystretch{1}% \thu@thesis@name@en{} Supervisor & \thu@supervisor@en \\ @@ -2890,7 +2668,11 @@ \centering \includegraphics{tsinghua-name-bachelor.pdf}% \vskip 0.94cm% - {\sffamily\bfseries\xiaochu\ziju{0.5}综合论文训练\par}% + \ifthu@thesis@type@proposal + {\sffamily\bfseries\xiaochu\ziju{0.5}综合论文训练\\开题报告\par}% + \else + {\sffamily\bfseries\xiaochu\ziju{0.5}综合论文训练\par}% + \fi \endgroup \vskip 1.8cm% \begingroup @@ -3482,6 +3264,7 @@ \thu@option@hook{cite-style}{\@nameuse{bibstyle@\thu@cite@style}} \@namedef{bibstyle@thuthesis-numeric}{\citestyle{super}} \@namedef{bibstyle@thuthesis-author-year}{\citestyle{author-year}} + \@namedef{bibstyle@cell}{\citestyle{author-year}} \@namedef{bibstyle@thuthesis-bachelor}{\citestyle{super}} \renewcommand\NAT@citesuper[3]{% \ifNAT@swa @@ -3856,54 +3639,116 @@ }% } \newcommand\thu@end@appendix@ref@section{} +\AtBeginOfPackageFile*{bibunits}{ + \def\bibliography#1{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}% + \immediate\write\@auxout{\string\gdef\string\bu@bibdata{#1}}% + \fi + \@input@{\jobname.bbl}% + \gdef\bu@bibdata{#1}% + } + \def\bibliographystyle#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}% + \gdef\bu@bibstyle{#1}% + } +} \AtEndOfPackageFile*{bibunits}{ - \ifthu@degree@graduate - \newcommand\thu@appendix@bib@num@format[1]{[\@Alph\c@chapter.#1]\hfill} - \g@addto@macro\appendix{% - \renewcommand\@bibunitname{\jobname-appendix-\@alph\c@chapter}% - \bibliographyunit[\chapter]% + \def\@startbibunit{% + \global\let\@startbibunitorrelax\relax + \global\let\@finishbibunit\@finishstartedbibunit + \global\advance\@bibunitauxcnt 1 + \if@filesw + {\endlinechar-1 + \makeatletter + \@input{\@bibunitname.aux}}% + \immediate\openout\@bibunitaux\@bibunitname.aux + \immediate\write\@bibunitaux{\string\bibstyle{\@localbibstyle}}% + \fi + } + \def\bu@bibliography#1{% + \putbib[#1]% + } + \def\bu@bibliographystyle#1{% + \if@filesw + \immediate\write\@bibunitaux{\string\gdef\string\@localbibstyle{#1}}% + \fi + \gdef\@localbibstyle{#1}% + } + \providecommand\printbibliography{\putbib\relax}% + \g@addto@macro\appendix{% + \renewcommand\@bibunitname{\jobname-appendix-\@alph\c@chapter}% + \bibliographyunit[\chapter]% + \renewcommand\bibsection{% + \ctexset{section/numbering = false}% + \section{\bibname}% + \ctexset{section/numbering = true}% + }% + \ifthu@degree@graduate \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\thu@appendix@bib@num@format - \let\bibliographystyle\defaultbibliographystyle - \let\bibliography\thu@appendix@bibliography - } - \renewcommand\thu@end@appendix@ref@section{% - \bibliographyunit\relax - } - \providecommand\printbibliography{\putbib\relax}% - \AtEndDocument{\thu@end@appendix@ref@section} - % \let\@xtestdef\@gobbletwo % This doesn't work - \def\bibunits@rerun@warning{\relax} - \fi + \renewcommand\bibnumfmt[1]{[\@Alph\c@chapter.#1]\hfill}% + \fi + } + \renewcommand\thu@end@appendix@ref@section{% + \bibliographyunit\relax + } + \AtEndDocument{\thu@end@appendix@ref@section} + \renewcommand\thu@set@survey@bibheading{% + \renewcommand\bibsection{% + \par + \vskip 20bp% + \thu@pdfbookmark{1}{\bibname}% + \begingroup + \centering + \xiaosi[1.667]\bibname\par + \endgroup + \vskip 6bp% + }% + }% + % \let\@xtestdef\@gobbletwo % This doesn't work + \def\bibunits@rerun@warning{\relax} } \PassOptionsToPackage{defernumbers = true}{biblatex} \AtEndOfPackageFile*{biblatex}{ - \ifthu@degree@graduate - \DeclareRefcontext{appendix}{} - \g@addto@macro\appendix{% - \pretocmd\chapter{% - \newrefsection + \DeclareRefcontext{appendix}{} + \g@addto@macro\appendix{% + \pretocmd\chapter{% + \newrefsection + \ifthu@degree@bachelor\else \@tempcnta=\c@chapter \advance\@tempcnta\@ne \newrefcontext[labelprefix = {\@Alph\@tempcnta.}]{appendix}% - }{}{\thu@patch@error{\chapter}}% - \defbibheading{bibliography}[\bibname]{% - \ctexset{section/numbering = false}% - \section{#1}% - \ctexset{section/numbering = true}% - }% - } - % \renewcommand\thu@end@appendix@ref@section{% - % \endrefsection - % } - \fi + \fi + }{}{\thu@patch@error{\chapter}}% + \defbibheading{bibliography}[\bibname]{% + \ctexset{section/numbering = false}% + \section{#1}% + \ctexset{section/numbering = true}% + }% + } + \renewcommand\thu@set@survey@bibheading{% + \defbibheading{bibliography}[\bibname]{% + \par + \vskip 20bp% + \thu@pdfbookmark{1}{\bibname}% + \begingroup + \centering + \xiaosi[1.667]##1\par + \endgroup + \vskip 6bp% + }% + }% + \def\bibliographystyle#1{% + \thu@warning{'bibliographystyle' invalid for 'biblatex'.}% + } } \@ifpackagelater{titletoc}{2019/07/14}{ \newcommand\thu@print@contents[5]{% @@ -3927,18 +3772,14 @@ \vskip 20bp% }% \let\appendix\thu@appendix@appendix + \thu@set@survey@bibheading \renewcommand\bibname{参考文献}% - \let\bibsection\thu@appendix@bibsection - \renewcommand\@bibunitname{\jobname-survey}% - \let\bibliographystyle\defaultbibliographystyle - \let\bibliography\thu@appendix@bibliography - \begin{bibunit}% \startcontents[survey]% }{% \stopcontents[survey]% - \end{bibunit}% \thu@reset@main@language % restore language } +\newcommand\thu@set@appendix@bib@heading{} \newenvironment{translation}{% \chapter{外文资料的书面翻译}% \thusetup{language = chinese}% @@ -3972,23 +3813,31 @@ \section{\bibname}% \endgroup }% - \renewcommand\@bibunitname{\jobname-translation}% - \let\bibliographystyle\defaultbibliographystyle - \let\bibliography\thu@appendix@bibliography - \begin{bibunit}% \startcontents[translation]% }{% \stopcontents[translation]% - \end{bibunit}% \thu@reset@main@language % restore language } -\newenvironment{translation-index}{% - \begin{bibunit}% - \renewcommand\@bibunitname{\jobname-index}% - \renewcommand\bibname{书面翻译对应的原文索引}% - \let\bibsection\thu@appendix@bibsection -}{% - \end{bibunit}% +\newenvironment{translation-index}{}{} +\AtEndOfPackageFile*{bibunits}{ + \renewenvironment{translation-index}{% + \begin{bibunit}% + \renewcommand\@bibunitname{\jobname-index}% + \renewcommand\bibname{书面翻译对应的原文索引}% + \thu@set@survey@bibheading + }{% + \end{bibunit}% + } +} +\AtEndOfPackageFile*{biblatex}{ + \renewenvironment{translation-index}{% + \endrefsection + \begin{refsection}% + \renewcommand\bibname{书面翻译对应的原文索引}% + \thu@set@survey@bibheading + }{% + \end{refsection}% + } } \DeclareRobustCommand\thu@appendix@title[1]{\gdef\thu@appendix@@title{#1}} \newcommand\thu@appendix@maketitle{% @@ -4018,17 +3867,7 @@ \setcounter{subsection}{0}% \renewcommand\thesection{\thechapter.\@Alph\c@section}% }% -\newcommand\thu@appendix@bibsection{% - \par - \vskip 20bp% - \thu@pdfbookmark{1}{\bibname}% - \begingroup - \centering - \xiaosi[1.667]\bibname\par - \endgroup - \vskip 6bp% -}% -\newcommand\thu@appendix@bibliography[1]{\putbib[#1]} +\newcommand\thu@set@survey@bibheading{} \newenvironment{resume}{% \@mainmatterfalse \thu@end@appendix@ref@section @@ -4181,7 +4020,7 @@ \renewcommand\thu@phantomsection{% \phantomsection } - \pdfstringdefDisableCommands{ + \pdfstringdefDisableCommands{% \let\\\relax \let\quad\relax \let\qquad\relax @@ -4422,26 +4261,6 @@ \clearpage \restoregeometry } -\newcommand\thu@input@spine{% - \IfFileExists{spine.pdf}{}{% - \immediate\write18{xelatex spine.tex}% - \IfFileExists{spine.pdf}{}{% - \thu@error{Cannot find file "spine.pdf". Compile "spine.tex" first, or enable shell escape}% - }% - }% - \includepdf[pages=1]{spine.pdf}% -} -\newcommand\thu@spine{% - \ifthu@cjk@font@fandol - \thu@input@spine - \else - \ifthu@cjk@font@noto - \thu@input@spine - \else - \spine - \fi - \fi -} \DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} \DeclareRobustCommand\file{\nolinkurl} \DeclareRobustCommand\env{\textsf} |