1

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 :)

3
  • Please post a compilable document, not just fragments we have to glue together!
    – user31729
    Aug 26, 2016 at 10:38
  • Why don't you use \begin{titlepage} … \end{titlepage}? Then you could put \thispagestyle{empty} into that environment.
    – Andreas
    Aug 26, 2016 at 10:44
  • @Andreas when I use \thispagestyle{empty} in a long section (such as a two pages title or the abstract) it only affects the first page of that section. How can I force it to affect all the pages?
    – skan
    Jul 28, 2019 at 16:32

1 Answer 1

2

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.

8
  • Thanks a lot for all the tips, it really helps me in my learning process. However, the result you suggested isn't really what I was looking for. I would like to have the exact same result that you can see on the first screenshot, that is a title page with an empty page style. How could I do that ? Aug 26, 2016 at 16:45
  • @JeremyDiallo Remove \fancyfoot[C]{\thepage\ / \pageref{LastPage}} from the redefinition of the plain page style
    – egreg
    Aug 26, 2016 at 19:45
  • Thanks ! Just one more question, why is it that my title isn't centered vertically anymore as opposed to the first screenshot ? It's not that big a deal but I would like my report to be absolutely perfect ! ;) Aug 27, 2016 at 17:16
  • @JeremyDiallo Well, you had no table of contents nor text. You got centering by pure chance.
    – egreg
    Aug 27, 2016 at 17:55
  • I don't understand, the screenshot I took is from a document with a table of content and a text. And I'm using the report document class which is supposed to center the title automatically isn't it ? Aug 27, 2016 at 20:38

You must log in to answer this question.

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