Page Layoutfancyhdr | Header only in first Chapter

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
brunoasroma
Posts: 3
Joined: Mon Mar 05, 2012 10:19 pm

fancyhdr | Header only in first Chapter

Post by brunoasroma »

Hello everyone,

I have a problem with fancyhdr package, it prints the header in the table of contents, index of figures, bibliography and the first chapter. From chapter 2 and throughout all the chapters I have no header (but I have the page number in the foot). In the first chapter it works all fine, it prints numberofchapter.numberofsection nameofsection but the header disappears from chapter 2.
Please help me, here's the code

Code: Select all

\documentclass[a4paper,11pt]{report}
\usepackage[latin1]{inputenc}
\usepackage[italian]{babel}
\usepackage{geometry}
\geometry{left=2.5cm}
\geometry{right=2.5cm}
\geometry{top=3cm}
\geometry{bottom=2cm}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{fancyhdr}
\pagestyle{fancyplain}

\lhead{}
\chead{}
\rhead{\nouppercase{\rightmark}}
\lfoot{}
\cfoot{}
\rfoot{\thepage}
\begin{document}
\begin{titlepage}
Last edited by localghost on Mon Mar 05, 2012 11:02 pm, edited 2 times in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

fancyhdr | Header only in first Chapter

Post by Stefan Kottwitz »

Hi,

welcome to the board!

So what you are doing from chapter 2 on? You showed just the beginning, where still all is ok.

Note, the first page of each chapter has plain page style, which means no header. If each chapter from chapter 2 on consists just of one page, still, you would not see the header again because all pages would have plain page style, not fancy.

Stefan
LaTeX.org admin
brunoasroma
Posts: 3
Joined: Mon Mar 05, 2012 10:19 pm

Re: fancyhdr | Header only in first Chapter

Post by brunoasroma »

Hi,
yes I know, I've chosen \pagestyle{fancyplain} cause I like that the first page of each chapter have no header.
Chapter 2,3 and 4 have more than page each. I can't understand the problem, it's like \rightmark can't go over the first chapter.
Maybe is there a problem with the documentclass (report) ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

fancyhdr | Header only in first Chapter

Post by Stefan Kottwitz »

report and fancyhdr are compatible. Perhaps post a Infominimal working example, which shows the problem. This can be a hacked down copy of your document, reduced but still compilable. Insert dummy text if necessary.

Stefan
LaTeX.org admin
brunoasroma
Posts: 3
Joined: Mon Mar 05, 2012 10:19 pm

Re: fancyhdr | Header only in first Chapter

Post by brunoasroma »

I was writing some text in the document to post here an I figured out: chapters 2,3,4 have no sections, I started text, tables, and figures right afeter \chapter{blabla} (it's still a draft) that's why \rightmark wasn't printing anything. Thank you for helping me figure it out and thank you for your time!
Post Reply