[Tex/LaTex] How to make page numbers centered at the head of page

header-footer

I want page numbers to be centered at the head of page. How can I do this?
Thanks for your helps…

Best Answer

You should be able to do that with fancy package

\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead[L]{}% Empty left header
\fancyhead[C]{\thepage} % Page numbering for center header  
\fancyhead[R]{}% Empty right header
\fancyfoot[L]{}% Empty left footer
\fancyfoot[C]{}% Empty center footer
\fancyfoot[R]{}% Empty left footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\section{A dummy section}
\end{document} 

Regards