-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapterheader.sty
55 lines (55 loc) · 1.52 KB
/
chapterheader.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
\ProvidesPackage{chapterheader}[2017/08/18 Chapter fancy header]
\usepackage[T1]{fontenc}
\usepackage{kpfonts}
\setSingleSpace{1.1}
\SingleSpacing
\usepackage{xcolor,calc, blindtext}
\definecolor{chaptercolor}{gray}{0.8}
% helper macros
\newcommand\numlifter[1]{\raisebox{-2cm}[0pt][0pt]{\smash{#1}}}
\newcommand\numindent{\kern37pt}
\newlength\chaptertitleboxheight
\makechapterstyle{hansen}{
\renewcommand\printchaptername{\raggedleft}
\renewcommand\printchapternum{%
\begingroup%
\leavevmode%
\chapnumfont%
\strut%
\numlifter{\thechapter}%
\numindent%
\endgroup%
}
\renewcommand*{\printchapternonum}{%
\vphantom{\begingroup%
\leavevmode%
\chapnumfont%
\numlifter{\vphantom{9}}%
\numindent%
\endgroup}
\afterchapternum}
\setlength\midchapskip{0pt}
\setlength\beforechapskip{0.5\baselineskip}
\setlength{\afterchapskip}{0.5\baselineskip}
\renewcommand\chapnumfont{%
\fontsize{4cm}{0cm}%
\bfseries%
\sffamily%
\color{chaptercolor}%
}
\renewcommand\chaptitlefont{%
\normalfont%
\huge%
\bfseries%
\raggedleft%
}%
\settototalheight\chaptertitleboxheight{%
\parbox{\textwidth}{\chaptitlefont \strut bg\\bg\strut}}
\renewcommand\printchaptertitle[1]{%
\parbox[t][\chaptertitleboxheight][t]{\textwidth}{%
% \microtypesetup{protrusion=false}% add this if you use microtype
\chaptitlefont\strut ##1\strut}\\~\\
\rule{\linewidth}{0.4pt}
}}
\chapterstyle{hansen}
\aliaspagestyle{chapter}{empty} % just to save some space