[Tex/LaTex] problem with title page fancy header

fancyhdrtitles

I'm having a problem that I can't even begin to understand the reason why it is happening. Last time I compiled, the result of my title page was normal:

enter image description here

Now for some reason after the last compilations, there is a header and a footer on the title page and it looks broken :

enter image description here

I tried to put a thispagestyle{empty} after the \maketitle command but it doesn't seem to work. Here's my code :

%HEADER
\fancypagestyle{plain}{
  \fancyhf{}% Clear header/footer
  \fancyhead[L]{Stage CME}
  \fancyhead[R]{Centrale Nantes - EMFI Haguenau}% Right header
  \fancyfoot[L]{\today}% Left footer
  \fancyfoot[R]{\thepage\ / 15}% Right footer
}
\pagestyle{plain}

%TITLE
\title{\textsc{stage connaissance du monde de l'entreprise} \\ Stage au     service contrôle process \textsc{emfi} Haguenau \\ Rapport de stage}
\author{Jérémy Diallo \\ \\ \textbf{Tuteur en entreprise :} \textsc{ober} Patrick \\ \\ \textbf{Responsable Centrale Nantes :} \textsc{le brizaut} Jean-Sébastien}
\date{Juillet 2016}
%DEBUT DU DOCUMENT
\begin{document}
\begin{multicols}{2}
%LOGOS
\begin{figure}[H]
\flushleft
\includegraphics[scale=0.1]{logoECN.png}
\end{figure}

\begin{figure}[H]
\flushright
\includegraphics[scale=0.2]{emfi.png}
\end{figure}

\end{multicols}
{\let\newpage\relax\maketitle}
\thispagestyle{empty}
\tableofcontents

I'm thiking maybe it has something to do with the packages I use but I don't remember changing anything between compilations. Here's my package call anyway :

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{graphicx}
\usepackage{layout}
\usepackage{eurosym}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
\usepackage[left=4cm, right = 4cm, top = 3.5cm, bottom = 3.5cm]{geometry}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{placeins}
\usepackage{pdfpages}
\usepackage{tocloft}
%For the trademarks
\usepackage{textcomp}
%FILIGRANE
\usepackage{draftwatermark}
\usepackage{appendix}

Any help is welcomed, thanks in advance 🙂

Best Answer

You're better to define your own page style, rather than redefining plain.

I made some changes to your code, notably

  • the document page style is in force throughout the document
  • the redefined plain page style will be used by \maketitle
  • hyperref should be last
  • lastpage will allow to use \pageref{LastPage} instead of hard coding the last page number
  • your awkward code for the logos has been simplified (there is no requirement that \includegraphics has to be in a figure environment)
  • I added fix-cm in order to get a big watermark
\documentclass{article}
\usepackage{fix-cm}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % use latin9 for your document
\usepackage[francais]{babel}

\usepackage{lipsum} % just for the example

\usepackage[demo]{graphicx} % remove demo for your document
\usepackage{layout}
\usepackage{eurosym}
\usepackage[left=4cm, right = 4cm, top = 3.5cm, bottom = 3.5cm]{geometry}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{placeins}
\usepackage{pdfpages}
\usepackage{lastpage}
\usepackage{tocloft} % don't forget the titles option
%For the trademarks
\usepackage{textcomp}
%FILIGRANE
\usepackage{draftwatermark}
\usepackage{appendix}

\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}

%HEADER
\fancypagestyle{document}{%
  \fancyhf{}% Clear header/footer
  \fancyhead[L]{Stage CME}
  \fancyhead[R]{Centrale Nantes - EMFI Haguenau}% Right header
  \fancyfoot[L]{\today}% Left footer
  \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% Right footer
}
\fancypagestyle{plain}{%
  \renewcommand{\headrulewidth}{0pt}%
  \fancyhf{}%
  \fancyfoot[C]{\thepage\ / \pageref{LastPage}}%
}
\pagestyle{document}

%TITLE
\title{%
  \textsc{stage connaissance du monde de l'entreprise} \\
  Stage au service contrôle process \textsc{emfi} Haguenau \\
  Rapport de stage}

\author{%
  Jérémy Diallo \\[\normalbaselineskip]
  \textbf{Tuteur en entreprise :} \textsc{ober} Patrick \\[\normalbaselineskip]
  \textbf{Responsable Centrale Nantes :} \textsc{le brizaut} Jean-Sébastien}

\date{Juillet 2016}
%DEBUT DU DOCUMENT
\begin{document}

\begin{center}
\includegraphics[scale=0.1]{logoECN.png}\hfill \includegraphics[scale=0.2]{emfi.png}
\end{center}
{\let\newpage\relax\maketitle}

\tableofcontents

\section{Title}

\lipsum

\section{Title}

\lipsum

\end{document}

enter image description here

Here's the same with report:

\documentclass{report}
\usepackage{fix-cm}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % use latin9 for your document
\usepackage[francais]{babel}

\usepackage{lipsum} % just for the example

\usepackage[demo]{graphicx}
\usepackage{layout}
\usepackage{eurosym}
\usepackage[left=4cm, right = 4cm, top = 3.5cm, bottom = 3.5cm]{geometry}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{placeins}
\usepackage{pdfpages}
\usepackage{lastpage}
\usepackage{tocloft} % don't forget the titles option
%For the trademarks
\usepackage{textcomp}
%FILIGRANE
\usepackage{draftwatermark}
\usepackage{appendix}

\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}

%HEADER
\fancypagestyle{document}{%
  \fancyhf{}% Clear header/footer
  \fancyhead[L]{Stage CME}
  \fancyhead[R]{Centrale Nantes - EMFI Haguenau}% Right header
  \fancyfoot[L]{\today}% Left footer
  \fancyfoot[R]{\thepage\ / \pageref{LastPage}}% Right footer
}
\fancypagestyle{plain}{%
  \renewcommand{\headrulewidth}{0pt}%
  \fancyhf{}%
  \fancyfoot[C]{\thepage\ / \pageref{LastPage}}%
}
\pagestyle{document}

%TITLE
\title{%
  \textsc{stage connaissance du monde de l'entreprise} \\
  Stage au service contrôle process \textsc{emfi} Haguenau \\
  Rapport de stage}

\author{%
  Jérémy Diallo \\[\normalbaselineskip]
  \textbf{Tuteur en entreprise :} \textsc{ober} Patrick \\[\normalbaselineskip]
  \textbf{Responsable Centrale Nantes :} \textsc{le brizaut} Jean-Sébastien}

\date{Juillet 2016}
%DEBUT DU DOCUMENT
\begin{document}

\begin{center}
\includegraphics[scale=0.1]{logoECN.png}\hfill \includegraphics[scale=0.2]{emfi.png}
\end{center}

{\let\newpage\relax\maketitle}
\clearpage

\tableofcontents

\chapter{Title}

\lipsum

\chapter{Title}

\lipsum

\end{document}

enter image description here

The title block is not really centered (you got approximate centering by pure chance); other changes are needed if you want vertical centering, but it's unclear with respect to what.