# Center All Chapter Titles in Dissertation

I can't seem to find a way to center all of my chapters (both Chapter X, and the title of the chapter) without altering table of contents or causing errors rending the code unable to run

\documentclass[12pt,oneside]{book}

% packages
\usepackage{amssymb, amsmath, amsthm}
\usepackage{graphicx}
\usepackage{apacite}
\usepackage[round]{natbib}
\usepackage{sectsty}
\usepackage{graphicx,pstricks}
\usepackage{graphics}
\usepackage{moreverb}
\usepackage{subfigure}
\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{txfonts}
\usepackage{palatino}
\usepackage{blindtext}
\usepackage{xpatch}

% these make top, right, bottom margins about 1"
% and the left margin about 1.5"
\setlength{\textwidth}{5.75in}
\setlength{\oddsidemargin}{0.5in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{9.0in}
\setlength{\topmargin}{0.0in}

\makeatletter
\vspace*{0.75in}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@

}}
\vspace*{0.75in}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries  #1\par\nobreak
\vskip 40\p@

}}
\makeatother

% makes page numbers appear
\pagestyle{plain}

\begin{document}

• s/raggedright/centering/ in your redefinitions of your chapterhead. And welcome, by the way. – Johannes_B Sep 17 '17 at 14:49
• If you copied the code from somewhere without knowing what it does, you will get into more trouble. LaTeX for complete novices (<- Link to free ebook) is a good read to start with. – Johannes_B Sep 17 '17 at 14:50
• You could have a look at the following answers: tex.stackexchange.com/a/23859/134144 tex.stackexchange.com/a/107282/134144 – leandriis Sep 17 '17 at 14:53
• @Johannes_B: Not everyone is aware about the /s/foo/bar syntax... – user31729 Sep 17 '17 at 15:52

An easy way is use the memoir class and one already made chapter style:

\documentclass{memoir}
\chapterstyle{bianchi}
% try also "chappell", "dash", "demo2", "dowding" and "thatcher"
\begin{document}
\chapter{My chapter}
\end{document}


You can also \makechapterstyle if none of these is good for you. Run texdoc memoir for more information.

There also a centered "Rejne" style in fncychap package. There are some commands for some customization. Run texdoc fncychap for more information.

\documentclass{book}
\usepackage[Rejne]{fncychap}
\ChTitleAsIs
\ChNameAsIs
\ChRuleWidth{0pt}
\begin{document}
\chapter{My chapter}
\end{document}


Or you can use the sectsty package:

\documentclass{book}
\usepackage{sectsty}\chapterfont{\centering}
\begin{document}
\chapter{My chapter}
\end{document}


Or the anonchap package;

\documentclass{book}
\usepackage{anonchap}
\simplechapter[\centering Chapter]
\renewcommand{\simplechapterdelim}{\par}
\begin{document}
\chapter{My chapter}
\end{document}


Or the titlesec package as explained in Center aligning chapters.