I want page numbers to be centered at the head of page. How can I do this? Thanks for your helps...
-
There is already an answer to this question, but please give a MWE in order that supporters know which documentclass etc. you prefer.– user31729Mar 10, 2014 at 15:17
-
It is a class for thesis writing of another university and I Struggle for transporting it for my university. my university has no class for thesis writing. It uses "report" document class and ıt contains "fancyhdr" package. In generally the \pagestyle{fancy} occurs in the class and it set pagenumbers flushed right. But my university want page numbers centered at the head of page.– guestMar 10, 2014 at 15:26
Add a comment
|
1 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
-
I tried it but there occured two page numbers such that one of them is at top centered (which I desired) and one of them is at top flushed right (which caused by "fancyplain" pagestyle ). I want only at top and centered.– guestMar 10, 2014 at 15:36
-
\pagestyle{fancy} sets the page numbers at top and flushed right. \pagestyle{plain} sets the page numbers at bottom and centered. Isn't there a pagestyle (in report document class)that sets the page numbers at top and centered.– guestMar 10, 2014 at 15:46
-
I used what you said with the command \fancyhf{} and it worked. right flushed page numbers all diseppeared and only top-centered numbers occured. Thanks for your helps. If you can add \fancyhf{} command to your answer then it will also be helpful for other users.– guestMar 10, 2014 at 16:15