# position the page number of whole document to the bottom right

I am using Easy thesis template to write my thesis. In the Thesis.cls file it is written like \def\baseclass{book} which I guess it uses book class as the basic one.

I use single sided page.

I have \frontmatter, \mainmatter and \backmatter.

The \frontmatter handles those sections below in roman style and I indicated the positions of the pages numbers in current document:

TITLE page - no page number
DECLARATION - position top right
ABSTRACT (2 pages) - [1st page no page number, 2nd page top right]
ABSTRACT (In Malay language) (2 pages)  - [1st page no page number, 2nd page top right]
ACKNOWLEDGMENTS (2 pages)  -[1st-page bottom center, 2nd and following pages top right]
CONTENTS (4 pages) -[same as above]
LIST OF FIGURES (4 pages) -[same as above]
LIST OF TABLES (2 pages) -[same as above]
LIST OF ABBREVIATIONS (2 pages) -[same as above]
LIST OF SYMBOLS (3 pages) -[same as above]


and the \mainmatter handle

Chapter1  - [1st-page bottom center, 2nd and following pages top right]
Chapter2 -[same as above-]
Chapter3 -[same as above-]
Chapter4 -[same as above-]
Chapter5 -[same as above-]
Chapter6 -[same as above-]
Chapter7 -[same as above-]


finally the \backmatter handles

REFERENCES  - [1st-page bottom center, 2nd and following pages top right]
APENDIX  - [1st-page bottom center, 2nd and following pages top right]
List of Scientific Contributions (3 pages) -[all pages top right]


In the Thesis.cls file, I can see the code for the page setting as below:

\newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
\def\today{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space \number\year}
%\usepackage{setspace}
\RequirePackage{setspace}
\onehalfspacing
\setlength{\parindent}{15pt} % VJ-originally 0pt
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
\usepackage{vmargin}
\setmarginsrb           { 1.5in}  % left margin
{ 0.6in}  % top margin
{ 1.0in}  % right margin
{ 0.8in}  % bottom margin
{   9pt}  % foot height
{ 0.3in}  % foot sep
\raggedbottom
\setlength{\topskip}{1\topskip \@plus 5\p@}
\doublehyphendemerits=10000       % No consecutive line hyphens.
\brokenpenalty=10000              % No broken words across columns/pages.
\widowpenalty=9999                % Almost no widows at bottom of page.
\clubpenalty=9999                 % Almost no orphans at top of page.
\interfootnotelinepenalty=9999    % Almost never break footnotes.
\usepackage{fancyhdr}
\pagestyle{fancy}


By the way, what I want is as below (including the tile pages):

\fronmatter  - [roman style at bottom right]
\mainmatter - [arabic style at bottom right]
\backmatter - [arabic style at bottom right]


Is there any way to do that? I browsed around but none is helping me.

note: I am using fancyhdr package too.

This should work for you: Pages starting a chapter are using the pagestyle plain, at least in the book class, so you need to redefine this style in order to have it consistent. Also, as an aside, the O and E in \fancyfoot[RO,RE]{} are odd and even, respectively, and not needed as you are printing single sided.

\documentclass{book}

\usepackage{fancyhdr}

\fancypagestyle{mystyle}{
\fancyhf{}
\fancyfoot[R]{\thepage}
}

%Renew plain style for chapter pages
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[R]{\thepage}
}

\title{This is a Thesis}
\author{Me}

\begin{document}

\frontmatter
\pagestyle{empty}

\maketitle

\tableofcontents

\pagestyle{mystyle}
\chapter{Abstract}

\chapter{Bla}

\mainmatter
\chapter{C3}

\section{S1}
\section{S2}

\chapter{C4}

\section{S1}
\section{S2}

\end{document}


I suppose you have a two-sided document.This addition to your preamble should do what you want (total number of pages on the right on odd pages, on the left on even pages):

\usepackage{totpages}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyfoot[LE,RO]{\theTotPages}


If you want it on the right for all pages, replace the last line with:

\rfoot{\theTotPages}

• thanks for your reply. But I find this does not help much. When I use this code in the preamble I get extra numberings for the page Abstract, Acknowledgement, and Contents at the bottom. Which means I have ROMAN (at the top) AND ARABIC (at the bottom). In the title page the page number is at the bottom center, and in other pages it is at the top right especially in Chapter sections. – Vijay Sep 15 '15 at 23:56
• I didn't know how you formatted the page numbers, as you didn't give much details on your code, so I only could give a hint. I suppose at the top you get the current page number, either in roman style (front matter) or in arabic style (main matter). At the bottom right, do you have the total pages number? Or did I misunderstand what you want to obtain? The code I gave aimed at printing 150 at the bottom right if your thesis has 150 pages in all. – Bernard Sep 16 '15 at 0:08
• My original document has roman numberings in the \forntmatter. The \mainmatter and \backmatter have arabic style. In all sections, the page numbers are positioned at top right, except the title pages where it is printed at bottom center. Now I want the position of the all the page numbers to be at bottom right, including the title page. The code that you provide print page numbers in the \frontmatter section only. But the roman style (as in the original document) still remains. There is no change in the \mainmatter and \backmatter numbering style positions. – Vijay Sep 16 '15 at 1:27
• I think I misunderstood what you want. The answer from @cauchy42 should work fine for ordinary pages. Anyway, for the title page, we should see the code from Thesis.cls. – Bernard Sep 16 '15 at 2:26
• I reedited my post for clarity purpose. – Vijay Sep 16 '15 at 3:34