How to put the page numbers in the center at top of each page in report class ?
Page Layout ⇒ Centering page number
-
QwareeqMathematics
- Posts: 68
- Joined: Mon Jul 06, 2009 7:44 pm
Centering page number
How to put the page numbers in the center at top of each page in report class ?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Centering page number
-
QwareeqMathematics
- Posts: 68
- Joined: Mon Jul 06, 2009 7:44 pm
Centering page number
Code: Select all
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}In some previous post I move the chapter for the top. So, the number wasn't at the top of page . I need it to be on the top for all document .
How to fix this problem please??
Centering page number
we need to see the modifications you made. Please post the preamble of your document with your particular settings (in the sense of a minimal working example).QwareeqMathematics wrote:...
But , It gives center for some pages only, and some numbers come over the words in the document.
In some previous post I move the chapter for the top. So, the number wasn't at the top of page . I need it to be on the top for all document...
-
QwareeqMathematics
- Posts: 68
- Joined: Mon Jul 06, 2009 7:44 pm
Centering page number
Code: Select all
\documentclass[11pt,a4paper]{report}
\usepackage[pdftex]{graphicx}
\usepackage{amssymb,latexsym,amsmath,mathrsfs,fullpage,array,ifsym,color}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\contentsname}{List of Contents}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\makeatletter
\def\@makechapterhead#1{%
\vspace*{-30\p@}% default: 50pt
{\parindent \z@ \centering \normalfont% default: \raggedright
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries\sc \@chapapp\space \thechapter
\par\nobreak
\vskip 0\p@% default: 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 20\p@
}}
\def\@makeschapterhead#1{%
\vspace*{-30\p@}% default: 50pt
{\parindent \z@ \centering% default: \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 20\p@
}}
\makeatother
\newtheorem{definition}{Def\mbox{}\mbox{}inition}[chapter]
\newtheorem{example}[definition]{Example}
\newtheorem{theorem}[definition]{Theorem}
\setlength{\parskip}{3ex}
\begin{document}
\pagenumbering{roman}
% FRONT Matter
\pagenumbering{arabic}
Body Text
\end{document}
Thank you
Centering page number
To prevent a warning, you will also have to addQwareeqMathematics wrote:I read the file and as I understand I should put this code :
Code: Select all
\usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \chead{\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}
EDIT: I made a correction here:
Code: Select all
\setlength{\headheight}{14pt}To solve this, add...
But , It gives center for some pages only...
Code: Select all
\let\ps@plain\ps@fancy
I did some tests but I wasn't able to reproduce this situation. Can you please provide some code that clearly shows the odd behaviour mentioned?...and some numbers come over the words in the document...
-
QwareeqMathematics
- Posts: 68
- Joined: Mon Jul 06, 2009 7:44 pm
Re: Centering page number
But , I need to put the number higher a little bit, Could I ?
Thx
Centering page number
Code: Select all
\usepackage{amssymb,latexsym,amsmath,mathrsfs,fullpage,array,ifsym,color}Code: Select all
\usepackage[margin=1in]{geometry}Code: Select all
\renewcommand{\headheight}{14pt}
Code: Select all
\setlength{\headheight}{14pt}-
QwareeqMathematics
- Posts: 68
- Joined: Mon Jul 06, 2009 7:44 pm
Re: Centering page number
Thank you