-
Notifications
You must be signed in to change notification settings - Fork 0
/
hdr.cls
139 lines (126 loc) · 3.56 KB
/
hdr.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
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
131
132
133
134
135
136
137
138
139
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{hdr}[2018/12/10 Habilitation thesis, V1.0]
\newif\ifartwork
\newif\ifbw
\artworktrue
\bwfalse
\DeclareOption{a4layout}{\PassOptionsToClass{a4paper}{memoir}\def\@layout{a4}}
\DeclareOption{a4papersaver}{\PassOptionsToClass{a4paper}{memoir}\def\@layout{a4ps}}
\DeclareOption{a5layout}{\PassOptionsToClass{a5paper}{memoir}\def\@layout{a5}}
\DeclareOption{b5layout}{\PassOptionsToClass{b5paper}{memoir}\def\@layout{b5}}
\DeclareOption{noartwork}{\artworkfalse}
\DeclareOption{artwork}{\artworktrue}
\DeclareOption{bw}{\bwtrue}
\DeclareOption{color}{\bwfalse}
\PassOptionsToClass{twoside}{memoir}
%\PassOptionsToClass{openany}{memoir}
\PassOptionsToClass{oldfontcommands}{memoir}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
\ProcessOptions*
\LoadClass{memoir}
% Fonts
\RequirePackage{mathptmx}
\RequirePackage[scale=0.92]{tgschola}
\RequirePackage[final,tracking=true]{microtype}
% Typesetting
\chapterstyle{culver}
\makepsmarks{headings}{%
\createmark{chapter}{left}{nonumber}{}{}
\createmark{section}{right}{nonumber}{}{}
}
\makeoddhead{headings}{}{\small\itshape\rightmark}{\thepage}
\makeevenhead{headings}{\thepage}{\small\itshape\leftmark}{}
\pagestyle{headings}
\nouppercaseheads
\midsloppy
\openany
\RequirePackage{pdfpages}
\newcommand{\chapart}[1]{%
\ifartwork
\cleartoverso
\includepdf{#1}
\fi
}
\setlength{\epigraphwidth}{6cm}
\setlength{\epigraphrule}{0pt}
\setlength{\abstitleskip}{-1em}
% theorem environments
\RequirePackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{remark}[theorem]{Remark}
%% Misc
\def\doi#1{\textsc{doi:}~\href{https://doi.org/#1}{\nolinkurl{#1}}}
%% Layout
\newif\ifafour
\newif\ifafive
\newif\ifbfive
\newif\ifafourps
\def\@temp{a4}
\ifx \@temp \@layout
\afourtrue
\settypeblocksize{*}{31pc}{1.75}
\setulmargins{*}{*}{1.2}
\setlrmargins{*}{*}{1.7}
% \setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout
\def\back@cover@layout{
\setlrmargins{*}{*}{1}%
\checkandfixthelayout%
}
\else \fi
\def\@temp{a4ps}
\ifx \@temp \@layout
\afourpstrue
\settypeblocksize{714pt}{448.13pt}{*}
\setulmargins{*}{*}{1.2}
\setlrmargins{*}{*}{1.5}
% \setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout
\def\back@cover@layout{
\setlrmargins{*}{*}{1}%
\checkandfixthelayout%
}
\else \fi
\def\@temp{a5}
\ifx \@temp \@layout
\afivetrue
\settypeblocksize{*}{27pc}{1.5}
\setulmargins{*}{*}{1.2}
\setlrmargins{*}{*}{2}
% \setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout
\def\back@cover@layout{
\setlrmargins{*}{*}{1}%
\checkandfixthelayout%
}
\else \fi
\def\@temp{b5}
\ifx \@temp \@layout
\bfivetrue
\settypeblocksize{210mm}{30pc}{*}
\setulmargins{*}{*}{1.2}
\setlrmargins{*}{*}{1.7}
% \setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout
\def\back@cover@layout{
\setlrmargins{*}{*}{1}%
\checkandfixthelayout%
}
\else \fi