Replace titlesec and fancyhdr with koma specific settings

This commit is contained in:
Marcus Kammer 2024-11-06 11:35:20 +01:00
parent 461b8cd7cc
commit f4868fbbb1

View file

@ -3,12 +3,11 @@
% Base packages
\usepackage{fontspec}
\usepackage{geometry}
\usepackage{scrlayer-scrpage}
\usepackage{titlesec}
\usepackage{scrlayer-scrpage} % Already included, will be used instead of fancyhdr
\usepackage{enumitem}
\usepackage{caption}
\usepackage{fancyhdr}
\usepackage[expansion,protrusion=true]{microtype}
\usepackage{polyglossia}
\usepackage{biblatex}
\usepackage{float}
\usepackage{xcolor}
@ -22,14 +21,10 @@
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{polyglossia}
\usepackage{grffile}
\usepackage{unicode-math}
\usepackage[Export]{adjustbox}
\usepackage{graphicx} % Added for including images
% \addbibresource{yourbibliography.bib}
\documentclass[a4paper,10pt,captions=tableheading,twoside=false]{scrartcl}
\usepackage{graphicx}
\setdefaultlanguage{english}
\setotherlanguages{german}
@ -48,20 +43,47 @@
% Geometry settings
\geometry{a4paper, left=2cm, right=2cm, top=2cm, bottom=2cm}
% Header and footer settings with fancyhdr
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyhead[R]{\thepage}
% Header and footer settings with scrlayer-scrpage instead of fancyhdr
\pagestyle{scrheadings}
\clearpairofpagestyles
\automark[section]{section}
\ohead{\pagemark}
\ihead{\leftmark}
\setkomafont{pageheadfoot}{\normalfont}
\setkomafont{pagehead}{\normalfont}
% Section formatting with titlesec
\titleformat{\section}{\Large\bfseries\sffamily}{\thesection}{1em}{}
\titleformat{\subsection}{\large\bfseries\sffamily}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalsize\bfseries\sffamily}{\thesubsubsection}{1em}{}
% Section formatting with KOMA-Script features instead of titlesec
\setkomafont{section}{\Large\bfseries\sffamily}
\setkomafont{subsection}{\large\bfseries\sffamily}
\setkomafont{subsubsection}{\normalsize\bfseries\sffamily}
% List formatting with enumitem
\setlist[itemize]{noitemsep, topsep=0pt}
\setlist[enumerate]{noitemsep, topsep=0pt}
\RedeclareSectionCommand[
beforeskip=\baselineskip,
afterskip=0.5\baselineskip
]{section}
\RedeclareSectionCommand[
beforeskip=\baselineskip,
afterskip=0.5\baselineskip
]{subsection}
\RedeclareSectionCommand[
beforeskip=\baselineskip,
afterskip=0.5\baselineskip
]{subsubsection}
% Define the spacing between section number and title
\renewcommand{\sectionformat}{%
\thesection\hspace{1em}%
}
\renewcommand{\subsectionformat}{%
\thesubsection\hspace{1em}%
}
\renewcommand{\subsubsectionformat}{%
\thesubsubsection\hspace{1em}%
}
% Caption settings
\captionsetup{font=small, labelfont=bf}
@ -88,11 +110,6 @@
\end{titlepage}
}
% List items
\setlist[itemize]{wide=0pt, leftmargin=*, nosep}
\setlist[itemize,2]{label=\textbullet}
\setlist[itemize,3]{label=$\circ$}
% Global listing settings
\lstset{
basicstyle={\ttfamily\color[rgb]{0.30, 0.34, 0.42}},