5

When I create a document that has but one page, I see no reason to have a page number in the footer. I would like to remove this. There is, however, apparently no such equivalent to thispagestyle{plain}, which removes the header on the first page. I would have thought thispagestyle{headings} would do the trick, but no.

MWE:

\documentclass{article}
\usepackage{lipsum,fancyhdr}
    \pagestyle{fancy}
    \fancyhead[L]{My name}
    \fancyhead[R]{My affiliation}
\begin{document}
\thispagestyle{headings} % this removes my header and puts the page number there
\lipsum[1]
\end{document}
Sverre
  • 20,729

3 Answers3

3

Adding \fancyfoot{} removes the footer:

\documentclass{article}
\usepackage{lipsum,fancyhdr}
    \pagestyle{fancy}
    \fancyhead[L]{My name}
    \fancyhead[R]{My affiliation}
    \fancyfoot{}
\begin{document}
\lipsum[1]
\end{document}

enter image description here

azetina
  • 28,884
3

After \pagestyle{fancy} it's usually better to say \fancyhf{} that clears all the six fields, so that you can decide what to put in each one. If you don't specify \fancyfoot, nothing will go in the footer.

\documentclass{article}
\usepackage{lipsum,fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{My name}
\fancyhead[R]{My affiliation}

\begin{document}

\lipsum[1]

\end{document}
egreg
  • 1,121,712
1

If you don't want to load any package to do this you can just redefine the footers.

\documentclass{article}
\usepackage{lipsum}
\makeatletter
\def\@evenfoot{}
\def\@oddfoot{}
\makeatother

\begin{document}
\lipsum
\end{document}
Sigur
  • 37,330