-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkuxaku_two.sty
130 lines (105 loc) · 4.97 KB
/
kuxaku_two.sty
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
125
126
127
128
129
130
\usepackage{colortbl,titlesec,titling,background,fancyhdr}
\usepackage{enumitem,caption,tocloft,changepage}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}}
\setlength{\headheight}{2.8cm}
\setlength{\headsep}{0.2cm}
\setlength{\headwidth}{13.6cm}
\fancyhf{}
\fboxsep1pt % margin around text
\setlength{\fboxrule}{1pt} % border width
\fancyheadoffset[LE,RO]{0.9cm}
\fancyhead[LE,RO]{\fcolorbox{blue}{white}{\strut \ \leftmark\ }}
\fancyfootoffset[LE,RO]{0.6cm}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0pt} % remove the horizontal line below header
\setlength\cftsubsecnumwidth{2.6em} % more room for big subsection numbers in toc
\setlength{\extrarowheight}{2pt}
\definecolor{expanseblue}{RGB}{192,224,255}
\definecolor{expansered}{RGB}{255,128,128}
\definecolor{lightgray}{RGB}{246,246,246}
\newcommand{\rt}{\rowcolor{expansered}} % table title bacground
\newcommand{\rc}{\rowcolor{lightgray}} % table row bacground
\newcommand{\mb}{\vspace{-5pt}\setlength{\parindent}{1em}\begin{adjustwidth}{2mm}{2mm}} % minipage indent start
\newcommand{\me}{\end{adjustwidth}\vspace{+5pt}} % minipage indent end
\AtBeginDocument{\hypersetup{urlcolor=red, citecolor=blue, linkcolor=blue}}
\captionsetup[table]{labelfont=bf,textfont=bf,aboveskip=-2pt,belowskip=0pt}
\renewcommand{\contentsname}{\colorbox{expanseblue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\strut\ Contents}}}
\titleformat{name=\section}[block]
{\normalfont\Large\bfseries}{}{0pt}{\colorsection}
\titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}
\newcommand{\colorsection}[1]{%
\colorbox{expanseblue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\strut\ \thesection\ #1}}}
\titleformat{name=\section,numberless}[block]
{\normalfont\Large\bfseries}{}{0pt}{\colorsectionnumberless}
\titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}
\newcommand{\colorsectionnumberless}[1]{%
\colorbox{expanseblue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\strut\ #1}}}
\titleformat{name=\subsection}[block]
{\normalfont\large\bfseries}{}{0pt}{\colorsubsection}
\titlespacing*{\subsection}{0pt}{\baselineskip}{\baselineskip}
\newcommand{\colorsubsection}[1]{%
\colorbox{expanseblue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\strut\ \thesubsection\ #1}}}
\titleformat{name=\subsection,numberless}[block]
{\normalfont\normalsize\bfseries}{}{0pt}{\colorsubsectionnumberless}
\newcommand{\colorsubsectionnumberless}[1]{%
\colorbox{expanseblue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\strut\ #1}}}
\titleformat{name=\subsubsection}[block]
{\normalfont\normalsize\bfseries}{}{0pt}{\colorsubsubsection}
\titlespacing*{\subsubsection}{0pt}{\baselineskip}{\baselineskip}
\newcommand{\colorsubsubsection}[1]{%
\colorbox{expanseblue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\strut\ \thesubsubsection\ #1}}}
\titleformat{name=\subsubsection,numberless}[block]
{\normalfont\normalsize\bfseries}{}{0pt}{\colorsubsubsectionnumberless}
\newcommand{\colorsubsubsectionnumberless}[1]{%
\colorbox{expanseblue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\strut\ #1}}}
% paragraph style for box titles
\titleformat{name=\paragraph}[block]
{\normalfont\normalsize\bfseries}{}{0pt}{\colorparagraph}
\titlespacing*{\paragraph}{0pt}{\baselineskip}{\baselineskip}
\newcommand{\colorparagraph}[1]{%
\colorbox{expansered}{\parbox{\dimexpr\columnwidth-2\fboxsep}{\strut\ #1}}}
% subparagraph style for table titles
\titleformat{name=\subparagraph}[block]
{\normalfont\normalsize\bfseries}{}{0pt}{\colorsubparagraph}
\titlespacing*{\subparagraph}{0pt}{0pt}{0pt}
\newcommand{\colorsubparagraph}[5]{%
\colorbox{expansered}{\parbox{\dimexpr\linewidth-2\fboxsep}{#1}}}
\renewcommand\labelenumi{\bfseries\theenumi}
\let\oldquote\quote \renewcommand\quote{\oldquote\small\bfseries}
\usetikzlibrary{calc}
\SetBgScale{1}
\SetBgAngle{0}
\SetBgOpacity{1}
\SetBgContents{
\begin{tikzpicture}[remember picture]
\ifodd\value{page}{%
\draw[color=blue,double,line width=1pt]
($ (current page.south east) + (-0.0cm,0.8cm) $)--
($ (current page.south west) + (2.0cm,0.8cm) $)--
($ (current page.south west) + (1.5cm,1.3cm) $)--
($ (current page.north west) + (1.5cm,-1.4cm) $)--
($ (current page.north west) + (2.0cm,-0.9cm) $)--
($ (current page.north east) + (-0.0cm,-0.9cm) $)--
cycle;
}\else{%
\draw[color=blue,double,line width=1pt]
($ (current page.south west) + (0.0cm,0.8cm) $)--
($ (current page.south east) + (-2.0cm,0.8cm) $)--
($ (current page.south east) + (-1.5cm,1.3cm) $)--
($ (current page.north east) + (-1.5cm,-1.4cm) $)--
($ (current page.north east) + (-2.0cm,-0.9cm) $)--
($ (current page.north west) + (0.0cm,-0.9cm) $)--
cycle;
}\fi%
\end{tikzpicture}
}
\pretitle{% add some rules
\begin{center}
\normalfont\Huge\bfseries
}
\posttitle{%
\end{center}%
}
\usepackage{etoolbox}
\BeforeBeginEnvironment{wrapfigure}{\setlength{\intextsep}{10pt}}