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 the numbers of pages to be placed at the top right side. I try to do it like this

\documentclass[12pt]{article}

\usepackage{fancyhdr}

\begin{document}
\lhead{}
\chead{}
\rhead{\thepage}
\lfoot{}
\cfoot{}
\rfoot{}

My text.

\end{document}

Numbers still remains like default - center of bottom. What do I wrong?

share|improve this question
5  
You didn't issue \pagestyle{fancy} –  egreg May 17 '12 at 21:26

2 Answers 2

up vote 16 down vote accepted

The "fancy" settings are enforced only when \pagestyle{fancy} is issued:

\documentclass[12pt]{article}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\thepage}

\begin{document}

My text.

\end{document}

I've used the "modern" commands provided by fancyhdr, which are more flexible; with \fancyhf{} you void all fields at once and then you can fill them again as you wish.

share|improve this answer
    
Your answers are always great. Thanks again. –  Pavasaris May 17 '12 at 22:08

Try with this:

\documentclass[12pt]{article}
\pagestyle{myheadings}
\begin{document}
 My text be here!!
\end{document}
share|improve this answer
    
Thanks @Marco for edit it. I was almost going crazy!! –  sgmart May 17 '12 at 21:59

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.