# How to center a \chapter

I'm new in writing documents using LaTeX.

Can someone help me to center this chapter section? They are all right aligned. Here is a image of .cls which I believe is the command that creates the section header.

Many thanks!

• Welcome to TeX.SE! I wonder if you are looking for the titlesec package. – marmot Dec 31 '18 at 22:29
• Could you post a compilable code, not an image. Which document class do use anyway? – Bernard Dec 31 '18 at 22:32
• The template you are using does set the chapter headers right aligned for a reason. If you want it different, you might be lucky with a different template. – Johannes_B Dec 31 '18 at 22:42

## 2 Answers

If you are using one of the built-in document classes (book, report) then use the sectsty package which lets you change the style and font of headings, eg

\usepackage{sectsty}
\chapterfont{\centering}


If you are using a third-party (eg publisher's) document class (and it looks like you are), then you shouldn't be changing anything because it's set up the way they require you to use it (that is, it's their format. not yours).

I'm not clear what the image of an Abstract has to do with centering the chapter title. Or did you mean you want the Abstract title centered?

• Yes,that's what I meant Peter. I want the abstract and other titles centered. \usepackage{sectsty} \chapterfont{\centering} Worked fine! Thank you very much. – Tiago Jan 1 at 14:26
\usepackage{titlesec}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{40pt}


Also works