0

I want the chapter number and heading in one line without the word Chapter, like "1. Introduction", center aligned for a book class document. I have seen the solution here: Chapter number and chapter title in one line, that gives the title aligned left. I would like to know what I can add or change to align it to the center.

  • 1
    I am wondering how the title of your question relates to the actual question, and I'd like to encourage you to make a more appropriate choice in order to draw the attention of the relevant folks to it. – user121799 Jun 9 '18 at 4:14
2

Using Alan Munn's answer and texdoc titlesec suggests

\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[block] 
{\normalfont\huge\bfseries\filcenter}{\chaptertitlename\ \thechapter:}{1em}{} 

\begin{document}
\chapter{A chapter}
\section{A section}
\end{document}
| improve this answer | |
  • Just to fine-tune @marmot's answer to the requirements of @Sasi, [who probably wants "1. Introduction" instead of "Chapter 1: Introduction"] I think 1. either the \chaptername should be reset to a blank {} with \renewcommand{\chaptername}{{}} ...or 2. avoid it in the \titleformat definition as : \titleformat{\chapter}[block] {\normalfont\huge\bfseries\filcenter}{\thechapter.}{1ex}{} – Partha D. Jun 9 '18 at 5:28
  • @ParthaD. Thanks! (If you want, you could write your own answer, or do you want me to merge this into mine?) – user121799 Jun 9 '18 at 5:34
  • Thank you so much. marmot's code helped to get what I wanted as I had already reset chapter name to a blank. – Sasi Jun 10 '18 at 8:26
  • @marmot: Since you have solved essentially every aspect of the problem superbly [only possibly overlooked one minor requirement which I pointed out-- and Sasi could have solved by himself] I probably do not owe any original contribution to this post. So I think it's better if you can edit the MWE to that effect. – Partha D. Jun 11 '18 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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