Page Layoutfancyhdr | Missing Headers and Footers in Report

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
zigou
Posts: 3
Joined: Mon Dec 10, 2012 2:39 am

fancyhdr | Missing Headers and Footers in Report

Post by zigou »

Hi everybody,

I've been struggling for quite a long time now trying to understand what's wrong, I tried searching online but I didn't find any solutions. So I'm asking your help to get me through that problem.

So I'm writing a document using the report class, I would like to have headers and footers on my document using the fancyhdr package. But so far I don't get any headers or footer whatsoever, except on a page where I've included a picture. What's more intriguing is that when I use either the book or article class the headers and footers appear correctly. I am completely lost, so if anyone of you has an idea...

PS: I'm using TeXmaker and MikTeX

Thank you all for any help you could provide me

Code: Select all

\documentclass[a4paper,11pt,twoside]{report}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[colorlinks,linkcolor=black]{hyperref} 
\usepackage{url} 
\usepackage[draft]{graphics} 
\usepackage{pdfpages} 
\usepackage{eurosym} 
\usepackage{fancyhdr}
\usepackage{multirow} 
\usepackage[french]{varioref} 
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{fancybox}
\usepackage{xcolor}
\usepackage[cc]{titlepic}


\pagestyle{fancy} 
\fancyfoot[C]{\thepage}
\lfoot{}\cfoot{- \thepage ~-}{\rfoot{} 
\lhead{Business plan}
\rhead{\includegraphics[height=1cm]{logoismans.jpg}}
\lfoot{} %pied de page gauche
\rfoot{Année 2012-2013}
\addtolength{\hoffset}{-1cm}
\addtolength{\textwidth}{2cm} 
\addtolength{\voffset}{-1cm}
\setlength{\headheight}{20pt}
\DeclareGraphicsExtensions{.png,.jpg,.pdf} 

\begin{document}

\renewcommand{\contentsname}{Sommaire} 
\renewcommand{\refname}{Bibliographie} 


\title{Business plan\\ Voyage dans l'espace}
\author{}
\date{17 décembre 2012}
\titlepic{\includegraphics[width=15cm]{photogarde}}
\maketitle


\newpage


\tableofcontents

\newpage

\chapter{Présentation du projet}

\chapter{\'Etude de marché}
	\section{La demande}

Le rêve du voyage dans l'espace semble devenir de plus en plus accessible, grâce à la démocratisation des technologies permettant de réaliser une telle prouesse. Par ailleurs cette idée est basée sur le rêve, or même en temps de crise le rêve reste vendeur. On remarque qu'il existe aujourd'hui des possibilités d'effectuer des voyages dans l'espace à coût prohibitif. Mais pour des gens dont les moyens sont plus faibles une telle offre est inexistante, il y a donc un créneau à prendre. Selon un sondage récent approximativement une personne sur deux aimerait aller dans l'espace \cite{espace}. En ce qui concerne le nombre de clients en prenant une estimation assez stricte on considère que seuls les milionnaires ont assez de fonds pour s'offrir un tel voyage, cela représente tout de même 11 millions\cite{million} de clients potentiels, ou en tenant compte du sondage précédemment cité 5 millions de personnes possiblement interessées.

	\section{L'environnement}
		\subsection{Réglementation}

Un projet tel qu'envoyer des personnes dans l'espace, doit se faire dans un souci de sécurité constant. Cette activité peut se révéler très dangereuse. 


\chapter{Produits et services}
\section{Le produit}
Nous vendons un vol dans l'espace à prix « abordable », environ 20 000 euros. Ce vol est réalisé à l’aide d’un Tupolev TU-144 (cf. figure \vref{tupo}), ancien avion soviétique mythique. La vente concerne donc un billet d'avion modifié afin de pouvoir voler durant une certaine durée dans l'espace grâce à un projet ambitieux faisant intervenir le passé pour créer le futur en démocratisant les vols dans l'espace, appuyée sur une collaboration inédite de différents pays du monde (Etats-Unis, Russie, France). Tout au long de ce vol un service haut de gamme aux passagers agrémentera les différentes étapes importantes de ce vol.
\begin{figure}[h]
\centering
\includegraphics[width=10cm]{tupo}
\caption{Le Tupolev TU-144}
\label{tupo}
\end{figure}
\section{Avantages par rapport à la concurrence}
Le gros avantage vis-à-vis de la concurrence principale demeure le prix du billet due à la capacité de l'appareil utilisée qui permettra ainsi de mieux rentabiliser les vols.
Cependant et très récemment, un nouveau concurrent est apparu l'airbus A300 zero- G, proposant des vols en apesanteur, pour 5980 euros TTC.
La seule réponse à ce prix, reste de dire, tout comme pour le choix d'une automobile, soit soit on va vite fait en apesanteur dans un basique Airbus A300 soit on décole en TUTU , alias tu choisis une Dacia, ou UN mini cooper S… La réponse est évidente car la clientèle n'est pas la même…reste avoir le ratio Boloss/ mec normal sur terre, pas sur qu'on gagne la dessus.
\section{Le prix}
Environ 20 000 Euros par tête, voir éventuellement pour faire des prix pour les familles ou les – de 25 ans. J’ai aussi pensé faire des mariages dans l’espace si jamais ca vous dit.
\chapter{Stratégie marketing}

\chapter{Données financières}



\addcontentsline{toc}{chapter}{Bibliographie}

\begin{thebibliography} {9}                                                                                              

\bibitem{espace} \href{http://opinions.lexeek.com/souhaiteriez-vous-pouvoir-voyager-dans-esp-f6fr/}{Sondage sur les personnes désirant se rendre dans l'espace}
\bibitem{million} \href{http://www.latribune.fr/entreprises-finance/20120620trib000704876/le-nombre-de-millionnaires-augmente-								mais-au-total-leur-fortune-diminue.html}{Nombre de millionaire dans le monde}
\bibitem{loiespace} \href{http://www.cnes.fr/web/CNES-fr/7220-la-loi-spatiale.php}{Loi relative aux opérations spatiales}

\end{thebibliography}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

fancyhdr | Missing Headers and Footers in Report

Post by Stefan Kottwitz »

Hi zigou,

welcome to the board!

Very good that you posted a complete example for checking the issue. It would be great if you would make it smaller next time, just removing not relevant packages and content, as long as the problem is visible.

Her you can see the default behavior of LaTeX: pages where chapters start, have the page style plain. That's also because of the big headings, and their special status. For example, it's not meaningful to have a running page header with chapter or section title at a page where the big chapter title itself is displayed in the heading in the text body. Your document mainly consists of chapter starting pages, that's why you think nearly all pages would be affected. You would better see it after you added more content. And have a look at books: chapter starting pages are very often different, i.e. without a header.

You can change it though, for example by

Code: Select all

\fancypagestyle{plain}{}
in your preamble.

Stefan
LaTeX.org admin
zigou
Posts: 3
Joined: Mon Dec 10, 2012 2:39 am

Re: fancyhdr | Missing Headers and Footers in Report

Post by zigou »

Danke Schön Stefan_K for your quick answer :D
SO in fact everything was in order, i was just worrying for somethign that was normal. I did cleaned my code supressed my comments and stuff but next time i'll clean it more to ease your work.

Thanks again.

Tim

ps: Thank you for editing my post.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

fancyhdr | Missing Headers and Footers in Report

Post by Stefan Kottwitz »

Hi Tim,

posting a complete preamble can lead to suggestions though. ;-)

For example
  • \usepackage[draft]{graphics} can be omitted since you load graphicx later, which is better, and required for key=value options. Btw. the draft option suppresses loading of images.
  • \addtolength{\hoffset}{-1cm} etc.: I would use the geometry package instead: you can specify page dimensions via options, geometry calculates missing dimensions automatically so that it fits. It's easier and safer.
  • \DeclareGraphicsExtensions{.png,.jpg,.pdf} should not be necessary.
  • \renewcommand{\contentsname}{Sommaire} etc. can be done in the preamble by \addto{\captionsfrenchb}{\renewcommand{\contentsname}{Sommaire}...}.
Perhaps something of this is helpful.

Stefan
LaTeX.org admin
zigou
Posts: 3
Joined: Mon Dec 10, 2012 2:39 am

fancyhdr | Missing Headers and Footers in Report

Post by zigou »

Thank you verymuch for these suggestions, i'm hapy i've posted my entire preamble then !
I have two more questions, the code you can find under:

Code: Select all

\fancyfoot[C]{\thepage}
\lfoot{}\cfoot{- \thepage ~-}{\rfoot{} 
I've used it to put the page number surrounded by "-" but then if i get you right on chapter pages it shouldnt work so is there a way to male it work through the entire document ?

I also have remarked that page number on chapter page and on "regular" pages are not horizontally aligned the same, do you have an idea ?

Anyway a big thanks already for all your answers.

Tim
Post Reply