Skip to content

Commit

Permalink
WIP(UT): make cover
Browse files Browse the repository at this point in the history
  • Loading branch information
fky2015 committed Jul 4, 2022
1 parent e330458 commit f7a20a8
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
80 changes: 80 additions & 0 deletions templates/undergraduate-thesis/bitundergrad.cls
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
{
info .meta:nn = { bitundergrad / info } {#1},
misc .meta:nn = { bitundergrad / misc } {#1},
cover .meta:nn = { bitundergrad / cover } {#1},
style .meta:nn = { bitundergrad / style } {#1}
}

Expand All @@ -58,6 +59,7 @@
name .tl_set:N = \l_bit_name_tl,
studentId .tl_set:N = \l_bit_studentid_tl,
mentor .tl_set:N = \l_bit_mentor_tl,
externalMentor .tl_set:N = \l_bit_externalmentor_tl,
}

\keys_define:nn { bitundergrad / misc }
Expand Down Expand Up @@ -227,9 +229,87 @@
\stepcounter{chapter}
}

% Usage: \dunderline{<line_thickness>}{<text>}
% \cs_set:Npn \dunderline #1#2 {
% {
% \setbox0=\hbox{-10pt}
% \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}
% }
% }
\newcommand\dunderline[3][-1pt]{{%
\setbox0=\hbox{#3}
\ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}}}

\DeclareDocumentCommand \MakeCover {}
{
\group_begin:

\begin{titlepage}
% \tl_new:N \l_bit_externalmentor_tl
\tl_if_blank:VTF \l_bit_externalmentor_tl {
\vspace*{19mm}
}{
\vspace*{13mm}
}

\centering

\tl_if_blank:VTF \l_bit_coverheaderimage_tl {} {
\includegraphics[width=9.87cm]{images/header.png}\\
}

\vspace*{-3mm}

\zihao{-0}\textbf{\ziju{0.12}\songti{本科生毕业设计(论文)}}\par

\vspace{16mm}

\zihao{2}\textbf{\xihei\l_bit_title_tl}\par

\vspace{3mm}

\begin{spacing}{1.2}
\zihao{3}\selectfont{\textbf{\l_bit_titleen_tl}}\par
\end{spacing}

\vspace{15mm}

\flushleft

\tl_if_blank:VTF \l_bit_externalmentor_tl {
% 生成校内毕设封面字段
\begin{spacing}{1.8}
\hspace{27mm}\songti\zihao{3}\selectfont{学\hspace{11mm}院:\dunderline[-10pt]{1pt}{\makebox[78mm][c]{\l_bit_dept_tl}}}\par

\hspace{27mm}\songti\zihao{3}\selectfont{专\hspace{11mm}业:\dunderline[-10pt]{1pt}{\makebox[78mm][c]{\l_bit_major_tl}}}\par

\hspace{27mm}\songti\zihao{3}\selectfont{学生姓名:\dunderline[-10pt]{1pt}{\makebox[78mm][c]{\l_bit_name_tl}}}\par

\hspace{27mm}\songti\zihao{3}\selectfont{学\hspace{11mm}号:\dunderline[-10pt]{1pt}{\makebox[78mm][c]{\l_bit_studentid_tl}}}\par

\hspace{27mm}\songti\zihao{3}\selectfont{指导教师:\dunderline[-10pt]{1pt}{\makebox[78mm][c]{\l_bit_mentor_tl}}}\par
\end{spacing}
}{
% 生成校外毕设封面字段
\begin{spacing}{1.8}
\hspace{19.4mm}\songti\zihao{3}\selectfont{学\hspace{19.6mm}院\hspace{3mm}:\dunderline[-10pt]{1pt}{\makebox[77.4mm][c]{\l_bit_dept_tl}}}\par

\hspace{19.4mm}\songti\zihao{3}\selectfont{专\hspace{19.6mm}业\hspace{3mm}:\dunderline[-10pt]{1pt}{\makebox[77.4mm][c]{\l_bit_major_tl}}}\par

\hspace{19.4mm}\songti\zihao{3}\selectfont{学\hspace{2.8mm}生\hspace{2.8mm}姓\hspace{2.8mm}名\hspace{3mm}:\dunderline[-10pt]{1pt}{\makebox[77.4mm][c]{\l_bit_name_tl}}}\par

\hspace{19.4mm}\songti\zihao{3}\selectfont{学\hspace{19.6mm}号\hspace{3mm}:\dunderline[-10pt]{1pt}{\makebox[77.4mm][c]{\l_bit_studentid_tl}}}\par

\hspace{19.4mm}\songti\zihao{3}\selectfont{指\hspace{2.8mm}导\hspace{2.8mm}教\hspace{2.8mm}师\hspace{3mm}:\dunderline[-10pt]{1pt}{\makebox[77.4mm][c]{\l_bit_mentor_tl}}}\par

\hspace{19.4mm}\songti\zihao{3}\selectfont{校外指导教师:\dunderline[-10pt]{1pt}{\makebox[77.4mm][c]{\l_bit_externalmentor_tl}}}\par
\end{spacing}
}

\vspace*{\fill}
\centering
\zihao{3}\ziju{0.5}\songti{\today}
\end{titlepage}
\group_end:
}

Expand Down
7 changes: 6 additions & 1 deletion templates/undergraduate-thesis/main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
% 如果想要修改样式,但无法找到样式在哪里定义:请参考 https://bithesis.bitnp.net/Guide/4-Others/Troubleshooting.html#%E6%83%B3%E8%A6%81%E4%BF%AE%E6%94%B9%E9%83%A8%E5%88%86%E6%A0%B7%E5%BC%8F-%E4%BD%86%E6%98%AF%E6%89%BE%E4%B8%8D%E5%88%B0%E6%A0%B7%E5%BC%8F%E5%9C%A8%E5%93%AA%E9%87%8C%E5%AE%9A%E4%B9%89

\BITUndergraduateThesisSetup{
cover = {
headerImage = images/header.png,
},
info = {
title = 北京理工大学本科生毕业设计(论文)题目,
TITLE = {The Subject of Undergraduate Graduation Project (Thesis) of Beijing Institute of Technology},
Expand All @@ -32,6 +35,7 @@
name = 惠计算,
studentId = 11xxxxxxxx,
mentor = 张哈希,
% externalMentor = 左偏树,
}
}

Expand Down Expand Up @@ -97,7 +101,8 @@
\begin{document}

% 标题页面:如无特殊需要,本部分无需改动
\input{misc/0_cover.tex}
% \input{misc/0_cover.tex}
\MakeCover

% 前置页面定义
\frontmatter
Expand Down

0 comments on commit f7a20a8

Please sign in to comment.