TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the package fancyhdr to format my footers and headers, with my name in the header and a n of m pages format for the footer. Like so:

\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\footnotesize Page \thepage\ of \pageref{LastPage}}

By default, the fancy page style only affects the pages after the first page. I know I can set the first page to the fancy page style using \thispagestyle, but I only want the first page to use the footer, not the header. Is there a way to create a custom style that just the first page will use?

share|improve this question

migrated from stackoverflow.com Oct 2 '11 at 10:44

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – N.N. Oct 3 '11 at 8:38

The \fancypagestyle command can be used to create custom styles:

   \fancyfoot[C]{\footnotesize Page \thepage\ of \pageref{LastPage}}

Then just use \thispagestyle{firststyle} on the first page.

share|improve this answer
how to remove the horizontal bar that is still appearing on the first page ? – Frankenstein Jun 3 at 2:02

The best strategy is probably to redefine the plain page style that LaTeX applies automatically with \maketitle in the article class or with \chapter in the report and book classes:

  \fancyfoot[C]{\footnotesize Page \thepage\ of \pageref{LastPage}}%
share|improve this answer

A solution not constrained to cases where \maketitle is used and hence is perhaps more flexible:

\rhead{\ifthenelse{\value{page}=1}{\bfseries p1-title}{p2-and-following-title}}





% \usepackage[top=10mm, bottom=10mm, left=10mm, right=10mm,includehead,includefoot]{geometry}



\rhead{\ifthenelse{\value{page}=1}{\bfseries The performance of Black Swans}{second page}}

\lfoot{From: K. Smith}
\cfoot{To: Jean A. Cory}



share|improve this answer
The second of these pieces of code does not work, even when one corrects the obvious typos. \renewcommand is not approriate here, and you should just use the command \rhead as in you first snippet. There are formatting problems with you answer, and you should not just post a duplicate of another of your answers. A comment with a link would be more appropriate in this case. – Andrew Swann Jul 4 '13 at 11:09
@AndrewSwann Marked the other Q&A as duplicate (and also deleted my answer there), and got rid of the "alternative" :-) – nutty about natty Jul 4 '13 at 11:48
That's an improvement. The first sentence of your answer still looks strange though and answers are better with a complete working document rather than code snippets. – Andrew Swann Jul 4 '13 at 15:12
@AndrewSwann added an MWE, changed the first sentence ;) – nutty about natty Jul 4 '13 at 15:36

It might be the case that the first page is not showing the desired fancy style because you are using \maketitle in it. \maketitle automatically resets the pagestyle to plain.

In that case, simply adding \pagestyle{fancy} after the \maketitle command should solve the problem:

\pagestyle{fancy}   % add this after maketitle
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.