Skip to content

Commit

Permalink
优化标题页信息栏 (sjtug#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu authored and gaocegege committed Nov 5, 2018
1 parent 93d0fac commit c60157b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
26 changes: 9 additions & 17 deletions sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
}
}
\RequirePackage{hyperref}
\pdfstringdefDisableCommands{%
\let\\\@empty%
\let\sjtu@title@handler\@empty}

%==========
% Segment 2. Define general-purpose LaTeX commands.
Expand Down Expand Up @@ -404,19 +407,10 @@

\renewcommand\maketitle{%
\pdfbookmark[0]{\sjtu@titlepage}{titlepage}
\newgeometry{
paper = a4paper,
top = 3.5cm,
bottom = 3.0cm,
left = 3.3cm,
right = 2.8cm,
}
\ifsjtu@bachelor
\makechinesetitle@bachelor
\restoregeometry
\else
\makechinesetitle
\restoregeometry
\makeenglishtitle
\fi
}
Expand All @@ -428,8 +422,8 @@
{
\seq_set_split:Nnn \l__sjtu_tmp_seq { #1 } { #2 }
\seq_pop_right:NN \l__sjtu_tmp_seq \l__sjtu_tmp_tl
\seq_map_inline:Nn \l__sjtu_tmp_seq { \underline { \makebox [ 320pt ] { ##1 } } \\ }
\underline { \makebox [ 320pt ] { \l__sjtu_tmp_tl } }
\seq_map_inline:Nn \l__sjtu_tmp_seq { \underline { \makebox [ 300pt ] { ##1 } } \\ }
\underline { \makebox [ 300pt ] { \l__sjtu_tmp_tl } }
}
\NewDocumentCommand{ \sjtu@title@handler } { O { \\ } m }
{
Expand All @@ -452,22 +446,21 @@
\begin{tabular}{>{\begin{CJKfilltwosides}{4\ccwd}\heiti}r<{\end{CJKfilltwosides}}@{:}c}
\ifsjtu@review
\sjtu@label@author & \\ \cline{2-2}
\sjtu@label@studentnumber & \\ \cline{2-2}
\sjtu@label@studentnumber & \makebox[150pt]{} \\ \cline{2-2}
\sjtu@label@advisor & \\ \cline{2-2}
\ifx\sjtu@value@coadvisor\undefined\else
\sjtu@label@coadvisor & \\ \cline{2-2}
\fi
\else
\sjtu@label@author & \sjtu@value@author \\ \cline{2-2}
\sjtu@label@studentnumber & \sjtu@value@studentnumber \\ \cline{2-2}
\sjtu@label@studentnumber & \makebox[150pt]{\sjtu@value@studentnumber} \\ \cline{2-2}
\sjtu@label@advisor & \sjtu@value@advisor \\ \cline{2-2}
\ifx\sjtu@value@coadvisor\undefined\else
\sjtu@label@coadvisor & \sjtu@value@coadvisor \\ \cline{2-2}
\fi
\fi
\sjtu@label@major & \sjtu@value@major \\ \cline{2-2}
\sjtu@label@defenddate & \sjtu@value@defenddate \\ \cline{2-2}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{\phantom{一二三四一二三四一二三四}}
\end{tabular}
\vskip 30pt
\end{center}
Expand Down Expand Up @@ -535,10 +528,10 @@
\begin{tabular}{>{\begin{CJKfilltwosides}{4\ccwd}}r<{\end{CJKfilltwosides}}@{:}c}
\ifsjtu@review
\sjtu@label@author & \\ \cline{2-2}
\sjtu@label@studentnumber & \\ \cline{2-2}
\sjtu@label@studentnumber & \makebox[180pt]{} \\ \cline{2-2}
\else
\sjtu@label@author & \sjtu@value@author \\ \cline{2-2}
\sjtu@label@studentnumber & \sjtu@value@studentnumber \\ \cline{2-2}
\sjtu@label@studentnumber & \makebox[180pt]{\sjtu@value@studentnumber} \\ \cline{2-2}
\fi
\sjtu@label@major & \sjtu@value@major \\ \cline{2-2}
\ifsjtu@review
Expand All @@ -547,7 +540,6 @@
\sjtu@label@advisor & \sjtu@value@advisor \\ \cline{2-2}
\fi
\sjtu@label@institute & \sjtu@value@institute \\ \cline{2-2}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{\phantom{一二三四一二三四一二}}
\end{tabular}
}
\end{center}
Expand Down
2 changes: 1 addition & 1 deletion tex/id.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% !TEX program = xelatex
% !TEX root = ../thesis.tex
% !TEX encoding = UTF-8 Unicode
\title{上海交通大学学位论文 \LaTeX 模板示例文档}
\title{上海交通大学学位论文 \\ \LaTeX{} 模板示例文档}
\author{某\quad{}某}
\advisor{某某教授}
% \coadvisor{某某教授}
Expand Down

0 comments on commit c60157b

Please sign in to comment.