Skip to content

Commit

Permalink
Update title settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu committed Jun 3, 2021
1 parent 9ad621b commit 12a6d91
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 66 deletions.
1 change: 0 additions & 1 deletion main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

% 原创性声明、版权授权页
\originalitypage
% 如果不需要在原创性声明页面显示论文名,请使用 \originalitypage*
\copyrightpage[scans/copyright.pdf]

% 使用罗马数字对前文编号
Expand Down
21 changes: 14 additions & 7 deletions sjtusetup.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@
info = {%
%
% 标题
% 可使用“\\”命令手动控制换行
%
title = {上海交通大学学位论文 \LaTeX{} 模板示例文档},
title* = {A Sample Document for \LaTeX-based SJTU Thesis Template},
%
% 标题页标题
% 可使用“\\”命令手动控制换行
%
% display-title = {上海交通大学学位论文\\ \LaTeX{} 模板示例文档},
% display-title* = {A Sample Document \\ for \LaTeX-based SJTU Thesis Template},
%
% 页眉标题
%
% running-title = {示例文档},
% running-title* = {Sample Document},
%
% 关键词
%
keywords = {上海交大, 饮水思源, 爱国荣校},
Expand Down Expand Up @@ -86,18 +96,15 @@
%
% 本科论文页眉 logo 颜色 (red/blue/black)
%
% header-logo-color = red,
%
% 本科论文封面 logo 颜色 (red/blue/black)
%
% title-logo-color = red
% header-logo-color = black,
},
%
% 名称设置
%
name = {
% bib = {References},
% acknowledgements = {谢\hspace{\ccwd}辞},
% publications = {攻读学位期间完成的论文},
% acknowledgements = {谢\hspace{\ccwd}辞},
},
}

Expand Down
22 changes: 16 additions & 6 deletions texmf/tex/latex/sjtuthesis/sjtuthesis-graduate.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@
}
\fancypagestyle{plain}{%
\fancyhf{}
\ifsjtu@style@header@single
\fancyhead[C]{\zihao{-5}\sjtu@name@subject@zh}
\if@twoside
\ifsjtu@style@header@single
\fancyhead[CO]{\zihao{-5}\sjtu@name@subject@zh}
\fancyhead[CE]{\zihao{-5}\leftmark}
\else
\fancyhead[RE,LO]{\zihao{-5}\sjtu@name@subject@zh}
\fancyhead[RO,LE]{\zihao{-5}\leftmark}
\fi
\else
\fancyhead[RE,LO]{\zihao{-5}\sjtu@name@subject@zh}
\fancyhead[RO,LE]{\zihao{-5}\leftmark}
\ifsjtu@style@header@single
\fancyhead[C]{\zihao{-5}\sjtu@name@subject@zh}
\else
\fancyhead[L]{\zihao{-5}\sjtu@name@subject@zh}
\fancyhead[R]{\zihao{-5}\leftmark}
\fi
\fi
\fancyfoot[C]{%
\ifsjtu@page@numbering
Expand Down Expand Up @@ -111,7 +121,7 @@
\vspace*{28pt}
{\zihao{-2}\sjtu@name@subject@zh\par}
\vskip \stretch{4}
{\zihao{2}\heiti\sjtu@info@title@zh\par}
{\zihao{2}\heiti\sjtu@info@display@title@zh\par}
\vskip \stretch{5}
\begingroup
\zihao{4}
Expand Down Expand Up @@ -143,7 +153,7 @@
\vspace*{28pt}
{\zihao{-2}\sjtu@name@subject@en\par}
\vskip \stretch{4}
{\zihao{2}\bfseries\MakeUppercase\sjtu@info@title@en\par}
{\zihao{2}\bfseries\MakeUppercase\sjtu@info@display@title@en\par}
\vskip \stretch{5}
\begingroup
\zihao{4}
Expand Down
13 changes: 6 additions & 7 deletions texmf/tex/latex/sjtuthesis/sjtuthesis-undergraduate.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
\fancyhead[R]{%
\parbox[b]{0.7\textwidth}{%
\raggedleft\zihao{-5}\heiti\MakeUppercase{\sjtu@info@title}
\raggedleft\zihao{-5}\heiti\MakeUppercase{\sjtu@info@running@title}
}
}
\fancyfoot[C]{%
Expand Down Expand Up @@ -117,7 +117,7 @@
\kaishu
\vspace*{48pt}
\begingroup
\includegraphics[height=96pt]%
\includegraphics[height=105pt]%
{sjtu-vi-name-\sjtu@style@title@logo@color.pdf}
\par
\endgroup
Expand All @@ -126,16 +126,15 @@
{\zihao{-2}\MakeUppercase\sjtu@name@subject@en\par}
\vskip 16pt
\begingroup
\includegraphics[height=86pt]%
\includegraphics[height=75pt]%
{sjtu-vi-badge-\sjtu@style@title@logo@color.pdf}
\par
\endgroup
\vskip \stretch{2}
\begingroup
\zihao{2}
\zihao{-2}
\begin{tabular}{@{}r@{\sjtu@colon}l@{}}
论文题目 &
\parbox[t]{280pt}{\centering\zihao{-2}\sjtu@uline\sjtu@info@title@zh}
论文题目 & \sjtu@title@box[300pt]{\sjtu@info@display@title@zh}
\end{tabular}
\par
\endgroup
Expand All @@ -155,7 +154,7 @@
\end{tabular}
\par
\endgroup
\vskip 32pt
\vskip 64pt
\end{center}
}
\endinput
Expand Down
111 changes: 66 additions & 45 deletions texmf/tex/latex/sjtuthesis/sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@
\sjtu@define@key{sjtu@info}{
title = { name = title@zh },
title* = { name = title@en },
display-title = { name = display@title@zh },
display-title* = { name = display@title@en },
running-title = { name = running@title@zh },
running-title* = { name = running@title@en },
keywords = { name = keywords@zh },
keywords* = { name = keywords@en },
author = { name = author@zh },
Expand All @@ -311,8 +315,21 @@
initial = {\the\year-\two@digits{\month}-\two@digits{\day}},
},
}
\newcommand\sjtu@nopar[1]{%
\begingroup\let\\\@empty#1\endgroup%
\sjtu@option@hook{sjtu@info}{title}{%
\ifx\sjtu@info@display@title@zh\@empty
\global\let\sjtu@info@display@title@zh\sjtu@info@title@zh
\fi
\ifx\sjtu@info@running@title@zh\@empty
\global\let\sjtu@info@running@title@zh\sjtu@info@title@zh
\fi
}
\sjtu@option@hook{sjtu@info}{title*}{%
\ifx\sjtu@info@display@title@en\@empty
\global\let\sjtu@info@display@title@en\sjtu@info@title@en
\fi
\ifx\sjtu@info@running@title@en\@empty
\global\let\sjtu@info@running@title@en\sjtu@info@title@en
\fi
}
\newcommand\sjtu@clist@use[2]{%
\def\sjtu@@tmp{}%
Expand All @@ -328,10 +345,14 @@
}
\ifsjtu@language@chinese
\def\sjtu@info@title{\sjtu@info@title@zh}
\def\sjtu@info@display@title{\sjtu@info@display@title@zh}
\def\sjtu@info@running@title{\sjtu@info@running@title@zh}
\def\sjtu@info@keywords{\sjtu@info@keywords@zh}
\def\sjtu@info@author{\sjtu@info@author@zh}
\else
\def\sjtu@info@title{\sjtu@info@title@en}
\def\sjtu@info@display@title{\sjtu@info@display@title@en}
\def\sjtu@info@running@title{\sjtu@info@running@title@en}
\def\sjtu@info@keywords{\sjtu@info@keywords@en}
\def\sjtu@info@author{\sjtu@info@author@en}
\fi
Expand Down Expand Up @@ -408,7 +429,6 @@
\sjtu@name@def{conferring@zh}{授予学位单位}
\sjtu@name@def{conferring@en}{Degree-Conferring-Institution}
\sjtu@name@def{thesis@type}{学位论文}
\sjtu@name@def{thesis@kind}{\sjtu@name@thesis@type}
\sjtu@name@def{subject@zh}{%
\sjtu@name@school@zh\sjtu@name@degree@type@zh\sjtu@name@thesis@type
}
Expand All @@ -421,14 +441,12 @@
\sjtu@name@def{degree@type@zh}{}
\sjtu@name@def{degree@type@en}{}
\sjtu@name@def{thesis@type}{课程论文}
\sjtu@name@def{thesis@kind}{\sjtu@name@thesis@type}
\sjtu@name@def{subject@zh}{\sjtu@name@thesis@type}
\sjtu@name@def{subject@en}{Course Paper}
\else
\sjtu@name@def{degree@type@zh}{学士}
\sjtu@name@def{degree@type@en}{Bachelor}
\sjtu@name@def{thesis@type}{学位论文}
\sjtu@name@def{thesis@kind}{学位论文}
\sjtu@name@def{subject@zh}{\sjtu@name@degree@type@zh\sjtu@name@thesis@type}
\sjtu@name@def{subject@en}{\sjtu@name@degree@type@en's Thesis}
\fi
Expand All @@ -444,22 +462,21 @@
\sjtu@name@def{orig@subtitle@en}{Declaration of Originality}
\sjtu@name@def{copr@subtitle@zh}{版权使用授权书}
\sjtu@name@def{copr@subtitle@en}{Copyright Authorization}
\sjtu@name@def{orig@title}{\sjtu@name@thesis@kind\sjtu@name@orig@subtitle@zh}
\sjtu@name@def{copr@title}{\sjtu@name@thesis@kind\sjtu@name@copr@subtitle@zh}
\sjtu@name@def{title@qouted}{《\sjtu@nopar\sjtu@info@title@zh》}
\sjtu@name@def{orig@title}{\sjtu@name@thesis@type\sjtu@name@orig@subtitle@zh}
\sjtu@name@def{copr@title}{\sjtu@name@thesis@type\sjtu@name@copr@subtitle@zh}
\sjtu@name@def{origbody}{%
本人郑重声明:所呈交的\sjtu@name@thesis@kind\sjtu@name@title@qouted
本人郑重声明:所呈交的\sjtu@name@thesis@type\sjtu@info@title@zh
是本人在导师的指导下,独立进行研究工作所取得的成果。除文中已经注明引用
的内容外,本论文不包含任何其他个人或集体已经发表或撰写过的作品成果。对
本文的研究做出重要贡献的个人和集体,均已在文中以明确方式标明。本人完全
意识到本声明的法律结果由本人承担。}
\sjtu@name@def{coprbody}{%
\sjtu@name@thesis@kind 作者
完全了解学校有关保留、使用\sjtu@name@thesis@kind 的规定,同意学校保留
\sjtu@name@thesis@type 作者
完全了解学校有关保留、使用\sjtu@name@thesis@type 的规定,同意学校保留
并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。
本人授权\sjtu@name@school@zh 可以将本\sjtu@name@thesis@kind 的全部或部
本人授权\sjtu@name@school@zh 可以将本\sjtu@name@thesis@type 的全部或部
分内容编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和
汇编本\sjtu@name@thesis@kind 。}
汇编本\sjtu@name@thesis@type 。}
\sjtu@name@def{abstract@zh}{摘\hspace{\ccwd}要}
\sjtu@name@def{abstract@en}{Abstract}
\sjtu@name@def{keywords@zh}{关键词:}
Expand Down Expand Up @@ -817,34 +834,27 @@
}
\captionsetup[bi-second]{bi-second}
\newcommand\sjtu@copr@addon{%
\vskip 2ex
\begingroup
\linespread{1}\selectfont
\sjtu@name@thesis@type 属于\parbox[c]{20\ccwd}{%
{\heiti\hspace{1\ccwd}密}~\sjtu@square
\underline{\hspace{2\ccwd}}年解密后适用本授权书。\bigbreak
{\heiti 不保密}~\sjtu@square
}\par
\endgroup
\vskip 2ex
\phantom{本\sjtu@name@thesis@type 属于}%
{\bfseries\hspace{1\ccwd}密}~\sjtu@square%
\underline{\hspace{2\ccwd}}年解密后适用本授权书。\par
\sjtu@name@thesis@type 属于\par
\phantom{本\sjtu@name@thesis@type 属于}%
{\bfseries 不保密}~\sjtu@square\par
(请在以上方框内打“$\checkmark$”)
}
\newcommand\sjtu@signbox[1]{%
\parbox{.45\textwidth}{%
#1 签名:\vskip 4em
{#1}签名:\vskip 4em
日期:\hspace{\stretch{3}}年\hspace{\stretch{2}}月\hspace{\stretch{2}}日
}
}
\NewDocumentCommand{\originalitypage}{s O{}}{%
\NewDocumentCommand{\originalitypage}{O{}}{%
\ifsjtu@review\relax\else
\cleardoublepage
\ifblank{#2}{%
\ifblank{#1}{%
\thispagestyle{empty}
\sjtu@chapter*[\sjtu@name@orig@subtitle]{%
\zihao{-2}\sjtu@name@school@zh\\\sjtu@name@orig@title
}
\IfBooleanT{#1}{%
\let\sjtu@name@title@qouted\@empty
\zihao{-2}\sjtu@name@school@zh\\[6pt]\sjtu@name@orig@title
}
\begingroup
\zihao{4}
Expand All @@ -863,7 +873,7 @@
}{%
\includepdf[pagecommand={%
\sjtu@pdfbookmark{0}{\sjtu@name@orig@subtitle}%
}]{#2}
}]{#1}
}
\fi
}
Expand All @@ -873,7 +883,7 @@
\ifblank{#1}{%
\thispagestyle{empty}
\sjtu@chapter*[\sjtu@name@copr@subtitle]{%
\zihao{-2}\sjtu@name@school@zh\\\sjtu@name@copr@title
\zihao{-2}\sjtu@name@school@zh\\[6pt]\sjtu@name@copr@title
}
\begingroup
\zihao{4}
Expand Down Expand Up @@ -1021,19 +1031,30 @@
{#1}
\fi
}
\newcommand\sjtu@uline[1]{%
\begingroup
\setbox0=\vbox{\strut #1\strut}%
\dimen0=0pt
\loop\ifdim\ht0>0pt
\dimen1=\dimexpr\ht0 - \baselineskip\relax
\setbox1=\vsplit0 to \ht\strutbox
\advance\dimen1 by -\ht0
\noindent\raisebox{-\dimen0}[\ht\strutbox][\dp\strutbox]{\box1}%
\advance\dimen0 by \dimen1
\vspace{-0.2ex}\hrule\vskip 0.2ex
\repeat
\endgroup
\newcommand\sjtu@title@box[2][]{%
\def\sjtu@@title@uline{\rule[-1ex]{#1}{.5pt}}%
\def\sjtu@@title@box##1{\parbox[t]{#1}{##1}}%
\newlength\sjtu@@title@temp@ht
\settototalheight\sjtu@@title@temp@ht{\sjtu@@title@box{#2}}%
\ifdim\sjtu@@title@temp@ht=0pt%
\sjtu@@title@uline%
\else
\leavevmode%
\ifdim\sjtu@@title@temp@ht>\normalbaselineskip
\rlap{\smash{\sjtu@@title@box{%
\@whiledim\sjtu@@title@temp@ht>0pt%
\leavevmode%
\do{%
\rlap{\sjtu@@title@uline}\\%
\addtolength\sjtu@@title@temp@ht{-\normalbaselineskip}%
}%
}}}%
\sjtu@@title@box{\centering #2}%
\else
\rlap{\sjtu@@title@uline}%
\sjtu@@title@box{\centering #2}%
\fi
\fi
}
\newcolumntype{F}[2]{%
>{\minipage[#1]{#2}%
Expand Down

0 comments on commit 12a6d91

Please sign in to comment.