0

I'm currently writing my thesis and found a problem with my pagenumbering. Only on pages where a new chapter starts, there is a page number, on the following pages the footer is missing. The pages without the footer still get counted, since on the next page with a chapter start there is the correct pagenumber. I've tried using this solution, but it didn't work for me. Please see the code attached:

\documentclass[hidelinks, a4paper,12pt]{scrreprt}
\usepackage[left= 2.5cm,right = 2cm, bottom = 2.5cm, top=3cm]{geometry}
\usepackage[onehalfspacing]{setspace}

% ============= Packages =============
\usepackage[hidelinks]{hyperref}
\usepackage{hyperref}

\title{Thesis}
\author{name, name}
date{DD.MM.YYYY}


\hypersetup{
    pdftitle={NAMEOFREPORT},    % title
    pdfauthor={Name, Name},     % author
    pdfcreator={Name, Name},    % creator of the document
        %hidelinks  %somehow doesnt work
        colorlinks=true,
        linkcolor=black,
        citecolor=black,    
        filecolor=black,
}

% Standard Packages
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx, subfig}
\graphicspath{{img/}}
\usepackage{fancyhdr}
\usepackage{lmodern}
\usepackage{color}
\usepackage{setspace}
\usepackage{acronym}
\usepackage{listings}
\usepackage{amsfonts}
\usepackage{amsmath,amssymb}

%Arial if wanted
%\usepackage{uarial}
%\renewcommand{\familydefault}{\sfdefault}

%Acronyms
\usepackage{acronym} %[nohyperlinks, printonlyused, withpage, smaller]


% Table of Contents formatting
\usepackage{tocloft}
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} % for parts
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters


% Spacing
\onehalfspacing


% Parindent
\setlength{\parindent}{0pt}


% ============= Header / Footer =============
\pagestyle{fancy}
%
\lhead{}
\chead{}
\rhead{Some title here} %Alt:\rhead{\slshape \leftmark}
%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}

%Hyphenation
\hyphenation{De-zi-mal-tren-nung}


% ============= Document start =============

\begin{document}
%No header /footer
\pagestyle{empty}

\include{01_title}
\cleardoubleoddpage

% pagestyle
\pagestyle{fancy}
\pagenumbering{Roman}
\sloppy

%TOC ETC

%TOC
\addcontentsline{toc}{chapter}{Table of Contents}
\tableofcontents
\cleardoublepage


%Figures
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures


%Tables
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables
\cleardoublepage


%Abbreviations
\addcontentsline{toc}{chapter}{List of Abbreviations}
\include{acronyms}
\cleardoublepage


%arabic numbering following
\pagenumbering{arabic}

\include{02_some_input}

\end{document}

The 02_some_input file:

\chapter{Some chaptername here}
\label{chap:chap_name}
\section{Some section}
\label{sec:section}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy     
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita 
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie 
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et 
accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit 
augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut 
laoreet dolore magna aliquam erat volutpat.   

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit 
lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure 
dolor in hendrerit in vulputate velit esse molestie consequat, vel illum 
dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio 
dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te 
feugait nulla facilisi.   

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet 
doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut 
laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,                 
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex 
ea commodo consequat.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie 
consequat, vel illum dolore eu feugiat nulla facilisis.   

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam 
diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt 
justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed 
takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor 
sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt 
ut labore et dolore magna aliquyam erat.   

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus.   
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit 
lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure 
dolor in hendrerit in vulputate velit esse molestie consequat, vel illum 
dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio 
dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te 
feugait nulla facilisi.   

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet 
doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut 
laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,                 
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex 
ea commodo consequat.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie 
consequat, vel illum dolore eu feugiat nulla facilisis.   

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam 
diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt 
justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed 
takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor 
sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt 
ut labore et dolore magna aliquyam erat.   

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus.   

When I compile the files I get the following results: enter image description here

As you see, on the first page there is a footer, on the second there isn't. Does anyone know a work around for this?

On the pages with the toc and lists of [...] the pagenumbering in roman works perfectly. It's just the parts where the capters start.

  • Welcome in tex.sx ! Try to add in your declaration of pagestyle (fancy setup) the same settings for : \fancypagestyle{plain} than for \pagestyle{fancy} so that, you add : {\lhead{} \chead{} \rhead{Some title here} %Alt:\rhead{\slshape \leftmark} % \lfoot{} \cfoot{\thepage} \rfoot{} %% \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt}}` – Piroooh Jun 7 at 14:28
  • Just remove all the stuff between Header / Footer and Document start. You should not use fancyhdr with KOMA script anyway. There is more to say about your code, though. Do you need all the stuff in there? Do you have to use those (not very nice) page margins and onehalfspacing? – schtandard Jun 7 at 14:38
  • For future questions, please have a look at this guide to writing minimal working examples. This will help you immensely in finding help on this site. Good luck with your thesis! – schtandard Jun 7 at 15:19
  • The first page of a chapter uses page style plain by default. It seems that on the other pages in your document page style empty is used. So maybe there is a \pagestyle{empty} command in your document without a later \pagestyle{fancy}? But as already mentioned: it is not recommended to use fancyhdr together with a KOMA-Script class. – esdd Jun 7 at 15:36
1

Oh, that's a mess. My advice: Start over with a cleaner template. Yours is full of issues and I don't think you need all of the stuff in it. Below I have your template with all of the stuff I don't think you need (for now) removed and some other stuff that you probably want (but don't need to worry about) added. You could just use this for now and extend it as you go. You will find help on this site when you have any specific issue.

Some more notes:

  • If you use KOMA script (your document class is scrreprt), which I recommend, you should have a look at its manual. It is very extensive and you will find instructions on most things you could want to change about your document layout there (including modification of headers and footers). There even is a German version of the manual.
  • If you need to use tables, use booktabs and have a look at its manual.
  • If you need to use numbers and/or units, use siunitx and have a look at its manual.
  • If you need chemical formulae, use mhchem and have a look at its manual.
  • If you need a bibliography, use biblatex and search for usage examples and introductions online.
  • In general, when learning LaTeX, lots of reading the documentation is beneficial.

The specific issue you asked about is just a consequence of improper modification of page styles using fancyhdr. Remove the modification and everything is okay. When using KOMA script, you should not use fancyhdr anyway but rather use the respective capabilities of KOMA script.


\documentclass[
        ngerman,
    ]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\input{glyphtounicode}
\pdfgentounicode=1

\usepackage{babel}
\usepackage{microtype}
\usepackage[defaultlines=3, all]{nowidow}

\usepackage{graphicx}
\graphicspath{{./img/}}

\usepackage{amsmath,amssymb}

\usepackage[hidelinks]{hyperref}

\title{Thesis}
\author{name, name}
\date{DD.MM.YYYY}

\begin{document}

\maketitle

Hello World!

\end{document}
  • Took your advice and started a new template (only using KOMA-Script). Works better now. Thank you! – xSaturn Jun 11 at 12:59
0

I rewrite it here to be more clear.

The style page for chapter is different than for the plain pages who used plainstyle. When you define :

\pagestyle{fancy}
%
\lhead{}
\chead{}
\rhead{Some title here} %Alt:\rhead{\slshape \leftmark}
%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}

This new style will be use for chapter style. To apply it on the whole project, you have to redefine the plain style who is used. Add :

\fancypagestyle{plain}{
%
\lhead{}
\chead{}
\rhead{Some title here} %Alt:\rhead{\slshape \leftmark}
%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}}

in the preamble to set up fancyhdrpackage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.