-1

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.

enter image description here

enter image description here

Many thanks!

  • 2
    Welcome to TeX.SE! I wonder if you are looking for the titlesec package. – marmot Dec 31 '18 at 22:29
  • 1
    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
3

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
0
\usepackage{titlesec}

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

Also works

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.