-
Notifications
You must be signed in to change notification settings - Fork 4
/
hitgsrep.cls
83 lines (71 loc) · 2.62 KB
/
hitgsrep.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{hitgsrep}[report template for graduate student in Harbin Institute of Technology]
\RequirePackage{ifthen}
\RequirePackage{etoolbox}
\RequirePackage{ifxetex}
\ifxetex
\else
\ClassError{hitgsrep}
{Please use: \MessageBreak
xelatex}{}
\fi
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=hit,
prefix=hit@,
setkeys=\kvsetkeys
}
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexart}}
\ProcessKeyvalOptions*
\LoadClass[zihao=-4, fntef]{ctexart}
\RequirePackage[a4paper,hmargin=3.17cm,vmargin=2.54cm]{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{xeCJKfntef}
\RequirePackage[defaultsups]{newtxtext}
\RequirePackage{caption}
\RequirePackage{amsmath}
\RequirePackage{lastpage}
\RequirePackage[normalem]{ulem}
\def\hitgsrepset{\kvsetkeys{hit}}
% 页眉页脚设置
\pagestyle{fancy}
\newcommand{\hit@pagefootmark}{第 \thepage{} 页(共 \pageref{LastPage} 页)\phantom{mmm}}
\fancyhf{}
\fancyfoot[R]{\hit@pagefootmark}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.5bp}
% 封面选项
\DeclareStringOption[\hit@auto@year]{year}
\DeclareStringOption[\hit@auto@semester]{semester}
\DeclareStringOption{course}
\DeclareStringOption{affiliation}
\DeclareStringOption{discipline}
\DeclareStringOption{author}
\DeclareStringOption{studentid}
\DeclareStringOption{studentcat}
% 自动生成当前学期
\newcommand{\hit@auto@semester}{\ifcase \month \or 秋\or 春\or 春\or 春\or 春\or 春\or 夏\or 夏\or 秋\or 秋\or 秋\or 秋\fi}
\newcommand{\hit@auto@year}{\ifnum\month>1 {\the\year}\else {\the\numexpr\year-1\relax}\fi}
% 封面
\newcommand{\hit@putinfo}[2][3.81cm]{\begin{CJKfilltwosides}[b]{#1}#2\end{CJKfilltwosides}}%
\renewcommand{\maketitle}{%
\begin{titlepage}
\begin{center}
\zihao{-2}\heiti \uline{\ \hit@year\ }年\uline{\ \ \hit@semester\ \ }季学期研究生课程考核
\zihao{-3}\heiti (读书报告、研究报告)
\end{center}
\zihao{4}
\renewcommand{\arraystretch}{1.5}
\noindent\begin{tabular}{@{}c@{}l}
\hit@putinfo{考核科目}&: \hit@course\\
\hit@putinfo{学生所在院(系)} &: \hit@affiliation\\
\hit@putinfo{学生所在学科}&: \hit@discipline\\
\hit@putinfo{学生姓名}&: \hit@author\\
\hit@putinfo{学号}&: \hit@studentid\\
\hit@putinfo{学生类别}&: \hit@studentcat\\
\hit@putinfo{考核结果}& \begin{tabular}{@{}p{5.19cm}@{}cc@{}}
&\hit@putinfo[2.86cm]{阅卷人}&
\end{tabular}
\end{tabular}
\end{titlepage}
}