forked from Open-Advice/Open-Advice
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpretty-book.cls
146 lines (129 loc) · 3.03 KB
/
pretty-book.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
140
141
142
143
144
145
146
% Basic class provision
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{pretty-book}[2011-05-02 Pretty book style for Lydia]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions
\LoadClass{book}
%\usepackage{bera}
\usepackage{url}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{sectsty}
\usepackage{graphicx}
\usepackage{multirow}
%\usepackage[hyperindex,breaklinks,pdfborder={0 0 0}]{hyperref}
% Details required from input
\renewcommand{\author}[1]{\ifx\empty#1\else\gdef\@author{#1}\fi}
\renewcommand{\title}[1]{\ifx\empty#1\else\gdef\@title{#1}\fi}
\newcommand{\subtitle}[1]{\ifx\empty#1\else\gdef\@subtitle{#1}\fi}
% Now the layout details
% Fuck with these and I will fuck with you
\setlength{\topmargin}{-0.9cm}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 2pt}
\setlength{\textwidth}{15.2cm}
\setlength{\textheight}{24.3cm}
\setlength{\evensidemargin}{1.5cm}
\setlength{\oddsidemargin}{1.5cm}
\setlength{\footskip}{1.1cm}
\allsectionsfont{\sffamily\raggedright}
\setcounter{tocdepth}{2}
\renewcommand{\chaptermark}[1]{
\markboth{\thechapter.\ #1}
}
\renewcommand{\sectionmark}[1]{
\markright{\thesection\ #1}
}
\fancyhf{}
\fancyhead[L]{\small \nouppercase{\leftmark}}
\fancyhead[R]{\small \thepage}
\fancyfoot[L]{\small \@title}
\fancyfoot[R]{\small \@author}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\headrulewidth}{0.4pt}
\newenvironment{abstract}{%
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\begin{center}
{\large \textbf \@title}\\
by\\
\@author
\end{center}
\vskip 0.6cm
\begingroup
}{
\endgroup
}
\newenvironment{preface}{%
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\begingroup
}{
\endgroup
}
\newenvironment{acknowledgements}{%
\clearemptydoublepage
\thispagestyle{plain}
\begin{center}
\section*{Acknowledgements}
\end{center}
\begingroup
}{
\newpage
\endgroup
}
\newenvironment{introduction}{%
\begin{center}
\begin{minipage}{0.8\textwidth}
\setlength{\parskip}{6pt plus 2pt minus 2pt}
\setlength{\parindent}{0pt}
\begingroup
}{
\endgroup
\end{minipage}
\end{center}
\vskip 1cm
}
\newenvironment{dedication}{%
\thispagestyle{empty}
\begingroup
}{
\endgroup
}
% Nice chapter headings
\def\thickhrulefill{
\leavevmode \leaders \hrule \hfill \kern \z@
}
\def\@makechapterhead#1{%
{\parindent \z@ \centering \reset@font
\if@mainmatter
\thickhrulefill\quad
{\scshape \raisebox{-0.11cm}{\@chapapp{} \thechapter}}%
\quad \thickhrulefill
\else
\thickhrulefill
\fi
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\hrule
\vspace*{10\p@}%
\LARGE \sffamily \bfseries #1\par\nobreak
\par
\vspace*{10\p@}%
\hrule
\vskip 40\p@
}
}
\def\@makeschapterhead#1{%
{\parindent \z@ \centering \reset@font
\hrule
\vspace*{10\p@}%
\LARGE \sffamily \bfseries #1\par\nobreak
\par
\vspace*{10\p@}%
\hrule
\vskip 40\p@
}
}
\endinput