Skip to content
Snippets Groups Projects
Commit 4cd17424 authored by Yu Xiong's avatar Yu Xiong :confounded:
Browse files

feat: 用分支语句重写了封面多行标题的判断

parent a007ccff
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@
\tl_const:Nn \TitleA {曲率引擎的研究}% 第一行标题
\tl_const:Nn \TitleB {}% 第二行标题
\tl_const:Nn \TitleC {}% 第三行标题
\tl_const:Nn \Title {\TitleA\TitleB\TitleC}
\tl_const:Nn \Title_EN {Curvature~engine~research}
\tl_const:Nn \Grade {2017}
\tl_const:Nn \StudentID {17184xxx}
......@@ -18,5 +17,3 @@
\tl_const:Nn \MentorTitle {教授}
\tl_const:Nn \MentorTitle_EN {Professor}
\tl_const:Nn \SubmitDate {2077年12月31日}
\tl_const:Nn \Degree {UG}% 学位 本科:UG
\tl_const:Nn \Type {thesis}% thesis:毕业论文,design:毕业设计
\ No newline at end of file
......@@ -21,6 +21,8 @@
]{ctexbook}[2018/04/01]
\DeclareStringOption[1]{TitleLength}
\DeclareStringOption[UG]{Degree}
\DeclareStringOption[thesis]{Type}
\ProcessKeyvalOptions*\relax
......
\documentclass[
TitleLength=1,% 选择标题行数,范围是1~3
Degree=UG,% 学位 本科:UG
Type=thesis% thesis:毕业论文,design:毕业设计
]{njuthesis}
\addbibresource{njuthesis.bib}
......
\ProvidesExplPackage{profile/abstract}{2021-09-04}{0.1}{NJU Thesis Undergraduate abstract design}
\ProvidesExplPackage{profile/abstract}{2021-09-04}{0.1}{NJU Thesis Undergraduate abstract design}
% 拼合标题
\tl_const:Nn \Title {\TitleA\TitleB\TitleC}
% 摘要环境
\NewDocumentEnvironment{abstract} {}
......
......@@ -19,20 +19,21 @@
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\songti\Major}\\
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\
\int_compare:nNnTF { \TitleLength } = { 2 } {
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
}{}
\int_compare:nNnTF { \TitleLength } = { 3 } {
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleC}} \\
}{}
\int_case:nn {\TitleLength}
{
{ 1 } {
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\ }
{ 2 } {
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\
& \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\ }
{ 3 } {
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleA}} \\
& \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
& \cover_underline:nn {250pt}{\textbf{\songti\TitleC}} \\}
}
\end{tabular}\\
\begin{tabular}{p{4.2em}cp{4.2em}c}
......@@ -68,6 +69,10 @@
}
% 判断类型
\int_compare:nNnTF { \TitleLength } = { 2 } {
\coverbox:n {\hfill}
& \cover_underline:nn {250pt}{\textbf{\songti\TitleB}} \\
}{}
\ifthenelse{\equal{\Degree}{UG}}
{
\NewDocumentCommand \Degreename {} {\hfill\hfill\hfill }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment