I'm new to latex and I'd like to write my bachelors thesis but I'm facing some problems, shown in the minimal working example below. Could you please help me with the following struggles?
- page numbers at the first page of each chapter are centered but should be on the right.
- The description of the chapter in the headers only works if the chapter contains a section. What do I have to do if I want the chapter number and name to appear in the header if there is no section or the section number and name to appear if there is a section (as it currently already works very well)?
- How can I make the space between two chapters smaller in the table of contents? When I add chapters manually to the table of contents it already works very well. However, the same procedure does not work for chapters that I add with \chapter.
Code: Select all
\documentclass[a4paper,12pt]{scrreprt}
\usepackage[left= 2.5cm,right = 2.5cm, bottom = 2.5cm, top = 2.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage[english]{babel}
\usepackage{blindtext}
\pagestyle{fancy}
%
\lhead{}
\chead{}
\rhead{\slshape \rightmark}
%%
\lfoot{}
\cfoot{}
\rfoot{\thepage}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\begin{document}
\pagestyle{empty}
Title page
\newpage
\pagestyle{fancy}
\pagenumbering{roman}
\setcounter{page}{2}
\addtocontents{toc}{\protect\vspace{-5pt}}
\addcontentsline{toc}{chapter}{list of figures}
\listoffigures
\addtocontents{toc}{\protect\vspace{-5pt}}
\newpage
\addtocontents{toc}{\protect\vspace{-5pt}}
\addcontentsline{toc}{chapter}{list of tables}
\listoftables
\newpage
\tableofcontents
\newpage
\pagenumbering{arabic}
\chapter{test chapter}
\blindtext[10]
\chapter{test chapter two}
\section{test section one}
\blindtext[10]
\end{document}
Marc