# How to move page number?

I want to change the position of the page number. I've read around here that some suggest to use the fancyhdr package, but I don't want to use it – I'm a beginner to LaTeX so I don't want to use a package that could change the margins and other specifications to the layout that I've already made. Does anyone have any idea how to, or possibly correct me if my concerns (in regard to fancyhdr) are unfounded?

-
What documentclass do you use? And what pagestyle? And where do you want to move the pagenumber to? –  Harald Hanche-Olsen Jan 12 '11 at 21:06
fancyhdr didn't change any margin ... However, what documentclass you are using? –  Herbert Jan 12 '11 at 21:08
Here's my code: pastebin.com/raw.php?i=DGVEJvzX. –  Halime Jan 12 '11 at 21:13
You'll see that I used \thispagestyle{empty} \pagestyle{empty} just so that I could remove the page number until I found a way to move it... –  Halime Jan 12 '11 at 21:18
@Harald Hanche-Olsen -- I want to move the page number to the bottom right or left hand corner of the page. –  Halime Jan 12 '11 at 21:20

As a beginner you should be using packages, and as much as possible. Generally speaking, packages don't mess up things that they are not designed to change, so you shouldn't be worrying much about using them, especially if they are the kinds of packages that are recommended often by users here. Unless you are using a special documentclass such as memoir or one of the KOMA classes, you should be using fancyhdr, because it provides a very simple interface to do exactly what you want.

\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum} % only for showing some sample text
\fancyhf{} % clear all header and footers
\rfoot{\thepage}
%
%lfoot{\thepage} % puts it on the left side instead
%
% or if your document is 2 sided, and you want even and odd placement of the number
%\fancyfoot[LE,RO]{\thepage} % Left side on Even pages; Right side on Odd pages
%
\pagestyle{fancy}
\begin{document}
\lipsum
\end{document}


The best reason to use a package is that package writers are generally much more experienced in doing things than the average end user, and so a package will deal with problems that might not even occur to you (even when you become more experienced with LaTeX); also, there's really no sense in re-inventing the wheel, when good tools with long track records of use are available.

See also this page on the Wiki for some recommendations of useful packages. Since you also mentioned changing margins, you should also probably be using the geometry package instead of doing that by hand, too.

-
Thanks for the explanation! I guess I was under the impression that if there were conflicting environments (namely if the package had different arguments than the ones I had), then my document would look messed up. I will try using fancyhdr and what you recommended above to resolve my issue. Also, if you saw the my earlier comments to Herbert and Harald, I am using a geometry package for margins. Actually, I posted my code in one of the above comments. –  Halime Jan 12 '11 at 22:11
@Halime However, you should look at the console output if you use fancyhdr to set headers because it will tell you if the headers take more space than is available, and will specify the minimum height required if they do. You then feed that information to geometry to avoid unexpected changes to your page layout. But this is a good thing because it is a change you need to make if you are using headers which are too big for the available space! –  cfr Dec 19 '14 at 23:07
\documentclass[twoside]{article}

\makeatletter
\def\ps@myPS{%
\def\@oddfoot{\null\hfill\thepage}
\def\@evenfoot{\thepage}%
\makeatother

\pagestyle{myPS}

\begin{document}

foo
\clearpage
blah
\end{document}

-
Thank you! I will try that (as well as Alan Munn's response) to see if that will work for me. –  Halime Jan 12 '11 at 22:13