Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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
1  
@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

2 Answers 2

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
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\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
%facncyfoot[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.

share|improve this answer
2  
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
\documentclass[twoside]{article}

\makeatletter
\def\ps@myPS{%
    \def\@oddfoot{\null\hfill\thepage}
    \def\@evenfoot{\thepage}%
    \def\@evenhead{\null\hfil\slshape\leftmark}%
    \def\@oddhead{{\slshape\rightmark}}}%
\makeatother

\pagestyle{myPS}

\begin{document}

foo
\clearpage
blah
\end{document}
share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.