Skip to content

Commit

Permalink
fix professional cover format
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Apr 11, 2018
1 parent 5698714 commit d571a6d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Travis build](https://travis-ci.org/ustctug/ustcthesis.svg?branch=master)](https://travis-ci.org/ustctug/ustcthesis)
[![GitHub release](https://img.shields.io/github/release/ustctug/ustcthesis/all.svg)](https://github.com/ustctug/ustcthesis/releases/latest)
[![Github downloads](https://img.shields.io/github/downloads/ustctug/ustcthesis/total.svg)](https://github.com/ustctug/ustcthesis/releases)
[![GitHub commits](https://img.shields.io/github/commits-since/ustctug/ustcthesis/v3.0.4.svg)](https://github.com/ustctug/ustcthesis/commits/master)
[![GitHub commits](https://img.shields.io/github/commits-since/ustctug/ustcthesis/v3.0.5.svg)](https://github.com/ustctug/ustcthesis/commits/master)

本项目是中国科学技术大学的学位论文 LaTeX 模板 ustcthesis,按照最新版的
[研究生学位论文撰写手册](http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/32.pdf)
Expand Down
39 changes: 23 additions & 16 deletions ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{ustcthesis}
[2018/03/16 v3.0.4 USTC thesis template]
[2018/03/16 v3.0.5 USTC thesis template]
\newif\if@ustc@doctor
\newif\if@ustc@master
\newif\if@ustc@bachelor
Expand All @@ -40,6 +40,7 @@
\DeclareOption{super}{\@ustc@numericaltrue\@ustc@supertrue}
\DeclareOption{numbers}{\@ustc@numericaltrue\@ustc@superfalse}
\DeclareOption{authoryear}{\@ustc@numericalfalse}
\IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ExecuteOptions{doctor,chinese,print,super}
\ProcessOptions\relax
Expand Down Expand Up @@ -354,25 +355,31 @@
\fi
}
\if@ustc@doctor
\if@ustc@professional
\newcommand\ustc@thesisname{专业博士学位论文}%
\else
\newcommand\ustc@thesisname{博士学位论文}%
\fi
\newcommand\ustc@thesisname{博士学位论文}%
\newcommand\ustc@enthesisname{A dissertation for doctor's degree}%
\else
\if@ustc@master
\if@ustc@professional
\newcommand\ustc@thesisname{专业硕士学位论文}
\else
\newcommand\ustc@thesisname{硕士学位论文}
\fi
\newcommand\ustc@enthesisname{A dissertation for master's degree}
\newcommand\ustc@thesisname{硕士学位论文}%
\newcommand\ustc@enthesisname{A dissertation for master's degree}%
\else
\newcommand\ustc@thesisname{学士学位论文}
\newcommand\ustc@enthesisname{A dissertation for bachelor's degree}
\newcommand\ustc@thesisname{学士学位论文}%
\newcommand\ustc@enthesisname{A dissertation for bachelor's degree}%
\fi
\fi
\if@ustc@professional
\if@ustc@doctor
\renewcommand\ustc@thesisname{专业博士学位论文}%
\else
\renewcommand\ustc@thesisname{专业硕士学位论文}%
\fi
\IfFileExists{/System/Library/Fonts/Times.ttc}{%
\setCJKfamilyfont{zhli}{Baoli SC}%
\newcommand\lishu{\CJKfamily{zhli}}%
}{}
\newcommand\ustc@specialityname{专业领域}
\else
\newcommand\ustc@specialityname{学科专业}
\fi
\newcommand\ustc@supervisorline{%
\ifx\ustc@encosupervisor\@empty%
Supervisor: \ustc@ensupervisor%
Expand All @@ -392,7 +399,7 @@
\vpostext{4cm}{\includegraphics[height=37\bp@]{figures/ustc_logo_text}}%
\if@ustc@professional
\vpostext{6.3cm}{\sffamily\setfontsize{56\bp@}\ziju{-0.09}\ustc@thesisname}%
\vpostext{9cm}{\setfontsize{26\bp@}\ustc@professionaltype}%
\vpostext{9cm}{\sffamily\lishu\setfontsize{26\bp@}\ustc@professionaltype}%
\vpostext{10.3cm}{\includegraphics[height=4.7cm]{figures/ustc_logo_fig}}%
\vpostext{16.3cm}{\sffamily\bfseries\setfontsize{26\bp@}\ustc@title}%
\else
Expand All @@ -406,7 +413,7 @@
\setfontsize{16\bp@}%
\begin{tabular}{@{}l@{\hspace{\ccwd}}l@{}}%
\textsf{作者姓名:} & \ustc@author \\%
\textsf{学科专业:} & \ustc@major \\%
\textsf{\ustc@specialityname:} & \ustc@major \\%
\textsf{导师姓名:} & \ustc@supervisor\quad\ustc@cosupervisor \\%
\textsf{完成时间:} & \ustc@date%
\end{tabular}};%
Expand Down
45 changes: 27 additions & 18 deletions ustcthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ LaTeX version 1999/12/01 or later.
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ustcthesis}
%<*class>
[2018/03/16 v3.0.4 USTC thesis template]
[2018/03/16 v3.0.5 USTC thesis template]
%</class>
%
%<*driver>
Expand Down Expand Up @@ -656,6 +656,7 @@ LaTeX version 1999/12/01 or later.
\DeclareOption{super}{\@ustc@numericaltrue\@ustc@supertrue}
\DeclareOption{numbers}{\@ustc@numericaltrue\@ustc@superfalse}
\DeclareOption{authoryear}{\@ustc@numericalfalse}
\IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ExecuteOptions{doctor,chinese,print,super}
\ProcessOptions\relax
Expand Down Expand Up @@ -698,7 +699,7 @@ LaTeX version 1999/12/01 or later.
% \end{macrocode}
%
% \subsection{设置西文字体}
% 设置西文字体,中文字体已经由 \pkg{ctex} 自动设置
% 设置西文字体,中文字体已经由 \pkg{ctex} 自动设置
% \begin{macrocode}
\setmainfont{Times New Roman}
\setsansfont{Arial}
Expand Down Expand Up @@ -1102,27 +1103,35 @@ LaTeX version 1999/12/01 or later.
% \end{macro}
%
% 定义一些常量。
% \changes{v3.0.5}{2018/04/11}{修正专业学位类型的字体}
% \changes{v3.0.5}{2018/04/11}{专业学位的封面更正为“专业领域”}
% \begin{macrocode}
\if@ustc@doctor
\if@ustc@professional
\newcommand\ustc@thesisname{专业博士学位论文}%
\else
\newcommand\ustc@thesisname{博士学位论文}%
\fi
\newcommand\ustc@thesisname{博士学位论文}%
\newcommand\ustc@enthesisname{A dissertation for doctor's degree}%
\else
\if@ustc@master
\if@ustc@professional
\newcommand\ustc@thesisname{专业硕士学位论文}
\else
\newcommand\ustc@thesisname{硕士学位论文}
\fi
\newcommand\ustc@enthesisname{A dissertation for master's degree}
\newcommand\ustc@thesisname{硕士学位论文}%
\newcommand\ustc@enthesisname{A dissertation for master's degree}%
\else
\newcommand\ustc@thesisname{学士学位论文}
\newcommand\ustc@enthesisname{A dissertation for bachelor's degree}
\newcommand\ustc@thesisname{学士学位论文}%
\newcommand\ustc@enthesisname{A dissertation for bachelor's degree}%
\fi
\fi
\if@ustc@professional
\if@ustc@doctor
\renewcommand\ustc@thesisname{专业博士学位论文}%
\else
\renewcommand\ustc@thesisname{专业硕士学位论文}%
\fi
\IfFileExists{/System/Library/Fonts/Times.ttc}{%
\setCJKfamilyfont{zhli}{Baoli SC}%
\newcommand\lishu{\CJKfamily{zhli}}%
}{}
\newcommand\ustc@specialityname{专业领域}
\else
\newcommand\ustc@specialityname{学科专业}
\fi
\newcommand\ustc@supervisorline{%
\ifx\ustc@encosupervisor\@empty%
Supervisor: \ustc@ensupervisor%
Expand Down Expand Up @@ -1155,7 +1164,7 @@ LaTeX version 1999/12/01 or later.
\vpostext{4cm}{\includegraphics[height=37\bp@]{figures/ustc_logo_text}}%
\if@ustc@professional
\vpostext{6.3cm}{\sffamily\setfontsize{56\bp@}\ziju{-0.09}\ustc@thesisname}%
\vpostext{9cm}{\setfontsize{26\bp@}\ustc@professionaltype}%
\vpostext{9cm}{\sffamily\lishu\setfontsize{26\bp@}\ustc@professionaltype}%
\vpostext{10.3cm}{\includegraphics[height=4.7cm]{figures/ustc_logo_fig}}%
\vpostext{16.3cm}{\sffamily\bfseries\setfontsize{26\bp@}\ustc@title}%
\else
Expand All @@ -1169,7 +1178,7 @@ LaTeX version 1999/12/01 or later.
\setfontsize{16\bp@}%
\begin{tabular}{@{}l@{\hspace{\ccwd}}l@{}}%
\textsf{作者姓名:} & \ustc@author \\%
\textsf{学科专业:} & \ustc@major \\%
\textsf{\ustc@specialityname:} & \ustc@major \\%
\textsf{导师姓名:} & \ustc@supervisor\quad\ustc@cosupervisor \\%
\textsf{完成时间:} & \ustc@date%
\end{tabular}};%
Expand Down Expand Up @@ -1620,7 +1629,7 @@ LaTeX version 1999/12/01 or later.
\renewcommand{\thefootnote}{\ustc@textcircled{footnote}}
% \end{macrocode}
%
% \changes{v3.0.4}{2013/03/30}{脚注按页计数}
% \changes{v3.0.4}{2018/03/30}{脚注按页计数}
% LaTeX 默认脚注按章计数,即每章的开始才重置脚注计数器;我们修改为按页计数。
% 简单的|\@addtoreset{footnote}{page}|并不可靠,
% \footnote{\url{http://www.tex.ac.uk/FAQ-footnpp.html}}
Expand Down

0 comments on commit d571a6d

Please sign in to comment.