Chapter name in the header with \chapter*
Try
\chapter*{chapter name}
\markboth{chapter name}{}
And consider using titlesec
package rather using \centerline
as a visual formatting approach.
Setting the headers with fancyhdr
usually requires changing the \chaptermark
and \sectionmark
commands; you don't need the latter, as you want only the chapter title in the header.
Here's an example in which I show two methods. A simple \chapter
command in the \frontmatter
will not give a numbering and correctly set the header. If you want the unnumbered chapter in the \mainmatter
, then you can use an explicit \chaptermark
command.
\documentclass[12pt,a4paper,oneside]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\fancyhf{} % clear the headers
\fancyhead[R]{%
% We want italics
\itshape
% The chapter number only if it's greater than 0
\ifnum\value{chapter}>0 \chaptername\ \thechapter. \fi
% The chapter title
\leftmark}
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyfoot[C]{\thepage}
}
\setlength{\headheight}{14.5pt}
\usepackage{kantlipsum} % for the mock text
\begin{document}
\frontmatter
\chapter{Introduction}
\kant
\mainmatter
\chapter*{Another introduction}
\chaptermark{Another introduction}
\kant
\chapter{Title}
\kant
\end{document}
Note that if you plan to use appendices, one of the commands should be modified:
\makeatletter
\fancyhead[R]{%
% We want italics
\itshape
% The chapter number only if it's greater than 0
\ifnum\value{chapter}>0 \@chapapp\ \thechapter. \fi
% The chapter title
\leftmark}
\makeatother
(Unfortunately, the command that holds either \chaptername
or \appendixname
is an internal one, so one has to do some tricks to access it.)
Note also the \setlength{\headheight}{14.5pt}
to give the header the room it needs.
For centering the chapter title it's better to use the methods of the titlesec
or sectsty
packages than doing explicit formatting.
Note This assumes that the unnumbered chapter is in the \frontmatter
(any number of them, actually) or there is only one at the beginning of the \mainmatter
. For other cases a more complex approach should be taken.