-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnoithesis.cls
More file actions
124 lines (114 loc) · 3.8 KB
/
noithesis.cls
File metadata and controls
124 lines (114 loc) · 3.8 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{noithesis}
[2020/12/31 2.0 Template for NOI Thesis]
\LoadClass[12pt, a4paper]{article}
\RequirePackage{enumerate}
\RequirePackage{graphicx,subfigure}
\RequirePackage{amsmath,amsthm,amsfonts,amssymb,bm}
\RequirePackage{txfonts,fontspec}
\RequirePackage{xeCJK}
\RequirePackage{longtable,multirow}
\RequirePackage{color,xcolor}
\RequirePackage{courier}
\RequirePackage{ifthen}
\RequirePackage{calc}
\RequirePackage{ifpdf}
\RequirePackage{titling}
\RequirePackage{listings}
\RequirePackage{fancyhdr}
\RequirePackage{algorithm,algorithmic}
\RequirePackage{booktabs}
\RequirePackage{ulem}
\RequirePackage{clrscode3e}
% 若本机编译时缺少字体,可直接在此处修改,本机编译通过即可。
\RequirePackage[fontset=windows]{ctex}
\setCJKmainfont[BoldFont=SimHei]{NSimSun}
\setCJKfamilyfont{song}{NSimSun}
\setCJKfamilyfont{fs}{FangSong}
\setCJKfamilyfont{kai}{KaiTi}
\setCJKfamilyfont{hei}{SimHei}
\setlength{\textwidth}{\paperwidth}
\setlength{\textheight}{\paperheight}
\setlength\marginparwidth{0cm}
\setlength\marginparsep{0cm}
\addtolength{\textwidth}{-6.4cm}
\setlength{\oddsidemargin}{3.2cm-1in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\headheight}{20pt}
\setlength{\topskip}{0pt}
\setlength{\skip\footins}{15pt}
\setlength{\topmargin}{2.8cm-1in}
\setlength{\footskip}{1.5cm}
\setlength{\headsep}{0.5cm}
\addtolength{\textheight}{-8.6cm}
\pagestyle{fancy}
\renewcommand{\headheight}{20pt}
\renewcommand{\headrulewidth}{0.2pt}
\renewcommand{\footrulewidth}{0pt}
\lhead{\parbox{\textwidth}{\textsf{\footnotesize \thetitle}}}
\chead{}
\rhead{\parbox{\textwidth}{\raggedleft\textsf{\footnotesize \theauthor}}}
\lfoot{\parbox{\textwidth}{\textsf{\footnotesize 2021年信息学奥林匹克中国国家集训队论文}}}
\cfoot{}
\rfoot{\parbox{\textwidth}{\raggedleft\footnotesize \thepage{}}}
\setmainfont{Times New Roman}
\newcommand{\song}{\CJKfamily{song}}
\def\songti{\song}
\newcommand{\fs}{\CJKfamily{fs}}
\def\fangsong{\fs}
\newcommand{\kai}{\CJKfamily{kai}}
\def\kaishu{\kai}
\newcommand{\hei}{\CJKfamily{hei}}
\def\heiti{\hei}
\newlength\noilinespace
\newcommand{\noiChooseFont}[2]{
\setlength{\noilinespace}{#2*\real{#1}}
\fontsize{#2}{\noilinespace}\selectfont}
\def\noiDefineFontsize#1#2{
\expandafter\newcommand\csname #1\endcsname[1][\baselinestretch]{
\noiChooseFont{##1}{#2}}}
\noiDefineFontsize{chuhao}{42bp}
\noiDefineFontsize{xiaochu}{36bp}
\noiDefineFontsize{yihao}{26bp}
\noiDefineFontsize{xiaoyi}{24bp}
\noiDefineFontsize{erhao}{22bp}
\noiDefineFontsize{xiaoer}{18bp}
\noiDefineFontsize{sanhao}{16bp}
\noiDefineFontsize{xiaosan}{15bp}
\noiDefineFontsize{sihao}{14bp}
\noiDefineFontsize{banxiaosi}{13bp}
\noiDefineFontsize{xiaosi}{12bp}
\noiDefineFontsize{dawu}{11bp}
\noiDefineFontsize{wuhao}{10.5bp}
\noiDefineFontsize{xiaowu}{9bp}
\noiDefineFontsize{liuhao}{7.5bp}
\noiDefineFontsize{xiaoliu}{6.5bp}
\noiDefineFontsize{qihao}{5.5bp}
\noiDefineFontsize{bahao}{5bp}
\renewcommand{\maketitle} {
\null
\vskip 2em
\begin{center}
{\xiaoer \bf \@title \par} \vskip 1em {\@author\par}
\end{center}
\vskip 1em
}
\renewenvironment{abstract}{
\section*{摘~~要}
\kai
}{}
\renewcommand\tableofcontents{
\section*{目~~录}
\@starttoc{toc}\normalsize}
\renewcommand\section{\@startsection{section}{1}{\z@}
{-24bp \@plus -1ex \@minus -.2ex}
{6bp \@plus .2ex}
{\hei \sihao[1.429]}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}
{-16bp \@plus -1ex \@minus -.2ex}
{6bp \@plus .2ex}
{\hei\banxiaosi[1.538]}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}
{-16bp \@plus -1ex \@minus -.2ex}
{6bp \@plus .2ex}
{\hei \xiaosi[1.667]}}