Skip to content

Commit

Permalink
feat: 新增添加第二导师的选项
Browse files Browse the repository at this point in the history
  • Loading branch information
atxy-blip committed Sep 10, 2021
1 parent 178555d commit e70233b
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 30 deletions.
30 changes: 24 additions & 6 deletions coverinfo.tex
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
% 设置用于封面的个人信息
%----------------------------------------
% 个人信息
%----------------------------------------

% 标题
\setTitleA{一种使用南京大学\hologo{LaTeX}模版}%第一行标题
\setTitleB{编写本科生毕业论文的经验性方法}%第二行标题
\setTitleC{}%第三行标题
\setTitleC{没有第三行就不用填这个哦}%第三行标题
\setTitleEN{An~Empirical~Way~of~Composing~Undergraduate~Thesis~with~NJU~\hologo{LaTeX}~Template}%注意英文名中空格必须替换为波浪线

% 姓名学号
\setGrade{2018}
\setStudentID{181114514}
\setStudentName{周煜华}
\setStudentNameEN{Zhou~Yuhua}

% 院系专业
\setDepartment{拉太赫科学与技术学院}
\setDepartmentEN{School~of~\hologo{LaTeX}}
\setMajor{拉太赫语言学}
\setMajorEN{\hologo{LaTeX}~Linguistics}
\setMentor{李成殿}
\setMentorEN{Li~Chengdian}
\setMentorTitle{教授}
\setMentorTitleEN{Professor}

% 导师
\setMentorA{李成殿}
\setMentorAEN{Li~Chengdian}
\setMentorATitle{教授}
\setMentorATitleEN{Professor}

% 第二导师
\setMentorB{孙赫弥}
\setMentorBEN{Sun~Hemi}
\setMentorBTitle{副教授}
\setMentorBTitleEN{Associate professor}

% 提交时间
\setSubmitDate{2021年8月10日}
1 change: 1 addition & 0 deletions njuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
]{ctexbook}[2018/04/01]

\DeclareStringOption[1]{titlelength}
\DeclareBoolOption[false]{secondsupervisor}
\DeclareStringOption[UG]{degree}
\DeclareStringOption[thesis]{type}
\DeclareBoolOption[true]{systemfont}
Expand Down
9 changes: 5 additions & 4 deletions njuthesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[
titlelength=2,% 选择标题行数,范围是1~3
% degree=UG,% UG: 本科
% secondsupervisor=true,% 有第二导师请反注释此项
% degree=UG,% UG: 本科 本项不需更改
type=thesis,% thesis: 毕业论文,design: 毕业设计
systemfont=false,% 自定义字体请反注释此项
customlatinfont=windows,% 设置英文字符集
customchinesefont=windows,% 设置中文字符集
% systemfont=false,% 自定义字体请反注释此项
% customlatinfont=windows,% 设置英文字符集
% customchinesefont=windows,% 设置中文字符集
]{njuthesis}

% 输入个人信息
Expand Down
14 changes: 12 additions & 2 deletions profile/abstract.sty
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
院系: \Department \\
专业: \Major \\
本科生姓名: \StudentName \\
指导教师(姓名、职称): \Mentor\ \MentorTitle \\
指导教师(姓名、职称): \MentorA\ \MentorATitle
% 第二导师
\ifnju@secondsupervisor
\ \MentorB\ \MentorBTitle
\fi
\\
摘要:
\egroup
}
Expand Down Expand Up @@ -49,7 +54,12 @@
DEPARTMENT: ~~\Department_EN \\
SPECIALIZATION: ~~\Major_EN \\
UNDERGRADUATE:~~\StudentName_EN \\
MENTOR:~~\Mentor_EN \ \MentorTitle_EN\\
MENTOR:~~\MentorA_EN \ \MentorATitle_EN
% 第二导师
\ifnju@secondsupervisor
\ \MentorB_EN\ \MentorBTitle_EN
\fi
\\
ABSTRACT:
\egroup
}
Expand Down
42 changes: 26 additions & 16 deletions profile/cover.sty
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,28 @@
\NewDocumentCommand\setTitleA{m}{\tl_const:Nn \TitleA {#1}}% 第一行标题
\NewDocumentCommand\setTitleB{m}{\tl_const:Nn \TitleB {#1}}% 第二行标题
\NewDocumentCommand\setTitleC{m}{\tl_const:Nn \TitleC {#1}}% 第三行标题
\NewDocumentCommand\setTitleEN{m}{\tl_const:Nn \Title_EN {#1}} % 注意英文名中空格必须替换为波浪线
\NewDocumentCommand\setTitleEN{m}{\tl_const:Nn \Title_EN {#1}}

\NewDocumentCommand\setGrade{m}{\tl_const:Nn \Grade {#1}}
\NewDocumentCommand\setStudentID{m}{\tl_const:Nn \StudentID {#1}}
\NewDocumentCommand\setStudentName{m}{\tl_const:Nn \StudentName {#1}}
\NewDocumentCommand\setStudentNameEN{m}{\tl_const:Nn \StudentName_EN {#1}}

\NewDocumentCommand\setDepartment{m}{\tl_const:Nn \Department {#1}}
\NewDocumentCommand\setDepartmentEN{m}{\tl_const:Nn \Department_EN {#1}}
\NewDocumentCommand\setMajor{m}{\tl_const:Nn \Major {#1}}
\NewDocumentCommand\setMajorEN{m}{\tl_const:Nn \Major_EN {#1}}
\NewDocumentCommand\setMentor{m}{\tl_const:Nn \Mentor {#1}}
\NewDocumentCommand\setMentorEN{m}{\tl_const:Nn \Mentor_EN {#1}}
\NewDocumentCommand\setMentorTitle{m}{\tl_const:Nn \MentorTitle {#1}}
\NewDocumentCommand\setMentorTitleEN{m}{\tl_const:Nn \MentorTitle_EN {#1}}

\NewDocumentCommand\setMentorA{m}{\tl_const:Nn \MentorA {#1}}
\NewDocumentCommand\setMentorAEN{m}{\tl_const:Nn \MentorA_EN {#1}}
\NewDocumentCommand\setMentorATitle{m}{\tl_const:Nn \MentorATitle {#1}}
\NewDocumentCommand\setMentorATitleEN{m}{\tl_const:Nn \MentorATitle_EN {#1}}

\NewDocumentCommand\setMentorB{m}{\tl_const:Nn \MentorB {#1}}
\NewDocumentCommand\setMentorBEN{m}{\tl_const:Nn \MentorB_EN {#1}}
\NewDocumentCommand\setMentorBTitle{m}{\tl_const:Nn \MentorBTitle {#1}}
\NewDocumentCommand\setMentorBTitleEN{m}{\tl_const:Nn \MentorBTitle_EN {#1}}

\NewDocumentCommand\setSubmitDate{m}{\tl_const:Nn \SubmitDate {#1}}

% 拼合标题
Expand All @@ -41,6 +50,7 @@
\coverbox:n {专\hfill 业}
& \cover_underline:nn {250pt}{\songti\Major}\\

% 标题换行
\int_case:nn {\nju@titlelength}
{
{ 1 } {
Expand Down Expand Up @@ -71,19 +81,19 @@
\end{tabular}\\
\begin{tabular}{p{4.2em}cp{4.2em}c}
\coverbox:n {导\hfill 师}
& \cover_underline:nn {90pt}{\Mentor}
& \cover_underline:nn {90pt}{\MentorA}
& \coverbox:n {职\hfill 称}
& \cover_underline:nn {90pt}{\MentorATitle}\\

% 第二导师
\ifnju@secondsupervisor
\coverbox:n {第\hfill\hfill\hfill 师}
& \cover_underline:nn {90pt}{\MentorB}
& \coverbox:n {职\hfill 称}
& \cover_underline:nn {90pt}{\MentorTitle}\\
& \cover_underline:nn {90pt}{\MentorBTitle}\\
\fi
\end{tabular}\\
% % 第二导师
% \ifnjut@title@twosupervisors
% \begin{tabular}{p{4.2em}cp{4.2em}c}
% \coverbox:n {\njut@cap@cover@secondsupervisor}
% & \njutunderline[90pt]{\songti\njut@value@secondsupervisor}
% & \coverbox:n {\njut@cap@cover@secondsupervisortitle}
% & \njutunderline[90pt]{\songti\njut@value@secondsupervisortitle}\\
% \end{tabular}
% \fi

\begin{tabular}{p{4.2em}c}
\coverbox:n {提\hfill\hfill\hfill 期}
& \cover_underline:nn {250pt}{\SubmitDate}\\
Expand Down
5 changes: 3 additions & 2 deletions profile/font.sty
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@
\setCJKfamilyfont{zhkai}{方正楷体简体}[AutoFakeBold=2.17]
}

% 根据操作系统选择相应字体
% 字体判断
\ifnju@systemfont
% 根据操作系统自动选择相应字体
% 检测是否是 Windows
\sys_if_platform_windows:TF
{
Expand All @@ -181,7 +182,7 @@
\set_chinese_fontset_fandol
}
}
\else% 如果用户需要自定义
\else% 如果用户需要自定义字体
% 此处需要使用\str_case_e而不是\str_case使宏展开为字符串
\str_case_e:nn { \nju@customlatinfont }
{
Expand Down

0 comments on commit e70233b

Please sign in to comment.