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
1 Answers
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.
- 506,678
fancyhdr, or using the in built commands of the KOMA class etc. It depends largely on the document class that you are using – Troy Mar 17 '17 at 03:16articleandreport, set the optiononesideby default. For such classes, it's necessary to specifytwosideexplicitly in order to get the page number placement to depend on whether the page number is even or odd. – Mico Mar 17 '17 at 07:53