# Centering chapter titles

In the MWE below. What is the most convenient way to center the titles Preface and Abstract, rather than setting them flush left?

\documentclass{book}
\begin{document}

\chapter*{Preface}
\chapter*{Abstract}

\chapter{Introduction}
\chapter{Body}
\chapter{Conclusion}

\end{document}

• Have a look to the titlesec package. – GuM May 25 '15 at 8:20
• You are talking of centering the titles horizontally, not both horizontally and vertically? – user31729 May 25 '15 at 8:41
• Should centering be applied only to unnumbered chapter headings, or to all chapter headings? – Mico May 25 '15 at 8:44

Since this about the \chapter* command for two titles (Abstract and Preface) only, it's sufficient to say \chapter*{\centering Abstract} etc. as command. This is grouped inside the internal command \@makeschapterhead -- it does not have a side effect on other implicitly used \chapter* commands, such as in \tableofcontents.

(The \blindtext as well as Some text aren't centered, so the \centering inside the \chapter* argument is safe, as long as no entry to the ToC is necessary (which is not the case, as we are talking about \chapter*)

If all \chapter* or \chapter titles should be centered horizontally, an \xpatchcmd approach is more useful. (See the edit at the bottom of this answer)

\documentclass{book}

\usepackage{blindtext}

\begin{document}

\chapter*{\centering Preface}
\blindtext

Some text
\chapter*{\centering Abstract}

\chapter{Introduction}
\chapter{Body}
\chapter{Conclusion}

\end{document}


Edit

This code centers all chapter titles (regardless whether \chapter* or \chapter) horizontally

\documentclass{book}

\usepackage{xpatch}
\usepackage{blindtext}

\makeatletter

\Huge \bfseries  #1\par\nobreak%
}{%
\Huge \bfseries\centering #1\par\nobreak%

\huge\bfseries \@chapapp\space \thechapter
}{%
\huge\bfseries\centering \@chapapp\space \thechapter

\makeatother

\begin{document}
\tableofcontents

\chapter*{Preface}
\blindtext

Some text
\chapter*{Abstract}
\blindtext

\chapter{Introduction}
\blindtext

Another text

\chapter{Body}
\blindtext

\chapter{Conclusion}
\blindtext

\end{document}