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}
% this makes the chapters start with a 2" margin
\makeatletter
\renewcommand*\@makechapterhead[1]{%
\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@
}}
\renewcommand*\@makeschapterhead[1]{%
\vspace*{0.75in}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
% makes page numbers appear
\pagestyle{plain}
\renewcommand*\contentsname{Table of Contents}
\begin{document}
s/raggedright/centering/in your redefinitions of your chapterhead. And welcome, by the way. – Johannes_B Sep 17 '17 at 14:49https://tex.stackexchange.com/a/107282/134144 – leandriis Sep 17 '17 at 14:53
/s/foo/barsyntax... – Sep 17 '17 at 15:52