You get three times a page 1 in the front matter: in the report
class the titlepage
environment which is used also by abstract
resets the page number to 1.
I suggest you to use the book
class with its \frontmatter
and \mainmatter
commands, with \chapter{\abstractname}
for the abstract in the front matter.
However also the report
class can be used, after patching the relevant commands; I show only the important parts, add the rest to suit. It's probably better to \usepackage[<options>]{geometry}
for setting the page parameters and \usepackage{setspace}
for the interline spacing.
Remember the \clearpage
command before \pagenumbering{arabic}
.
\documentclass[12pt]{report}
%%% PATCHES %%%
\usepackage{etoolbox}
\makeatletter
% Patch `titlepage` not to reset the page number
\patchcmd{\titlepage}{\setcounter{page}\@ne}{}{}{}
\patchcmd{\endtitlepage}{\setcounter{page}\@ne}{}{}{}
% Patch `abstract` so that it shows the page number
\patchcmd{\abstract}{\titlepage}{\titlepage\thispagestyle{plain}}{}{}
\makeatother
%%% END PATCHES %%%
\begin{document}
\pagenumbering{roman}
\begin{titlepage}
abc
\end{titlepage}
\begin{abstract}
dddd
\end{abstract}
\tableofcontents
\clearpage %%%%% <---- IMPORTANT
\pagenumbering{arabic}
\pagestyle{myheadings} \markright{}
\chapter{A}
\end{document}
Simply add
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
to your current settings. Since, for consistency's sake this should also apply to the first page of each chapter (in ehich the plain
style is used), a redefinition of plain
will also be needed:
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\renewcommand{\headrulewidth}{0pt}
}
A complete example:
\documentclass[a4paper]{book}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{}
\fancyhead[LO,RE]{\slshape \leftmark}
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\renewcommand{\headrulewidth}{0pt}
}
\begin{document}
\chapter{Test chapter one}
\lipsum[1-40]
\chapter{Test chapter two}
\lipsum[1-40]
\chapter{Test chapter three}
\lipsum[1-40]
\end{document}
Some images of some of the footers in different chapters:
Of course, activate these settings from the point in which chaters will be numbered on. Since this applies particularly for the redefinition of plain, you could conditionally make the redefinition of the footer depending on wheter you are on the \mainmatter
or not:
\makeatletter
\fancypagestyle{plain}{%
\fancyhf{}
\if@mainmatter
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\else
\fancyfoot[C]{\thepage}
\fi
\renewcommand{\headrulewidth}{0pt}
}
\makeatother
The code:
\documentclass[a4paper]{book}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{}
\fancyhead[LO,RE]{\slshape \leftmark}
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\renewcommand{\headrulewidth}{0pt}
\makeatletter
\fancypagestyle{plain}{%
\fancyhf{}
\if@mainmatter
\fancyfoot[C]{\Roman{chapter}\,--\,\thepage}
\else
\fancyfoot[C]{\thepage}
\fi
\renewcommand{\headrulewidth}{0pt}
}
\makeatother
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Test chapter one}
\lipsum[1-40]
\chapter{Test chapter two}
\lipsum[1-40]
\chapter{Test chapter three}
\lipsum[1-40]
\end{document}
Best Answer
\frontmatter
switches toroman
(lower case) numbers, and\mainmatters
switches back to arabic numbers, so if this should be prevented, it means either dropping\frontmatter
and\mainmatter
or patch this behaviour out of those macros usingxpatchcmd
from egreg'sxpatch
package.I was a little bit lazy about the success/failure test of the command
\xpatchcmd
;-)