1

I'm trying to get a small image into the footer of my report. I found online that the best way to do this is by using the fancyhdr package. I thus included following code into my main.text document, just above the \begin{document}:

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{Overleaf}
\lhead{Guides and tutorials}
\rfoot{Page \thepage}

After this piece, the subsequent code follows:

\begin{document}

\normallinespacing

\begin{titlepage}
\input{components/titlepage.tex}
\end{titlepage}

\tableofcontents

\chapter{Abstract}

[...]

Now, the issue is that the fancyhdr style is only applied to the titlepage. It doesn't affect the consecutive pages. It should actually be in the reverse order. fancyhdr should only be applied to all pages except the first one.

I created a sample public project online on Overleaf.

Here's a screenshot of the example title page: enter image description here

Here's a screenshot of a random other page: enter image description here

1 Answer 1

0

The "random other page" is not a random page, but the first page of a chapter, which uses the plain page style. This page style can be changed like this:

\documentclass[a4paper,12pt]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry}
\usepackage{titlesec}
\usepackage{cite}
\usepackage{subcaption}
\usepackage{graphicx}

\usepackage[utf8]{inputenc}

\include{styles/thesis.preamble}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{Overleaf}
\lhead{Guides and tutorials}
\rfoot{Page \thepage}

\fancypagestyle{plain}{
\fancyhf{}
\rhead{Overleaf}
\lhead{Guides and tutorials}
\rfoot{Page \thepage}
}

\begin{document}

\normallinespacing

\begin{titlepage}
\input{components/titlepage.tex}
\end{titlepage}

\tableofcontents

\chapter{Abstract}
\input{content/abstract/abstract.tex}

\chapter{Introduction}
\input{content/introduction/motivation.tex}
\input{content/introduction/problem-definition.tex}
\input{content/introduction/contributions.tex}
\input{content/introduction/structure-of-this-report.tex}

\chapter{Background}
\input{content/background/background.tex}

\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{IEEEtran}
\bibliography{biblio}

\end{document}
1
  • Thanks a lot! This works!
    – Jérémy
    Jun 11, 2019 at 12:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .