I am using scrreprt
KOMA and have difficulties with compatibility. I had titlesec
and fancyhdr
but those are bad with KOMA as I know now. I changed fancyhdr
for scrlayer-scrpage
and have my headers and footers now like I want them. But when I implement them to my document I get difficulties with titlesec
. Specifically the titleformat
and titlespacing
part. And I don't know if caption
and booktabs
is compatible too, but that's not as big an issue. I should have concentrated on other packages i guess, but now I am here. Maybe someone can help?
\documentclass[12pt, a4paper]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\setlength{\parindent}{0em}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{graphicx, epstopdf}
\usepackage{booktabs}
\usepackage{gensymb}
\usepackage{hyperref}
\usepackage[onehalfspacing]{setspace}
\usepackage{chemstyle}
\usepackage[labelfont=bf, textformat=period, textfont=singlespacing, justification=justified]{caption}
\usepackage[raggedright]{titlesec}
\usepackage{xcolor}
%\usepackage{fancyhdr}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
%\input{titlepage}
\newpage
\thispagestyle{empty}
\quad
\newpage
\pagenumbering{Roman}
\titlespacing*{\chapter} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\clearpage
\phantomsection
\addcontentsline{toc}{section}{Declaration of Authorship}
%\input{declaration}
\clearpage
\phantomsection
\addcontentsline{toc}{section}{Abstract}
%\input{abstract}
\clearpage
\phantomsection
\addcontentsline{toc}{section}{List of Abbreviations}
%\input{abbreviations}
\clearpage
\phantomsection
\addcontentsline{toc}{section}{\contentsname}
\tableofcontents
\clearpage
\phantomsection
\addcontentsline{toc}{section}{\listfigurename}
\listoffigures
\clearpage
\phantomsection
\addcontentsline{toc}{section}{\listschemename}
\listofschemes
\clearpage
\phantomsection
\addcontentsline{toc}{section}{\listtablename}
\listoftables
\clearpage
\pagenumbering{arabic}
\definecolor{ultramarineblue}{rgb}{0.25, 0.4, 0.96}
%\pagestyle{fancy} % Turn on the style
%\fancyhf{}
%\renewcommand{\headrule}{{\color{ultramarineblue}%
% \hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}
%\renewcommand{\headrulewidth}{0.4pt} % optional
%\fancyhead[R]{\textsl{\leftmark}}
%\fancyfoot[R]{\vfootline\hspace{\linepagesep}\thepage}
%\fancypagestyle{plain}{%
% \fancyhf{} % clear all header and footer fields
% \fancyfoot[R]{\vfootline\hspace{\linepagesep}\thepage}
% \renewcommand{\headrulewidth}{0pt}
% \renewcommand{\footrulewidth}{0pt}}
%\newlength\linepagesep
%\setlength{\linepagesep}{5pt}
%\newcommand*\vfootline{\textcolor{ultramarineblue}{\rule[-2pt]{1pt}{2\ht\strutbox}}}
\titlespacing*{\chapter} {0pt}{50pt}{40pt}
\newcommand{\chapnumfont}{% % define font for chapter number
\usefont{T1}{pnc}{b}{n}% % choose New Chancery, bold, normal shape
\fontsize{130}{100}% % font size 100pt, baselineskip 100pt
\selectfont% % activate font
}
\colorlet{chapnumcol}{gray!75} % color for chapter number
\titleformat{\chapter}[display]
{\filleft\bfseries}
{\filleft\chapnumfont\textcolor{chapnumcol}{\thechapter}}
{-24pt}
{\Huge}
\chapter{ChapterTitle}
\lipsum
\section{SectionTitle}
\lipsum
\end{document}
As mentioned the fancyhdr is not the problem. here's my solution.
\documentclass[12pt, a4paper,foot lines=2]{scrreprt}
\usepackage{lipsum}% only for dummy text
\usepackage{xcolor}
\definecolor{ultramarineblue}{rgb}{0.25, 0.4, 0.96}
\renewcommand\chaptermarkformat{\chaptername\ \thechapter\autodot\ \ }
\usepackage[automark,headsepline,markcase=upper]{scrlayer-scrpage}
\clearpairofpagestyles
\ohead{\leftmark}
\rofoot*{\vfootline\hspace{\linepagesep}\pagemark}
\lefoot*{\pagemark\hspace{5pt}\vfootline}% for twosided document
\addtokomafont{headsepline}{\color{ultramarineblue}}
\newlength\linepagesep
\setlength{\linepagesep}{5pt}
\newcommand*\vfootline{{\usekomafont{headsepline}\rule[-2pt]{1pt}{2\ht\strutbox}}}
\begin{document}
\chapter{CTitle}
\lipsum
\section{STitle}
\lipsum
\end{document}
caption
andbooktabs
can be used with KOMA.