\ProvidesPackage{komageneral} % Base packages \usepackage{fontspec} \usepackage{geometry} \usepackage[autooneside=false]{scrlayer-scrpage} % Part of KOMA-Script bundle \usepackage{enumitem} \usepackage{caption} \usepackage[protrusion=true,expansion=true,final,tracking=true,kerning=true]{microtype} \usepackage{polyglossia} \usepackage{biblatex} \usepackage{float} \usepackage[table]{xcolor} \usepackage{booktabs} \usepackage{grffile} \usepackage{unicode-math} \usepackage[Export]{adjustbox} \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} \usepackage[pdfusetitle]{hyperref} \usepackage{array} \usepackage[a-1a]{pdfx} \usepackage{listings} \KOMAoptions{ captions=tableheading, twoside=true, toc=listof, titlepage=false, headings=normal } \definecolor{darkgray}{RGB}{64,64,64} \definecolor{lightgray}{RGB}{200,200,200} \setdefaultlanguage{english} \setotherlanguages{german} \adjustboxset{max size={\textwidth}{0.6\textheight}} % Font settings \defaultfontfeatures{RawFeature={+zero, +liga}} \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 ] \linespread{1.15} % Geometry settings \geometry{ a4paper, left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm, marginparwidth=1.5cm } % % Header and footer settings with scrlayer-scrpage \pagestyle{scrheadings} \clearpairofpagestyles \automark[subsection]{section} % \automark[]{} \ohead{\pagemark} \ihead{\leftmark} % \ihead{\pagemark} % \chead{\Ifthispageodd{}{\@author}} % \ohead{\Ifthispageodd{\leftmark}{\@title}} \setkomafont{pageheadfoot}{\normalfont} \setkomafont{pagehead}{\normalfont} % Add lines under the header and above the footer \setheadsepline{0.2pt} % Thickness of the header line % Section formatting with KOMA-Script features \setkomafont{section}{\LARGE\bfseries\sffamily\color{darkgray}} \setkomafont{subsection}{\Large\bfseries\sffamily\color{darkgray}} \setkomafont{subsubsection}{\large\bfseries\sffamily\color{darkgray}} % \setkomafont{section}{\fontsize{14pt}{17pt}\selectfont\bfseries\sffamily\color{darkgray}} % \setkomafont{subsection}{\fontsize{12pt}{14pt}\selectfont\bfseries\sffamily\color{darkgray}} % Define the spacing between title and content \RedeclareSectionCommand[beforeskip=\baselineskip, afterskip=0.2\baselineskip]{section} \RedeclareSectionCommand[beforeskip=\baselineskip, afterskip=0.3\baselineskip]{subsection} \RedeclareSectionCommand[beforeskip=\baselineskip, afterskip=0.4\baselineskip]{subsubsection} % Define the spacing between section number and title \renewcommand{\sectionformat}{\thesection\hspace{0.5em}} \renewcommand{\subsectionformat}{\thesubsection\hspace{0.5em}} \renewcommand{\subsubsectionformat}{\thesubsubsection\hspace{0.5em}} % Set global table font to Noto Sans Condensed Light \AtBeginEnvironment{tabular}{\fontspec{Noto Sans Condensed}} \AtBeginEnvironment{longtable}{\fontspec{Noto Sans Condensed}} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} % 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 \newcommand{\TitlePage}[3]{ % #1 - Logo file, #2 - Company name, #3 - Title \begin{titlepage} \centering \vspace*{1cm} \includegraphics[width=0.3\textwidth]{#1}\par\vspace{1cm} {\Huge #2\par} \vspace{2cm} {\Large #3\par} \vfill {\large \today\par} \end{titlepage} } % Global listing settings \lstset{ basicstyle=\small\ttfamily, breaklines=true, backgroundcolor=\color{lightgray!10}, frame=single, rulecolor=\color{lightgray}, showstringspaces=false, keepspaces=true, showspaces=false, showtabs=false, breakatwhitespace=false, tabsize=2, columns=fullflexible, aboveskip=1em, belowskip=1em, 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 } % Enhance your hyperref setup \hypersetup{ colorlinks=true, linkcolor=darkgray, filecolor=darkgray, urlcolor=darkgray, citecolor=darkgray, % pdftitle={Your Document Title}, % pdfauthor={Your Name}, % pdfsubject={Document Subject}, % pdfkeywords={keyword1, keyword2}, pdfstartview={FitV}, pdfview={FitV}, pdfpagemode={UseOutlines}, bookmarksopen=true, bookmarksnumbered=true } \let\oldtabular\tabular \let\endoldtabular\endtabular \renewenvironment{tabular}{\rowcolors{2}{white}{lightgray}\oldtabular}{\endoldtabular} % 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}