-
Notifications
You must be signed in to change notification settings - Fork 1
/
book-enhanced.cls
85 lines (68 loc) · 1.55 KB
/
book-enhanced.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{book-enhanced}[Tweaks to book class by Alessandro "Sgorblex" Clerici Lorenzini]
\newif\if@compact
\DeclareOption{compact}{\@compacttrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
\LoadClass{book}
\RequirePackage{emptypage}
\RequirePackage[base]{babel}
\RequirePackage{graphics}
\RequirePackage{geometry}
\if@compact
\geometry{
paperheight=\dimexpr\textheight+8mm\relax,
paperwidth=\dimexpr\textwidth+4mm\relax,
left=2mm,
top=4mm,
right=2mm,
bottom=4mm
}
\else
\geometry{left=3cm,right=3cm,top=3cm,bottom=3cm,includehead}
\pagestyle{headings}
\fi
% override text parameters
\renewcommand{\baselinestretch}{1.1}
% front matter
\newcommand{\subtitle}[1]{\newcommand{\@subtitle}{#1}}
\newcommand{\logo}[1]{\newcommand{\@logo}{#1}}
\newcommand{\university}[1]{\newcommand{\@university}{#1}}
\newcommand{\dept}[1]{\newcommand{\@dept}{#1}}
\newcommand{\subver}[1]{\newcommand{\@subver}{#1}}
\date{}
\renewcommand{\maketitle}{
\begin{titlepage}
\centering
\vspace*{3cm}
{\Huge \@title}
\vspace*{0.5cm}
{\Large \@subtitle}
\vspace*{2.5cm}
{\Large \@author}
\vspace*{2cm}
\ifdefined \@university
{\large \@university}
\fi
\ifdefined \@dept
{\large \@dept}
\fi
\ifx\@date\empty
{v. \the\year.\the\month.\the\day
\ifdefined \@subver
\@subver
\fi
}
\else
\@date
\fi
\vspace*{2cm}
\ifdefined \@logo
\begin{center}
\input{\@logo}
\end{center}
\vfill
\fi
{\small Distribuito con licenza CC-BY-NC-SA}
\end{titlepage}
}