2023-12-14 15:56:17 +01:00
|
|
|
\ProvidesPackage{komageneral}
|
2024-09-30 13:47:09 +02:00
|
|
|
|
|
|
|
% Base packages
|
2023-12-14 15:56:17 +01:00
|
|
|
\usepackage{fontspec}
|
|
|
|
\usepackage{geometry}
|
2025-01-04 11:06:12 +01:00
|
|
|
\usepackage[autooneside=false]{scrlayer-scrpage} % Part of KOMA-Script bundle
|
2024-09-30 13:47:09 +02:00
|
|
|
\usepackage{enumitem}
|
|
|
|
\usepackage{caption}
|
2024-12-23 11:46:10 +01:00
|
|
|
\usepackage[protrusion=true,expansion=true,final,tracking=true,kerning=true]{microtype}
|
2024-09-30 13:47:09 +02:00
|
|
|
\usepackage{biblatex}
|
2024-10-28 16:49:56 +01:00
|
|
|
\usepackage{float}
|
2024-12-23 11:46:10 +01:00
|
|
|
\usepackage[table]{xcolor}
|
2024-10-28 16:49:56 +01:00
|
|
|
\usepackage{booktabs}
|
|
|
|
\usepackage{grffile}
|
|
|
|
\usepackage{unicode-math}
|
|
|
|
\usepackage[Export]{adjustbox}
|
2024-12-22 20:46:45 +01:00
|
|
|
\usepackage{graphicx} % Needed for title page
|
|
|
|
\usepackage{etoolbox} % For custom quote environment
|
|
|
|
\usepackage{longtable}
|
|
|
|
\usepackage{wrapfig}
|
|
|
|
\usepackage{rotating}
|
|
|
|
\usepackage[normalem]{ulem}
|
|
|
|
\usepackage{amsmath}
|
|
|
|
\usepackage{amssymb}
|
|
|
|
\usepackage{capt-of}
|
2025-01-12 20:16:32 +01:00
|
|
|
\usepackage{hyperref}
|
2024-12-23 11:46:10 +01:00
|
|
|
\usepackage{array}
|
2024-12-30 09:50:39 +01:00
|
|
|
\usepackage[a-1a]{pdfx}
|
|
|
|
\usepackage{listings}
|
2025-01-12 20:16:32 +01:00
|
|
|
\usepackage{csvsimple}
|
2024-12-23 11:46:10 +01:00
|
|
|
|
2025-01-07 14:49:00 +01:00
|
|
|
\KOMAoptions{
|
|
|
|
twoside=true,
|
|
|
|
toc=listof,
|
|
|
|
titlepage=false,
|
|
|
|
headings=normal
|
|
|
|
}
|
|
|
|
|
2024-12-23 11:46:10 +01:00
|
|
|
\definecolor{darkgray}{RGB}{64,64,64}
|
|
|
|
\definecolor{lightgray}{RGB}{200,200,200}
|
2024-10-31 19:34:37 +01:00
|
|
|
|
2024-10-28 16:49:56 +01:00
|
|
|
\adjustboxset{max size={\textwidth}{0.6\textheight}}
|
|
|
|
|
2024-09-30 13:47:09 +02:00
|
|
|
% Font settings
|
2024-12-23 11:46:10 +01:00
|
|
|
\defaultfontfeatures{RawFeature={+zero, +liga}}
|
2024-12-30 09:50:39 +01:00
|
|
|
\setmainfont{Noto Serif}[
|
|
|
|
UprightFont = Noto Serif Regular,
|
|
|
|
BoldFont = Noto Serif Bold,
|
|
|
|
ItalicFont = Noto Serif Italic,
|
|
|
|
BoldItalicFont = Noto Serif Bold Italic,
|
|
|
|
Scale = 1.0,
|
|
|
|
Ligatures = {Common, TeX},
|
|
|
|
Numbers = {Lowercase, Proportional},
|
|
|
|
SmallCapsFeatures = {Letters = SmallCaps},
|
|
|
|
WordSpace = 1.1,
|
|
|
|
PunctuationSpace = 2
|
|
|
|
]
|
|
|
|
\setsansfont{Noto Sans}[
|
|
|
|
UprightFont = Noto Sans Regular,
|
|
|
|
BoldFont = Noto Sans Bold,
|
|
|
|
ItalicFont = Noto Sans Italic,
|
|
|
|
BoldItalicFont = Noto Sans Bold Italic,
|
|
|
|
Scale = 1.0,
|
|
|
|
Ligatures = {Common, TeX},
|
|
|
|
Numbers = {Lowercase, Proportional},
|
|
|
|
SmallCapsFeatures = {Letters = SmallCaps},
|
|
|
|
WordSpace = 1.1,
|
|
|
|
PunctuationSpace = 2
|
|
|
|
]
|
|
|
|
\setmonofont{Noto Sans Mono Condensed Light}[
|
|
|
|
Scale = 0.8
|
|
|
|
]
|
2024-12-23 11:46:10 +01:00
|
|
|
|
|
|
|
\linespread{1.15}
|
2024-09-30 13:47:09 +02:00
|
|
|
|
|
|
|
% Geometry settings
|
2024-12-30 09:50:39 +01:00
|
|
|
\geometry{
|
|
|
|
a4paper,
|
|
|
|
left=2.5cm,
|
|
|
|
right=2.5cm,
|
|
|
|
top=2.5cm,
|
|
|
|
bottom=2.5cm,
|
|
|
|
marginparwidth=1.5cm
|
|
|
|
}
|
2024-09-30 13:47:09 +02:00
|
|
|
|
2025-01-04 11:06:12 +01:00
|
|
|
% % Header and footer settings with scrlayer-scrpage
|
2024-11-06 11:35:20 +01:00
|
|
|
\pagestyle{scrheadings}
|
|
|
|
\clearpairofpagestyles
|
2025-01-04 11:06:12 +01:00
|
|
|
\automark[subsection]{section} % \automark[<right_level>]{<left_level>}
|
2025-01-07 14:49:00 +01:00
|
|
|
\ohead{\pagemark}
|
|
|
|
\ihead{\leftmark}
|
|
|
|
% \ihead{\pagemark}
|
|
|
|
% \chead{\Ifthispageodd{}{\@author}}
|
|
|
|
% \ohead{\Ifthispageodd{\leftmark}{\@title}}
|
2024-11-06 11:35:20 +01:00
|
|
|
\setkomafont{pageheadfoot}{\normalfont}
|
|
|
|
\setkomafont{pagehead}{\normalfont}
|
|
|
|
|
2024-12-22 20:46:45 +01:00
|
|
|
% Add lines under the header and above the footer
|
|
|
|
\setheadsepline{0.2pt} % Thickness of the header line
|
|
|
|
|
|
|
|
% Section formatting with KOMA-Script features
|
2024-12-23 11:46:10 +01:00
|
|
|
\setkomafont{section}{\LARGE\bfseries\sffamily\color{darkgray}}
|
2025-01-07 14:49:00 +01:00
|
|
|
\setkomafont{subsection}{\Large\bfseries\sffamily\color{darkgray}}
|
|
|
|
\setkomafont{subsubsection}{\large\bfseries\sffamily\color{darkgray}}
|
|
|
|
|
2024-11-30 15:41:50 +01:00
|
|
|
% Define the spacing between title and content
|
2025-01-12 20:16:32 +01:00
|
|
|
% \RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.2\baselineskip]{section}
|
|
|
|
% \RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.3\baselineskip]{subsection}
|
|
|
|
% \RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.4\baselineskip]{subsubsection}
|
|
|
|
|
|
|
|
\RedeclareSectionCommand[beforeskip=\baselineskip, afterskip=0.2\baselineskip, afterindent=false]{section}
|
|
|
|
\RedeclareSectionCommand[beforeskip=\baselineskip, afterskip=0.3\baselineskip, afterindent=false]{subsection}
|
|
|
|
\RedeclareSectionCommand[beforeskip=\baselineskip, afterskip=0.4\baselineskip, afterindent=false]{subsubsection}
|
2024-11-06 11:35:20 +01:00
|
|
|
|
|
|
|
% Define the spacing between section number and title
|
2024-11-30 15:41:50 +01:00
|
|
|
\renewcommand{\sectionformat}{\thesection\hspace{0.5em}}
|
|
|
|
\renewcommand{\subsectionformat}{\thesubsection\hspace{0.5em}}
|
|
|
|
\renewcommand{\subsubsectionformat}{\thesubsubsection\hspace{0.5em}}
|
2024-09-30 13:47:09 +02:00
|
|
|
|
2024-11-07 08:10:01 +01:00
|
|
|
% Set global table font to Noto Sans Condensed Light
|
|
|
|
\AtBeginEnvironment{tabular}{\fontspec{Noto Sans Condensed}}
|
|
|
|
\AtBeginEnvironment{longtable}{\fontspec{Noto Sans Condensed}}
|
2024-12-23 11:46:10 +01:00
|
|
|
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
|
2024-11-07 08:10:01 +01:00
|
|
|
|
2024-09-30 13:47:09 +02:00
|
|
|
% Caption settings
|
|
|
|
\captionsetup{font=small, labelfont=bf}
|
|
|
|
|
|
|
|
% Custom quote environment
|
|
|
|
\AtBeginEnvironment{quote}{\itshape}
|
|
|
|
|
|
|
|
% Custom formatting commands
|
|
|
|
\newcommand{\important}[1]{\textbf{#1}}
|
|
|
|
\newcommand{\code}[1]{\texttt{#1}}
|
|
|
|
|
|
|
|
% Title page settings
|
2024-12-22 20:46:45 +01:00
|
|
|
\newcommand{\TitlePage}[3]{ % #1 - Logo file, #2 - Company name, #3 - Title
|
2024-09-30 13:47:09 +02:00
|
|
|
\begin{titlepage}
|
|
|
|
\centering
|
|
|
|
\vspace*{1cm}
|
|
|
|
\includegraphics[width=0.3\textwidth]{#1}\par\vspace{1cm}
|
2024-10-28 16:49:56 +01:00
|
|
|
{\Huge #2\par}
|
2024-09-30 13:47:09 +02:00
|
|
|
\vspace{2cm}
|
2024-10-28 16:49:56 +01:00
|
|
|
{\Large #3\par}
|
2024-09-30 13:47:09 +02:00
|
|
|
\vfill
|
|
|
|
{\large \today\par}
|
|
|
|
\end{titlepage}
|
|
|
|
}
|
2024-10-28 16:49:56 +01:00
|
|
|
|
|
|
|
% Global listing settings
|
|
|
|
\lstset{
|
2024-12-23 11:46:10 +01:00
|
|
|
basicstyle=\small\ttfamily,
|
|
|
|
breaklines=true,
|
2024-12-30 09:50:39 +01:00
|
|
|
backgroundcolor=\color{lightgray!10},
|
2024-10-28 16:49:56 +01:00
|
|
|
frame=single,
|
2024-12-23 11:46:10 +01:00
|
|
|
rulecolor=\color{lightgray},
|
|
|
|
showstringspaces=false,
|
2024-10-28 16:49:56 +01:00
|
|
|
keepspaces=true,
|
|
|
|
showspaces=false,
|
|
|
|
showtabs=false,
|
|
|
|
breakatwhitespace=false,
|
|
|
|
tabsize=2,
|
2024-12-13 14:18:03 +01:00
|
|
|
columns=fullflexible,
|
|
|
|
aboveskip=1em,
|
2024-12-23 11:46:10 +01:00
|
|
|
belowskip=1em,
|
2024-12-30 09:50:39 +01:00
|
|
|
morecomment=[l]{;},
|
|
|
|
morestring=[b]",
|
|
|
|
literate={-}{{-}}1 {'}{{'}}{1},
|
|
|
|
keywordstyle=\color{blue}\bfseries,
|
|
|
|
commentstyle=\color{green!60!black}\itshape,
|
|
|
|
stringstyle=\color{red!80!black},
|
|
|
|
emphstyle=\color{purple}\bfseries,
|
|
|
|
emph={defun, setq, let, if, cond, loop, car, cdr, cons}
|
|
|
|
}
|
|
|
|
|
|
|
|
\lstdefinestyle{numbers}{
|
|
|
|
numbers=left,
|
|
|
|
stepnumber=1,
|
|
|
|
numberstyle=\tiny,
|
|
|
|
numbersep=3pt
|
2024-11-07 08:10:01 +01:00
|
|
|
}
|
2024-11-30 15:41:50 +01:00
|
|
|
|
2024-12-23 11:46:10 +01:00
|
|
|
\let\oldtabular\tabular
|
|
|
|
\let\endoldtabular\endtabular
|
|
|
|
\renewenvironment{tabular}{\rowcolors{2}{white}{lightgray}\oldtabular}{\endoldtabular}
|
2025-01-07 14:49:00 +01:00
|
|
|
|
|
|
|
% Set consistent spacing for all list types
|
|
|
|
% \setlist{nosep} % Removes vertical spacing
|
|
|
|
\setlist[description]{topsep=3pt, partopsep=0pt, parsep=0pt, itemsep=2pt, font=\normalfont\itshape}
|
|
|
|
\setlist[itemize]{topsep=3pt, partopsep=0pt, parsep=0pt, itemsep=2pt}
|
|
|
|
\setlist[enumerate]{topsep=3pt, partopsep=0pt, parsep=0pt, itemsep=2pt}
|
2025-01-12 20:16:32 +01:00
|
|
|
|
|
|
|
\renewcommand{\lstlistlistingname}{List of Code Snippets}
|