-
Notifications
You must be signed in to change notification settings - Fork 0
/
krska.cls
110 lines (98 loc) · 2.44 KB
/
krska.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
%
% @author Adam Krška <[email protected]>
% @date 24.10.2020
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{krska}
% -- Create new options --
% show date if wanted
\newif\if@usedate \@usedatefalse
\DeclareOption{date}{\@usedatetrue}
% -- inherit from article class --
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}}
\ProcessOptions
\LoadClass{extarticle}
% -- Load packages --
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern} % specify used font
\RequirePackage[
pdftex,
margin=2cm,
headsep=0.8cm,
headheight=14pt]{geometry}
\RequirePackage{fancyhdr} % enable changing header and footer
\RequirePackage{lastpage} % get number of pages
\RequirePackage[nobottomtitles]{titlesec} % change headins style
\renewcommand{\bottomtitlespace}{0.05\textheight}
\RequirePackage[
pdfusetitle,
pdfproducer={Latex, or other tool},
pdfcreator={pdflatex, or other tool}
]{hyperref} % create links in file
% -- change headings to sans font --
\titleformat*{\section}{\Large\bfseries\sffamily}
\titleformat*{\subsection}{\large\bfseries\sffamily}
\titleformat*{\subsubsection}{\bfseries\sffamily}
\titleformat*{\paragraph}{\bfseries\sffamily}
\titleformat*{\subparagraph}{\bfseries\sffamily}
% -- specify header and footer --
\fancyhf{}
\if@twoside
\fancyhead[RO]{\bfseries\@author}
\if@usedate
\fancyhead[RO]{\@date, \bfseries\@author}
\fi
\fancyhead[LE]{\@title}
\fancyfoot[RO,LE]{\thepage/\pageref{LastPage}}
\else
\fancyhead[R]{\bfseries\@author}
\if@usedate
\fancyhead[R]{\@date, \bfseries\@author}
\fi
\fancyhead[L]{\@title}
\fancyfoot[C]{\thepage/\pageref{LastPage}}
\fi
\pagestyle{fancy}
\fancypagestyle{titlepage}{
\renewcommand{\headrulewidth}{0pt}%
\fancyhead{}
}
% -- change maketitle --
\newlength{\beforetitlespace} \setlength{\beforetitlespace}{1em}
\if@titlepage
\renewcommand{\maketitle}{
\begingroup
\begin{titlepage}
\null\vfil
\vskip 100pt
\centering
{\huge \bfseries \sffamily \@title}\\[3em]
{\LARGE \sffamily \@author}
\if@usedate
\vskip 3em
{\Large \sffamily \@date}
\fi
\vfil\null
\end{titlepage}
\endgroup
}
\else
\renewcommand{\maketitle}{
\begingroup
\thispagestyle{titlepage}
\begin{raggedright}
\null
\vskip \beforetitlespace
{\LARGE \bfseries \sffamily \@title}\\[1.5em]
{\Large \sffamily \@author}
\if@usedate
\vskip 1.5em
{\large \sffamily \@date}
\fi
\vskip 1.5em
\end{raggedright}
\endgroup
}
\fi
\renewcommand{\theenumiii}{\Roman{enumiii}}