1

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}

1 Answers1

1

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

  • 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{}} –  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