-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmynote.cls
94 lines (73 loc) · 2.48 KB
/
mynote.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
83
84
85
86
87
88
89
90
91
92
93
94
%mynote.cls
%writen by Melody.
\NeedsTeXFormat{LaTeX2e}[2018/04/01]
\ProvidesClass{mynote}[2019/9/18 v1.0]
\LoadClass[a4paper,12pt,openany]{book}
\RequirePackage[UTF8]{ctex}
\RequirePackage{xcolor}
\RequirePackage{titlesec, titleps, titletoc, titlecaps}
\RequirePackage{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{bbding}
\RequirePackage{ulem}
\RequirePackage{amsmath}
\RequirePackage{biblatex}
\usepackage{mfirstuc}
% set paper format
\geometry{b4paper,left=2cm,right=2.5cm}
\setlength\topmargin{-0.5cm}
\setlength\headheight{0.8cm}
\setlength\textheight\paperheight
\addtolength\textheight{-5cm}
\setlength\footskip{2.5cm}
% \def@maketitle
\newcommand\makemytitle{
\begin{titlepage}
\begin{center}
\vspace*{8cm}
\parbox[t]{\textwidth}{\centering\Large\bf\@title\\
\vspace*{10cm}
\@author\\
\vspace*{2cm}
\@date}
% \vspace*{\fill}
\newpage
\end{center}
\end{titlepage}
\setcounter{page}{1}
}
% set header format
% \newcommand{\headrulewidth}{0.4pt}
% \newcommand{\footrulewidth}{0.4pt}
% title page
% font set
\setmainfont{Lato-Regular}
% \setcounter{\thechapter}{1}
\renewcommand{\thechapter}{\Roman{chapter}}
\titleformat{\chapter}[display]{\Large\bf}{\raggedleft\MakeUppercase{\chaptertitlename}\Large\thechapter}{4ex}{\titlerule\vspace{1ex}}[\vspace{1ex}\titlerule]
\renewcommand\thesection{\arabic{chapter}.~\arabic{section}}
\titleformat{\section}{\large\bf\color{olive}}{\thesection}{4ex}{\makefirstuc}
\renewcommand\thesubsection{\thesection.~\arabic{subsection}}
\titleformat{\subsection}{\normalsize\bf}{\thesubsection}{4ex}{\makefirstuc}
\newcommand{\hchapter}{\arabic{chapter}}
\renewcommand{\chaptermark}[1]{\markboth{\arabic{chapter}.\ #1}{}}
\def\ps@plain{%
\def\@oddhead{%
\centering\vbox{%
\setlength\titlewidth\textwidth
\addtolength{\titlewidth}{-2cm}
\raggedleft\parbox[b]{\titlewidth}{\raggedleft\small\textit{\leftmark}\qquad\thepage}
\vskip3pt}}
\def\@evenhead{%
\centering\vbox{%
\setlength\titlewidth\textwidth
\addtolength{\titlewidth}{-2cm}
\raggedright\parbox[b]{\titlewidth}{\raggedright\small\thepage}
\vskip3pt}}
}
\pagestyle{plain}
\newcommand{\stress}[1]{{\bf\color{brown}#1}}
\newcommand{\comment}[1]{\\\HandPencilLeft\quad{\bf\color{red} #1}}
\newcommand{\note}[1]{\\\FourStarOpen\quad{\color{magenta} #1}}
\newcommand{\LR}{{\color{red}~$\Longrightarrow$~}}
\newcommand{\BS}{~{\bf$\backslash$~}}