Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Custom first page with fancyhdr

I don't know how to turn off the page number on the first page of the following article with different headers on odd and even pages. I tried \thispagestyle{empty} after \begin{document} but it doesn't work. The rest is OK.

 \documentclass[a4paper,12pt,twoside]{article}
 \usepackage{lipsum}
 \newcommand\shorttitle{The Short Title}
 \newcommand\authors{Author}
 \usepackage{fancyhdr}
 \pagestyle{fancy}
 \fancyhf{}
 \fancyhead[RO,LE]{\thepage}
 \fancyhead[CO]{\shorttitle}
 \fancyhead[CE]{\authors}
 \renewcommand{\headrulewidth}{0pt}
 \begin{document}
 \thispagestyle{empty}  
 \title{The Full Title}
 \author{Author}
 \maketitle
 \section{Section A}
 \lipsum[1-2]
 \section{Section B}
 \lipsum[3-10]
 \end{document}

ADDED. I don't want any header or footer on the first page.

ADDED 2: As commented by Herbert writing \fancypagestyle{plain}{\fancyhf{}}after \usepackage{fancyhdr} makes what I want.

EDIT: \thispagestyle{empty} is not needed. The revised code becomes

 \documentclass[a4paper,12pt,twoside]{article}
 \usepackage{lipsum}
 \newcommand\shorttitle{The Short Title}
 \newcommand\authors{Author}
 \usepackage{fancyhdr}
 \fancypagestyle{plain}{\fancyhf{}}
 \pagestyle{fancy}
 \fancyhf{}
 \fancyhead[RO,LE]{\thepage}
 \fancyhead[CO]{\shorttitle}
 \fancyhead[CE]{\authors}
 \renewcommand{\headrulewidth}{0pt}
 \begin{document}
 \title{The Full Title}
 \author{Author}
 \maketitle
 \section{Section A}
 \lipsum[1-2]
 \section{Section B}
 \lipsum[3-10]
 \end{document}
share|improve this question

marked as duplicate by egreg, Marco Daniel, percusse, barbara beeton, zeroth Sep 28 '12 at 13:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
didn't you read my last comment? –  Herbert Sep 28 '12 at 11:38
    
@Herbert I did read. The \fancypagestyle{plain}{\fancyhf{}}after \usepackage{fancyhdr}fixed the problem. Many thanks! –  Américo Tavares Sep 28 '12 at 11:42
    
@egerg This question may be an "exact duplicate of Custom first page with fancyhdr" for those who have a good knowledge of these matters, which I do not have. The existing answer was very useful to me. –  Américo Tavares Sep 28 '12 at 13:17
add comment

1 Answer 1

up vote 1 down vote accepted

\maketitle uses pagestyle plain. Writing \fancypagestyle{plain}{}
 after loading the package should help

share|improve this answer
    
I've written \fancypagestyle{plain}{}after \usepackage{fancyhdr}. This removed the page number on the footer of the first page, but it has the undesired effect of making a header on the first page too, which I don't want. –  Américo Tavares Sep 28 '12 at 11:15
1  
then use \fancypagestyle{plain}{\fancyhf{}} –  Herbert Sep 28 '12 at 11:17
1  
Add also \renewcommand{\headrulewidth}{0pt} if the rule is not wanted in the first page. –  egreg Sep 28 '12 at 11:38
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.