Page Layout ⇒ Fancy Header: page numbering in footer and header
Fancy Header: page numbering in footer and header
I am creating a book using the following:
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[CE,CO]{\bfseries\thepage}
\fancyhead[CO]{\bfseries\rightmark}
\fancyhead[CE]{\bfseries\leftmark}
\fancyhead[RE]{\thepage}
\fancyhead[LO]{\thepage}
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers
\renewcommand{\headrulewidth}{0pt} % and the line
}
At each chapter (separate files) I have something like the following:
\pagestyle{fancy}
\fancyhead[CE]{Chapter One} %chapter number
\fancyhead[CO]{Introduction} %chapter name
Page numbers appear in the header of all pages except the first page of each chapter (where they don't appear at all). I need to have page numbers at the bottom of the page on the first page of each new chapter (only here...the rest of the time the pages need to be in the header). Can anyone tell me how to do that with fancyhdr?
Thanks!
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
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Fancy Header: page numbering in footer and header
welcome to the board!
The first page of a chapter has the plain style. That means no header, no head rule and the page number centered in the bottom. To achieve that, you just need to remove these lines:
Code: Select all
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers
\renewcommand{\headrulewidth}{0pt} % and the line
}
Stefan
Re: Fancy Header: page numbering in footer and header
That worked!
Shannon
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Fancy Header: page numbering in footer and header
I'm glad to read that it works.
Just a general remark: it's good to mark a topic as "solved" when the question has been solved. This improves the readability of the forum and makes it easier to identify unsolved problems. It can be done by editing the first post of the topic and choosing the checkmark.
Best regards,
Stefan