From e70233bb8acfbee357bc4073c1704c62ddf1de9a Mon Sep 17 00:00:00 2001 From: atxy <181850195@smail.nju.edu.cn> Date: Fri, 10 Sep 2021 15:06:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E5=AF=BC=E5=B8=88=E7=9A=84=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coverinfo.tex | 30 ++++++++++++++++++++++++------ njuthesis.cls | 1 + njuthesis.tex | 9 +++++---- profile/abstract.sty | 14 ++++++++++++-- profile/cover.sty | 42 ++++++++++++++++++++++++++---------------- profile/font.sty | 5 +++-- 6 files changed, 71 insertions(+), 30 deletions(-) diff --git a/coverinfo.tex b/coverinfo.tex index 7063324..f6ac560 100644 --- a/coverinfo.tex +++ b/coverinfo.tex @@ -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日} diff --git a/njuthesis.cls b/njuthesis.cls index 8a847e4..920fe85 100644 --- a/njuthesis.cls +++ b/njuthesis.cls @@ -21,6 +21,7 @@ ]{ctexbook}[2018/04/01] \DeclareStringOption[1]{titlelength} +\DeclareBoolOption[false]{secondsupervisor} \DeclareStringOption[UG]{degree} \DeclareStringOption[thesis]{type} \DeclareBoolOption[true]{systemfont} diff --git a/njuthesis.tex b/njuthesis.tex index 83718ee..e2d2df1 100644 --- a/njuthesis.tex +++ b/njuthesis.tex @@ -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} % 输入个人信息 diff --git a/profile/abstract.sty b/profile/abstract.sty index 824dd46..d86b8ea 100644 --- a/profile/abstract.sty +++ b/profile/abstract.sty @@ -19,7 +19,12 @@ 院系: \Department \\ 专业: \Major \\ 本科生姓名: \StudentName \\ - 指导教师(姓名、职称): \Mentor\ \MentorTitle \\ + 指导教师(姓名、职称): \MentorA\ \MentorATitle + % 第二导师 + \ifnju@secondsupervisor + \ \MentorB\ \MentorBTitle + \fi + \\ 摘要: \egroup } @@ -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 } diff --git a/profile/cover.sty b/profile/cover.sty index 424c178..3431c91 100644 --- a/profile/cover.sty +++ b/profile/cover.sty @@ -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}} % 拼合标题 @@ -41,6 +50,7 @@ \coverbox:n {专\hfill 业} & \cover_underline:nn {250pt}{\songti\Major}\\ + % 标题换行 \int_case:nn {\nju@titlelength} { { 1 } { @@ -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}\\ diff --git a/profile/font.sty b/profile/font.sty index 8db43c0..13dcd30 100644 --- a/profile/font.sty +++ b/profile/font.sty @@ -160,8 +160,9 @@ \setCJKfamilyfont{zhkai}{方正楷体简体}[AutoFakeBold=2.17] } -% 根据操作系统选择相应字体 +% 字体判断 \ifnju@systemfont +% 根据操作系统自动选择相应字体 % 检测是否是 Windows \sys_if_platform_windows:TF { @@ -181,7 +182,7 @@ \set_chinese_fontset_fandol } } -\else% 如果用户需要自定义 +\else% 如果用户需要自定义字体 % 此处需要使用\str_case_e而不是\str_case使宏展开为字符串 \str_case_e:nn { \nju@customlatinfont } {