Skip to content

Commit

Permalink
Rename degree' option to type'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu committed Jul 20, 2020
1 parent ffe6cb8 commit ae20e82
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 33 deletions.
4 changes: 2 additions & 2 deletions main.tex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
% !TeX encoding = UTF-8

% 载入 SJTUThesis 模版
\documentclass[degree=master]{sjtuthesis}
\documentclass[type=master]{sjtuthesis}
% 选项
% degree=[doctor|master|bachelor|course], % 可选(默认:doctor),学位类型
% type=[doctor|master|bachelor|course], % 可选(默认:doctor),学位类型
% zihao=[-4|5], % 可选(研究生默认:-4,本科默认:5),正文字号大小
% language=[chinese|english], % 可选(默认:chinese),论文的主要语言
% review, % 可选(默认:关闭),盲审模式
Expand Down
2 changes: 1 addition & 1 deletion sjtusetup.tex
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
% 课程名称
% 仅课程论文适用
%
coursename = {某某课程},
course = {某某课程},
%
% 答辩日期
% 使用 ISO 格式;默认为当前时间
Expand Down
19 changes: 9 additions & 10 deletions texmf/tex/latex/sjtuthesis/sjtuthesis-undergraduate.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
\renewcommand\cftchapfont{\normalfont}
\renewcommand\cftchapleader{\normalfont\cftdotfill{\cftdotsep}}
\renewcommand\cftchappagefont{\normalfont}
\ifsjtu@degree@bachelor
\ifsjtu@type@bachelor
\sjtusetup{
style = {
frontmatter-numbering = false,
Expand Down Expand Up @@ -85,7 +85,7 @@
\NewDocumentEnvironment{digest}{}{%
\Collect@Body\sjtu@save@env@body
}{%
\ifsjtu@degree@course\relax\else
\ifsjtu@type@course\relax\else
\ifsjtu@language@english\relax\else
\AtEndDocument{%
\cleardoublepage
Expand Down Expand Up @@ -137,16 +137,15 @@
\def\arraystretch{1.1}
\begin{tabular}
{>{\begin{CJKfilltwosides}{4\ccwd}}r<{\end{CJKfilltwosides}}@{:}c}
\sjtu@name@author@zh & \sjtu@info@author@zh \\ \cline{2-2}
\sjtu@name@id@zh & \makebox[180pt]{\sjtu@info@id} \\
\cline{2-2}
\ifsjtu@degree@course
\sjtu@name@coursename@zh & \sjtu@info@coursename@zh \\ \cline{2-2}
\sjtu@name@author@zh & \sjtu@info@author@zh \\\cline{2-2}
\sjtu@name@id@zh & \makebox[180pt]{\sjtu@info@id} \\\cline{2-2}
\ifsjtu@type@course
\sjtu@name@course@zh & \sjtu@info@course@zh \\\cline{2-2}
\else
\sjtu@name@major@zh & \sjtu@info@major@zh \\ \cline{2-2}
\sjtu@name@major@zh & \sjtu@info@major@zh \\\cline{2-2}
\fi
\sjtu@name@supervisor@zh & \sjtu@info@supervisor@zh \\ \cline{2-2}
\sjtu@name@department@zh & \sjtu@info@department@zh \\ \cline{2-2}
\sjtu@name@supervisor@zh & \sjtu@info@supervisor@zh \\\cline{2-2}
\sjtu@name@department@zh & \sjtu@info@department@zh \\\cline{2-2}
\end{tabular}
\endgroup
\vskip 40pt
Expand Down
40 changes: 20 additions & 20 deletions texmf/tex/latex/sjtuthesis/sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
}
\sjtu@set@family@handler{sjtu}
\sjtu@define@key{sjtu}{
degree = {
type = {
choices = {
doctor,
master,
Expand Down Expand Up @@ -152,16 +152,16 @@
\DeclareBoolOption[false]{continuous}
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ProcessKeyvalOptions*
\newif\ifsjtu@degree@graduate
\sjtu@degree@graduatefalse
\ifsjtu@degree@doctor
\sjtu@degree@graduatetrue
\newif\ifsjtu@type@graduate
\sjtu@type@graduatefalse
\ifsjtu@type@doctor
\sjtu@type@graduatetrue
\fi
\ifsjtu@degree@master
\sjtu@degree@graduatetrue
\ifsjtu@type@master
\sjtu@type@graduatetrue
\fi
\ifsjtu@zihao@auto
\ifsjtu@degree@graduate
\ifsjtu@type@graduate
\def\sjtu@zihao{-4}
\else
\def\sjtu@zihao{5}
Expand All @@ -171,7 +171,7 @@
\PassOptionsToPackage{no-math}{fontspec}
\LoadClass[a4paper,UTF8,scheme=plain,linespread=1.3]{ctexbook}[2018/04/01]
\AtEndOfClass{
\ifsjtu@degree@graduate
\ifsjtu@type@graduate
\input{sjtuthesis-graduate.ltx}
\else
\input{sjtuthesis-undergraduate.ltx}
Expand Down Expand Up @@ -286,8 +286,8 @@
department* = { name = department@en },
major = { name = major@zh },
major* = { name = major@en },
coursename = { name = coursename@zh },
coursename* = { name = coursename@en },
course = { name = course@zh },
course* = { name = course@en },
fund = { name = fund@zh },
fund* = { name = fund@en },
date = {%
Expand Down Expand Up @@ -364,8 +364,8 @@
}
\sjtu@name@def{school@zh}{上海交通大学}
\sjtu@name@def{school@en}{Shanghai Jiao Tong University}
\ifsjtu@degree@graduate
\ifsjtu@degree@doctor
\ifsjtu@type@graduate
\ifsjtu@type@doctor
\sjtu@name@def{degree@type@zh}{博士}
\sjtu@name@def{degree@type@en}{Doctor}
\else
Expand Down Expand Up @@ -400,7 +400,7 @@
for the Degree of \sjtu@name@degree@type@en
}
\else
\ifsjtu@degree@course
\ifsjtu@type@course
\sjtu@name@def{degree@type@zh}{}
\sjtu@name@def{degree@type@en}{}
\sjtu@name@def{thesis@type}{课程论文}
Expand All @@ -418,7 +418,7 @@
\sjtu@name@def{author@zh}{学生姓名}
\sjtu@name@def{id@zh}{学生学号}
\sjtu@name@def{supervisor@zh}{指导教师}
\sjtu@name@def{coursename@zh}{课程名称}
\sjtu@name@def{course@zh}{课程名称}
\sjtu@name@def{major@zh}{专业}
\sjtu@name@def{department@zh}{学院(系)}
\sjtu@name@def{digest}{英文大摘要}
Expand Down Expand Up @@ -787,7 +787,7 @@
\def\sjtu@thepage{}
\def\sjtu@lastpageref{}
\newif\ifsjtu@page@numbering \sjtu@page@numberingtrue
\ifsjtu@degree@graduate
\ifsjtu@type@graduate
\newcommand\sjtu@thepage@format[2]{---~{\bfseries{#1}}~---}
\else
\ifsjtu@language@chinese
Expand All @@ -803,7 +803,7 @@
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
}
\ifsjtu@degree@graduate
\ifsjtu@type@graduate
\fancypagestyle{sjtu@plain}{%
\fancyhf{}
\fancyhead[C]{\zihao{-5}\sjtu@name@subject@zh}
Expand Down Expand Up @@ -878,8 +878,8 @@
titleformat = {},
aftername = \quad,
afterindent = true,
beforeskip = {\ifsjtu@degree@graduate 0pt\else 1ex\fi},
afterskip = {\ifsjtu@degree@graduate 3ex\else 4ex\fi},
beforeskip = {\ifsjtu@type@graduate 0pt\else 1ex\fi},
afterskip = {\ifsjtu@type@graduate 3ex\else 4ex\fi},
},
section = {%
format = \zihao{4}\bfseries\heiti,
Expand Down Expand Up @@ -909,7 +909,7 @@
\gdef\sjtu@headings@indent{2\ccwd}
\fi
\ifsjtu@style@indent@headings@auto
\ifsjtu@degree@graduate\relax\else
\ifsjtu@type@graduate\relax\else
\ctexset{%
subsubsection/name = {(,)},
subsubsection/number = \arabic{subsubsection},
Expand Down

0 comments on commit ae20e82

Please sign in to comment.