13

Using fancyhdr and the book class, one can set different headers/footers for odd/even pages as

\fancyhdr[RO]{foo}
\fancyhdr[LE]{bar}

and so on. How can I achieve the same with an article class, where things are not two sided?

0

1 Answer 1

12

The article class defaults to a simple oneside document. You can load it with the twoside option

\documentclass[twoside]{article}

\usepackage{fancyhdr}
\fancyhead[LE,RO]{foo}
\fancyhead[LO,RE]{bar}
\pagestyle{fancy}
\usepackage{lipsum}

\begin{document}

\lipsum
\lipsum
\lipsum

\end{document}
2
  • That apparently changes the whole geometry of the first two pages: the settings of \usepackage{geometry} seem to be ignored there, but honored in the following pages. Any way to fix this?
    – Andyc
    May 25, 2021 at 19:09
  • @Andyc perhaps you could create a complete minimum working example and post a follow-up question?
    – cmhughes
    May 26, 2021 at 13:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .