summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hebdomon/hebdomon.cls
blob: 33277f76c3a4b123b055a0a4b9afa721ca9c20eb (plain)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
% Hebdomon document class for use in report and assessment writing
% Written by D. T. McGuiness: dtm@mci4me.at

% v0.1 - Angry Avocado [WS2024]

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{hebdomon}[2024/08/08 v0.1 Report and Documentation standard]

% This document is based on the excellent KOMA Script scrreprt class
% The following options are declared beforehand.

\RequirePackage{ifthen} % require an if-else loop to
% choose depending on the field

% Allows students to choose which package for code printing.

\newboolean{mnt} % set bool operator for minted
\newboolean{lst} % set bool operator for lstlisting
\newboolean{drw} % set bool operator for PGF/TikZ

%-OPTION: set option to choose minted code printing package
\DeclareOption{minted}{
	\setboolean{mnt}{true}
}

%-OPTION: set option to choose lstlisting code printing package
\DeclareOption{lstlisting}{
	\setboolean{lst}{true}
}

%-OPTION: set option to choose PGF/TikZ plotting packages
\DeclareOption{draw}{
	\setboolean{drw}{true}
}

\DeclareOption*{
	\PassOptionsToClass{\CurrentOption}{scrreprt}
}
\ExecuteOptions{}
\ProcessOptions \relax

% Load the base class to create the custom template
\LoadClass[
	bibliography  = totoc,
	headings      = big,
	captions      = tableheading,
	chapterprefix = true,
]{scrreprt}

% Page Geometry -----------------------------------------------------------
% Define the default page geometry
\RequirePackage[
	left   = 3.0cm,
	right  = 2.0cm,
	top    = 2.5cm,
	bottom = 2.5cm]{geometry}

% Required Packages -------------------------------------------------------
\RequirePackage{nicematrix} % For modern table design
\RequirePackage{booktabs}   % To access \midrule \toprule \bottomrule

% For use in referencing purposes
\RequirePackage[
	backend=bibtex]{biblatex}

\RequirePackage{graphicx}   % To enable image insertion
\RequirePackage{environ}    % To allow new environments with Environ


\RequirePackage{lmodern}
\RequirePackage[sfdefault]{FiraSans}

\RequirePackage{minitoc}
\RequirePackage{setspace}

\RequirePackage{hyperref}  % Allow the use of hyperlink within document

\RequirePackage{enumitem}

\RequirePackage{amsmath}

\usepackage[labelfont=bf]{caption} % Set the caption style to bold

\RequirePackage{titlesec}

% %%%%% ----- Colour Definitions ------ %%%%%
\RequirePackage{xcolor}

% Define the MCI colours.
\definecolor{mciRed}{HTML}{821131}
\definecolor{mciBlue}{HTML}{004983}
\definecolor{mciOrange}{HTML}{fe640b}
\definecolor{quoteColour}{HTML}{CBA6F7}
\definecolor{nord7}{HTML}{81a1c1}
\definecolor{norda}{HTML}{bf616a}
\definecolor{nord9}{HTML}{5e81ac}
\definecolor{nord13}{HTML}{ebcb8b}
\definecolor{nord14}{HTML}{a3be8c}

% %%%%% ----- Code Presentation ----- %%%%%
% To make this class more compatible and avoid questions about pygments,
% the author has decided to use listings for code presentation, instead of
% minted.
\RequirePackage{listings}

\lstset{
	aboveskip={1.3\baselineskip},
	basicstyle=\small\ttfamily\linespread{4},
	breaklines=false,
	backgroundcolor = \color[HTML]{eff1f5},
	columns=flexible,
	commentstyle=\color[HTML]{6c6f85}\ttfamily,
	escapechar=@,
	extendedchars=true,
	identifierstyle=\color{black},
	inputencoding=latin1,
	keywordstyle=\color[HTML]{fe640b},
	language=Python,
	ndkeywordstyle=\color[HTML]{228B22},
	numbers=left,
	numberstyle=\tiny,
	prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
	showstringspaces=false,
	stringstyle=\color[HTML]{40a02b}\ttfamily,
	upquote=true,
	emph={None},
	emphstyle={\color[HTML]{FE640B}},
	%	keywordstyle=[1]{\color[HTML]{8839ef}},
	%	morekeywords={(,)},
	keywordstyle=[2]\color[HTML]{D20F39},
	keywordstyle={[3]\color[HTML]{8839ef}},
	keywords=[3]{x},
}

% \lstset{style=mystyle}

% New Environment Definitions ---------------------------------------------
% To create environments tcolorbox package is required to make them
% aesthetically pleasing.
\RequirePackage{tcolorbox}
\tcbuselibrary{breakable, minted, skins,theorems, hooks, most}

% %%%%% ----- tcolorbox Templates ----- %%%%%

% Define the excerpt environment style.
\tcbset{%
	quoteTemplate/.style={%
			enhanced,
			breakable,
			arc=0pt,
			outer arc=0pt,
			toprule=0pt,
			rightrule=0pt,
			bottomrule=0pt,
			leftrule=1mm,
			colback=white,
			colframe=mciRed,
			detach title
		}%
}%

\tcbset{%
	blockTemplate/.style={%
			enhanced,
			breakable,
			arc=0pt,
			outer arc=0pt,
			toprule=0pt,
			rightrule=0pt,
			bottomrule=0pt,
			leftrule=1mm,
			colback=#1!25,
			colframe=#1,
			coltitle=black,
			detach title
		}%
}%

% %%%%% --------------------------------%%%%%

% Environment used to insert quotations.
\NewEnviron{excerpt}[1][]{%
	\begin{tcolorbox}[blockTemplate=nord7]
		\BODY
	\end{tcolorbox}
}%

\NewEnviron{example}[1][]{%
	\begin{tcolorbox}[blockTemplate=nord14]
		\BODY
	\end{tcolorbox}
}%

\NewEnviron{highlight}[1][]{%
	\begin{tcolorbox}[blockTemplate=nord13]
		\BODY
	\end{tcolorbox}
}%

\NewEnviron{theory}[1][]{%
	\begin{tcolorbox}[blockTemplate=black]
		\BODY
	\end{tcolorbox}
}%

\NewEnviron{warning}[1][]{%
	\begin{tcolorbox}[blockTemplate=norda]
		\BODY
	\end{tcolorbox}
}%

\NewEnviron{hgitemize}[1][]{%
	\begin{itemize}[leftmargin=!,labelindent=-29.2pt]
		\BODY
	\end{itemize}
}%





% KOMA-Script Configuration -----------------------------------------------

\addtokomafont{chapterprefix}{\raggedleft}
\addtokomafont{chapter}{\fontsize{30}{38}\selectfont}
\addtokomafont{section}{\huge}
\addtokomafont{subsection}{\Large}
\addtokomafont{subsubsection}{\large}

% Set the fontstyle of minitoc to that of the document
\renewcommand{\mtifont}{\large\sffamily}
\renewcommand{\mtcfont}{\small\sffamily}
\renewcommand{\mtcSfont}{\small\sffamily}
\renewcommand{\mtcSSfont}{\small\sffamily}
\renewcommand{\mtcSSSfont}{\small\sffamily}

\newcommand{\StudentName}[1]{\author{#1}}

% Set the depth of TOC
\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections

% Configure the document titles
\newcommand{\Chapter}[1]{\chapter{\textcolor{mciBlue}{#1}}\minitoc}
\newcommand{\Section}[1]{\section{\textcolor{mciBlue}{#1}}}
\newcommand{\Subsection}[1]{\subsection{\textcolor{mciBlue}{#1}}}
\newcommand{\Subsubsection}[1]{\subsubsection{\textcolor{mciBlue}{#1}}}

\newcommand{\hlight}[1]{\textcolor{mciOrange}{#1}}


% Configure the baseline of the document
\renewcommand{\baselinestretch}{1.2}

\renewcommand*{\chapterformat}{%
	\mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
		\scalebox{4}{\color{mciRed}\thechapter\autodot}\enskip}}

\newcommand{\heading}[1]{\subsubsection*{$\blacksquare$ #1}}
\newcommand{\marginsecnumber}[1]{%
	\makebox[0pt][r]{#1\hspace{6pt}}%
}

\titleformat{\section} {\normalfont\Large\bfseries}
{\marginsecnumber\thesection} {0pt} {}
\titleformat{\subsection} {\normalfont\large\bfseries}
{\marginsecnumber\thesubsection} {0pt} {}
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}
{\marginsecnumber\thesubsubsection}
{0pt} {}
\titleformat{\paragraph}[runin]
{\normalfont\normalsize\bfseries}
{\marginsecnumber\theparagraph}
{0pt} {}
\titleformat{\subparagraph}[runin]
{\normalfont\normalsize\bfseries}
{\marginsecnumber\thesubparagraph}
{0pt}
{}

\titlespacing*{\subsection}{0pt}{*3.25}{*1.5}%

\setlength\parindent{0pt} % set no indent for the entire file

\ifthenelse{\boolean{mnt}}{%
	\RequirePackage{minted}

	\newcommand{\pcode}[1]{%
		{%
				\colorbox{gray!10}{%
					\mintinline[fontsize=\small]{text}{#1}%
				}%
			}%
	}%

	%\usemintedstyle{catppuccin-latte}

	\definecolor{catback}{HTML}{585b70}
	\definecolor{catground}{HTML}{eff1f5}

	% Set box and font rules for inputminted command for paper
	\newtcbinputlisting{\codeinputpaper}[4][]{%
		listing file={#3},
		minted language=#2,
		minted options={
				fontsize=\small,
				tabsize=4,
				xleftmargin=-2.25mm,
				numbersep=5mm,
				breaklines=true,
				highlightcolor=orange!50,
				%formatcom=orange!50
			},% <-- put other minted options inside the brackets
		overlay unbroken and first={%
				\begin{tcbclipinterior}
					\fill[catback] (frame.south west) rectangle
					([xshift=1mm]frame.north west);
					\fill[catback] (frame.north east) rectangle
					([xshift=-4mm, yshift=-10mm]frame.north east);
					\fill[catback]
					([xshift=-4mm, yshift=-10mm]frame.north east) --
					([xshift=0mm, yshift=-10mm]frame.north east) --
					([xshift=0mm, yshift=-12mm]frame.north east);
				\end{tcbclipinterior}
				\node[rotate=-90, minimum width=1cm, anchor=north,
					font=\bfseries] at ([xshift=0mm, yshift=-4mm]frame.north
				east) {\tiny \textcolor{white}{#2}}; },
		sharp corners,
		leftrule=1mm,
		toprule=0pt,
		rightrule=0pt,
		bottomrule=0pt,
		colback=catground,
		colframe=black,
		breakable,
		enhanced,% <-- put other tcolorbox options here
		arc=0mm,
		boxrule=0pt,
		frame hidden,
		listing only,
		minted options app={#1}}

	\RequirePackage{xpatch}

	\newenvironment{code}[1]
	{%
		\VerbatimEnvironment
		\begin{minted}{#1}%
}
{%
  \end{minted}%
	}
	%
	\xpatchcmd{\mintinline}{\begingroup}{\begingroup\let\itshape\relax}{}{}
	\xpatchcmd{\minted}{\VerbatimEnvironment}{\VerbatimEnvironment\let\itshape\relax}{}{}
	\xpatchcmd{\inputminted}{\begingroup}{\begingroup\let\itshape\relax}{}{}
}{}

\ifthenelse{\boolean{lst}}{%
	\RequirePackage{listings}%
	\RequirePackage{xparse}

	\NewDocumentCommand{\pcode}{v}{%
		#1%
	}

	\newenvironment{code}[1]
	{%
		\VerbatimEnvironment
		\begin{lstlisting}{language=#1}%
}
{%
  \end{lstlisting}%
	}
}{}


\ifthenelse{\boolean{drw}}{%
	\RequirePackage{pgfplots}   % Enable to draw plots in the documents
	\usepackage{tikz}           % Enable Tikz and its libraries
	\pgfplotsset{compat=1.18}   % Set the pgf compatibility.
	%
	\usepgfplotslibrary{polar}  % To access polarplot
	%
	\pgfplotsset{
		hebdomon/.style={
				minor grid style={dotted, gray!50},
				major grid style={dotted, gray!50},
				%
				grid = both,
				minor tick num=2,
				ytick align=outside,
				xtick align=outside,
				axis line style={draw=none},
				axis lines = left,
				%
				line width=2pt,
				%
				legend style = {
						line width=0.5pt
					},
				%
				every non boxed x axis/.append style={x axis line style=-},
				every non boxed y axis/.append style={y axis line style=-},
				%
			},
	}
}{}


\endinput