diff --git a/README.md b/README.md index 6ac4457..2347d87 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ 相较于老版tongjithesis,我这个版本融合了thuthesis (ThuThesis 2017/12/24 5.4.3)的很多新改动,个人认为比较大的改动如下: 1. 加入更详尽的注释。我甚至将很多宏的用法用例子进行阐述,当然详细的注释主要集中在“宏展开”的部分。这就极大地方便了模板的阅读和理解,期待校友们更多地参与到对此模板的改进。 1. 老版基于book制作,新版基于ctexbook。 -1. 新版采用ctex宏集`目前参考的是2018/01/28 v2.4.12《ctex宏集手册》`自带的字体配置,比如在新版windows操作系统上,采用的是中易字库+ 微软雅黑。 +1. 新版采用ctex宏集(`目前参考的是2018/01/28 v2.4.12《ctex宏集手册》`)自带的字体配置,比如在新版windows操作系统上,采用的是中易字库+ 微软雅黑。 1. 页面设置采用geometry宏包。 1. 使用kvoptions宏包,从而可以使用key-value input的方式设置class的option 1. 使用fancyhdr宏包设置页眉页脚 diff --git a/thesis.tex b/thesis.tex index bd891a9..49cea1f 100644 --- a/thesis.tex +++ b/thesis.tex @@ -1,12 +1,14 @@ \documentclass[degree=doctor]{tongjithesis} % 选项: -% degree=[master|doctor], % 必选 -% secret, % 可选 -% pifootnote, % 可选(建议打开) -% arial, % 可选,基本不用 -% arialtoc, % 可选,基本不用 -% arialtitle % 可选,默认已打开 - +% degree=[master|doctor], % 必选 +% degreetype=[academic|profession|equaleducation], % 可选, 学术型|专业型|同等学力,默认为学术型 +% electronic, % 可选, 电子版,(打印时删除) +% secret, % 可选 +% pifootnote, % 可选(建议打开) +% arial, % 可选,基本不用 +% arialtoc, % 可选,基本不用 +% arialtitle % 可选,默认已打开 +% 注:默认已打开的选项可以使用arialtitle=false的形式关闭。 % 所有其它可能用到的包都统一放到这里了,可以根据自己的实际添加或者删除。 \usepackage{tongjiutils} diff --git a/tongjithesis.cfg b/tongjithesis.cfg index 668edb6..08aabf3 100644 --- a/tongjithesis.cfg +++ b/tongjithesis.cfg @@ -69,16 +69,42 @@ \def\tongji@cdepartmenttitle{所在院系} \def\tongji@cmajorfirsttitle{学科门类} \def\tongji@cmajorsecondtitle{学科专业} - +\def\tongji@cmajorfirsttitleprofession{专业学位名称} +\def\tongji@cmajorsecondtitleprofession{专业领域} +\def\tongji@academictitle{学术型} +\def\tongji@professiontitle{专业型} +\def\tongji@equaleducationtitle{同等学力} \iftongji@doctor - \cdegree{博士} - \edegree{Doctor of Philosophy} + \cdegree{博士} + \edegree{Doctor of Philosophy} + \iftongji@academic + \def\tongji@thesistype{\tongji@academictitle\tongji@cdegree} \else - \iftongji@master - \cdegree{硕士} - \edegree{Master of Science} + \iftongji@profession + \def\tongji@thesistype{\tongji@professiontitle\tongji@cdegree} + \else + \iftongji@equaleducation + \def\tongji@thesistype{\tongji@equaleducationtitle\tongji@cdegree} + \fi + \fi + \fi +\else + \iftongji@master + \cdegree{硕士} + \edegree{Master of Science} + \iftongji@academic + \def\tongji@thesistype{\tongji@academictitle\tongji@cdegree} + \else + \iftongji@profession + \def\tongji@thesistype{\tongji@professiontitle\tongji@cdegree} + \else + \iftongji@equaleducation + \def\tongji@thesistype{\tongji@equaleducationtitle\tongji@cdegree} + \fi + \fi \fi \fi +\fi \def\tongji@cauthortitle{姓名} \def\tongji@cstudentnumbertitle{学号} \def\tongji@csupervisortitle{指导教师} diff --git a/tongjithesis.cls b/tongjithesis.cls index 4a12803..5a253fb 100644 --- a/tongjithesis.cls +++ b/tongjithesis.cls @@ -12,7 +12,7 @@ family=tongji, prefix=tongji@, setkeys=\kvsetkeys} -\newif\iftongji@electronic\tongji@electronicfalse % added by wildwolf 20100109 boolean + \newif\iftongji@master \newif\iftongji@doctor \define@key{tongji}{degree}{% @@ -20,8 +20,20 @@ \tongji@doctorfalse \expandafter\csname tongji@#1true\endcsname} +% 学术型|专业型|同等学力 +\newif\iftongji@academic +\tongji@academictrue % 默认为学术型 +\newif\iftongji@profession +\newif\iftongji@equaleducation +\define@key{tongji}{degreetype}{% + \tongji@academicfalse + \tongji@professionfalse + \tongji@equaleducationfalse + \expandafter\csname tongji@#1true\endcsname} +% 封面的electronic选项(打印时删除) +\DeclareBoolOption{electronic} % 论文是否保密 \DeclareBoolOption{secret}% % 目录中英文是否用 Arial 字体(默认关闭) @@ -66,6 +78,14 @@ degree=[master | doctor]}{} \fi \fi +% 杜绝非法的degreetype选项。 +\iftongji@academic\relax\else + \iftongji@profession\relax\else + \iftongji@equaleducation\relax\else + \ClassError{tongjithesis}{Unknown degree type option.\MessageBreak Please check your degree type, good luck!}{} + \fi + \fi +\fi % 使用 \XeTeX\ 引擎时,\pkg{fontspec} 宏包会被 \pkg{xeCJK} 自动调用。传递 % 给 \pkg{fontspec} 宏包 \option{no-math} 选项,避免部分数学符号字体自动调整 @@ -641,7 +661,7 @@ \\[0.1cm] % \parbox[t][9cm][t]{\paperwidth-10cm}{ %\hspace*{.4cm} - \iftongji@electronic{{\kaiti\xiaosi\tongji@thesistype (打印时删除)}} + \iftongji@electronic{{\kaishu\xiaosi\bfseries\itshape\tongji@thesistype (打印时删除)}} \else\rule{1cm}{0cm} \fi } @@ -656,8 +676,13 @@ { % \renewcommand{\baselinestretch}{1} %单倍行距 \begin{center} - \erhao[1]{{\bfseries\erhao\lishu\tongji@capply}} - \par\vskip 1.8cm + \erhao[1]{{\bfseries\lishu\tongji@capply}} + \iftongji@academic{\par\vskip 1.8cm} + \else \iftongji@profession{\par\vskip 0.4cm \sihao[1]{{\bfseries\lishu(专业学位)}} \par\vskip 0.9cm} + \else \iftongji@equaleducation {\par\vskip 0.4cm \sihao[1]{{\bfseries\lishu(同等学力)}} \par\vskip 0.9cm} + \fi + \fi + \fi % \linespread{0.7} % \linespread{0.7}相当于\renewcommand{\baselinestretch}{0.7} % 需要执行\selectfont才能生效。 @@ -676,31 +701,58 @@ { \fangsong\sanhao[1.5] \begin{center} - \setlength{\tongji@title@width}{5em} - \setlength{\extrarowheight}{4pt} - \ifxetex % todo: ugly codes - \begin{tabular}{p{\tongji@title@width}@{}c@{\extracolsep{8pt}}p{7cm}l} + + \setlength{\extrarowheight}{4pt} + \iftongji@profession + \setlength{\tongji@title@width}{6em} + \ifxetex % todo: ugly codes + \begin{tabular}{p{\tongji@title@width}@{}c@{\extracolsep{8pt}}p{7cm}l} + \else + \begin{tabular}{p{\tongji@title@width}c@{\extracolsep{8pt}}p{7cm}l} + \fi + \tongji@put@title{\tongji@cauthortitle} & \tongji@title@sep + & \tongji@cauthor\\ + \tongji@put@title{\tongji@cstudentnumbertitle} & \tongji@title@sep + & \tongji@studentnumber\\ + \tongji@put@title{\tongji@cdepartmenttitle} & \tongji@title@sep + & \tongji@cdepartment\\ + \tongji@put@title{\tongji@cmajorfirsttitleprofession} & \tongji@title@sep + & \tongji@cmajorfirst\\ + \tongji@put@title{\tongji@cmajorsecondtitleprofession} & \tongji@title@sep + & \tongji@cmajorsecond\\ + \tongji@put@title{\tongji@csupervisortitle} & \tongji@title@sep + & \tongji@csupervisor\\ + \ifx\tongji@cassosupervisor\@empty\else + \tongji@put@title{\tongji@cassosupertitle} & \tongji@title@sep + & \tongji@cassosupervisor\\ + \fi \else - \begin{tabular}{p{\tongji@title@width}c@{\extracolsep{8pt}}p{7cm}l} - \fi - \tongji@put@title{\tongji@cauthortitle} & \tongji@title@sep - & \tongji@cauthor\\ - \tongji@put@title{\tongji@cstudentnumbertitle} & \tongji@title@sep - & \tongji@studentnumber\\ - \tongji@put@title{\tongji@cdepartmenttitle} & \tongji@title@sep - & \tongji@cdepartment\\ - \tongji@put@title{\tongji@cmajorfirsttitle} & \tongji@title@sep - & \tongji@cmajorfirst\\ - \tongji@put@title{\tongji@cmajorsecondtitle} & \tongji@title@sep - & \tongji@cmajorsecond\\ - \tongji@put@title{\tongji@csupervisortitle} & \tongji@title@sep - & \tongji@csupervisor\\ - \ifx\tongji@cassosupervisor\@empty\else - \tongji@put@title{\tongji@cassosupertitle} & \tongji@title@sep - & \tongji@cassosupervisor\\ - \fi - \end{tabular} - \end{center}} + \setlength{\tongji@title@width}{5em} + \ifxetex % todo: ugly codes + \begin{tabular}{p{\tongji@title@width}@{}c@{\extracolsep{8pt}}p{7cm}l} + \else + \begin{tabular}{p{\tongji@title@width}c@{\extracolsep{8pt}}p{7cm}l} + \fi + \tongji@put@title{\tongji@cauthortitle} & \tongji@title@sep + & \tongji@cauthor\\ + \tongji@put@title{\tongji@cstudentnumbertitle} & \tongji@title@sep + & \tongji@studentnumber\\ + \tongji@put@title{\tongji@cdepartmenttitle} & \tongji@title@sep + & \tongji@cdepartment\\ + \tongji@put@title{\tongji@cmajorfirsttitle} & \tongji@title@sep + & \tongji@cmajorfirst\\ + \tongji@put@title{\tongji@cmajorsecondtitle} & \tongji@title@sep + & \tongji@cmajorsecond\\ + \tongji@put@title{\tongji@csupervisortitle} & \tongji@title@sep + & \tongji@csupervisor\\ + \ifx\tongji@cassosupervisor\@empty\else + \tongji@put@title{\tongji@cassosupertitle} & \tongji@title@sep + & \tongji@cassosupervisor\\ + \fi + \fi + + \end{tabular} + \end{center}} } \\[1.3cm] % \vskip2cm