2

I begin saying that I'm a LaTeX novice, I mostly try to emulate others' work to produce documents.

Then, I'm trying to write my master thesis. I'm trying to use the fancyhdr package and in my previous works it worked. However, here it does not.

I'm attaching my whole code, except for the written parts (of course)

Thanks a lot to anyone who could help me.


\documentclass[a4paper, 12pt]{report}   
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{afterpage}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fancyhdr}
\pagestyle{headings}
\fancyhead{}
\fancyhead[CO,CE]{[...]}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[LO,CE]{Chapter \thechapter}
\fancyfoot[CO,RE]{Myname}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\addtolength{\headheight}{0pt}
\fancypagestyle{plain}{
}
\setlength{\parskip}{1ex plus 0.5ex minus 0.4ex} 
\linespread{1.5}
\newcommand{\spa}{\hspace{2cm}}
\begin{document}
  \begin{titlepage}
    [...]
\end{titlepage}
\newpage
\thispagestyle{empty}
\mbox{}
\newpage
\thispagestyle{empty}
\begin{center}
\bigskip
    \textbf{Abstract}
\end{center}
[...]

\newpage
\thispagestyle{empty}
\mbox{}
\tableofcontents  
\pagenumbering{arabic}
\clearpage
\setlength{\headsep}{1pt}
\chapter{Introduction}
\section{The European Union}
[...]
\end{document}

Here's what the output gives, I would like to have the headers/footers in both pages (and then on). Output

  • 6
    \pagestyle{fancy}, not \pagestyle{headings} – egreg Feb 4 '18 at 17:26
  • Welcome to TeX.SX! – Bobyandbob Feb 4 '18 at 17:34
  • The first page of a \chapter in report uses plain, so \pagestyle{fancy} would not work here (or headings) – user31729 Feb 4 '18 at 17:54
  • Are you sure you want a header on the first page of chapters? This is not at all usual. – cfr Feb 4 '18 at 20:16
  • @ChristianHupfer It will here because plain has been redefined to make no changes. – cfr Feb 4 '18 at 20:18

Your Answer

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

Browse other questions tagged or ask your own question.