1

I was wondering how to treat odd and even numbered pages differently, for example I want the page number appear on the upper right corner of the page on odd pages while upper left corner of the page on even pages. How can I accomplish this? Many thanks in advance

Jiapan
  • 731

1 Answers1

3

Assuming you're using the article or report document class, or a class that's based on one of these classes, you may achieve your objective, which I'll paraphrase as

I want the page number to appear in the upper right corner of the page on odd-numbered pages but in the upper left corner of the page on even-numbered pages

by specifying the document class option twoside explicitly and by inserting the instruction

\pagestyle{myheadings}

in the preamble.

A full MWE (minimum working example):

\documentclass[twoside]{article} % or: "report"
\pagestyle{myheadings}
\usepackage{lipsum}
\begin{document}
\lipsum[1-20]
\end{document} 

There are other, far more general, ways of determining what goes in the header and footer lines of a page. You may want to study the user guide of the fancyhdr package for some of the possibilities. Some document classes, such as the memoir class and the KOMA-Script family of document classes, provide further possibilities in this regard.

Mico
  • 506,678