1

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} 
Johannes_B
  • 24,235
  • 10
  • 93
  • 248

1 Answers1

1

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.

Fran
  • 80,769