Problem with headings and book class

I have a the following document which uses the book class. For some reason, the page number is, on the first page, at the bottom of the page and centered (article like footer). The next page has the number up and on the left (with the chapter title on the right): book like heading.

Why do I have two different ways to show the page number? I would like to have the normal book class heading (i.e. the page 2 heading) for the whole document.

MWE:

\documentclass[12pt,twoside,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{xspace}
\title{}
\author{}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{lipsum}
\begin{document}
%\maketitle
\tableofcontents
\onehalfspacing

\frontmatter

%\include{fichiers/intro}

\mainmatter

%\include{fichiers/chap1}
%\include{fichiers/chap2}
%\include{fichiers/chap3}
%include{fichiers/chap4}
%include{fichiers/ccl}

\appendix
\backmatter

\end{document}

-

This is the default behavior for first pages of chapters.

If you want to change this, simply add the following lines in your preamble (package etoolbox is required):

\patchcmd{\chapter}
{\thispagestyle{plain}}
{}
{}
{}


MWE:

\documentclass[12pt,twoside,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{xspace}
\title{}
\author{}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{lipsum}
\usepackage{etoolbox}
\patchcmd{\chapter}
{\thispagestyle{plain}}
{}
{}
{}

\begin{document}
%\maketitle
\tableofcontents
\onehalfspacing

\frontmatter

%\include{fichiers/intro}

\mainmatter

%\include{fichiers/chap1}
%\include{fichiers/chap2}
%\include{fichiers/chap3}
%include{fichiers/chap4}
%include{fichiers/ccl}

\appendix
\backmatter

\end{document}


Output:

-

Here is another way, noting that the page style headings is used by the book document class. Add these lines to your preamble:

\makeatletter
\makeatother


Full code:

\documentclass[12pt,twoside,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{xspace}
\title{}
\author{}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{lipsum}

\makeatletter
\makeatother
\begin{document}
%\maketitle
\tableofcontents
\onehalfspacing

\frontmatter

%\include{fichiers/intro}

\mainmatter

%\include{fichiers/chap1}
%\include{fichiers/chap2}
%\include{fichiers/chap3}
%include{fichiers/chap4}
%include{fichiers/ccl}

\appendix
\backmatter

\end{document}

-
I would have bet that if I hadn't added this possibility in my answer, you would have done it. :-) –  karlkoeller Feb 18 at 12:20
@karlkoeller It seemed to me that you left it for me intentionally ;) –  Harish Kumar Feb 18 at 13:00