forked from rrthomas/hpmor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhp-book.sty
101 lines (81 loc) · 2.88 KB
/
hp-book.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{hp-book}
% Options
\gdef\hplrmargins{1.5}
\DeclareOption{pdf}{\gdef\hplrmargins{1}}
\newif\ifcover\covertrue
\DeclareOption{nocover}{\coverfalse}
\ProcessOptions % process now as some are used immediately
\documentclass[12pt,extrafontsizes,twoside,openright,final,msmallroyalvopaper]{memoir}
\usepackage[german]{babel}
\input{hp-header}
% Book-specific settings
%
% Set up page
% FIXME: Improve the layout: margins not perhaps as wide as the default, but
% wider than currently. (The type block is currently the same as for the previous, larger paper.)
%
\settypeblocksize{\topskip + 34\baselineskip}{352pt}{*}
\setlrmargins{*}{*}{\hplrmargins}
\setulmargins{*}{*}{1}
\setheadfoot{\topskip + \baselineskip}{2\baselineskip}
\checkandfixthelayout[fixed]
%
% Page header
%
\usepackage{graphicx} % for \reflectbox
\makeevenhead{headings}{\Stars}{
\hpfont\hyperref[contents]{\textls[50]{\rightmark}}}{\reflectbox{\Stars}}
\makeoddhead{headings}{\Stars}{\parbox{97mm}{\centering\hpfont\textls[50]{\leftmark}}}{\reflectbox{\Stars}}
\renewcommand*{\sectionmark}[1]{}
%
% Page numbering/footer
%
\def\pageInFooter{\Star\ \hpfont\makebox[4em][c]{\textls[30]{\thepage}}\Star}
\makeevenfoot{plain}{}{\pageInFooter}{}
\makeoddfoot{plain}{}{\pageInFooter}{}
\makeevenfoot{headings}{}{\pageInFooter}{}
\makeoddfoot{headings}{}{\pageInFooter}{}
%
% Custom chapter style
%
\makeatletter
\makechapterstyle{evans}{%
\renewcommand*{\chapnamefont}{\hpfont\large}
\renewcommand*{\chapnumfont}{\chapnamefont}
\renewcommand*{\chaptitlefont}{\hpfont\huge}
\setlength{\beforechapskip}{4\baselineskip plus 2\baselineskip minus 2\baselineskip }
\setlength{\midchapskip}{0pt}
\setlength{\afterchapskip}{1\baselineskip}
\renewcommand*{\printchapternum}{%
\chapnumfont \hyperref[contents]{\textls[30]{
\IfInteger{\thechapter}{\NUMBERstring{chapter}}{\thechapter}
}}}
\renewcommand*{\printchaptername}{%
\centering \chapnamefont \hyperref[contents]{\MakeUppercase{\textls[30]{\@chapapp}}}
}
\renewcommand*{\printchaptertitle}[1]{%
\vskip 0pt\begin{center}\chaptitlefont \textls[50]{\MakeUppercase{##1}}\end{center}\par
}
\renewcommand*{\chaptermark}[1]{
\markboth{
\MakeUppercase{##1}
}{
\MakeUppercase{\chaptername}~
\thechapter
}
}
\renewcommand*{\tocmark}{\markboth{}{\MakeUppercase{Contents}}}
\renewcommand{\tocheadstart}{\chapterheadstart}
\renewcommand{\aftertoctitle}{\thispagestyle{empty}\afterchaptertitle}
}
\makeatother
\chapterstyle{evans}
\def\chapterheadstart{\vspace*{-1\baselineskip}\vspace*{-1\topskip}\vspace*{\beforechapskip}}
%
% Section
%
\setsecheadstyle{\scshape}
\beforesecskip=1.5\baselineskip % skip before the heading
\aftersecskip=.5\baselineskip plus .5\baselineskip % skip after the heading
\setsechook{\nopagebreak\vskip 0pt plus 3\baselineskip\setsecnumformat{}}