5

I am finishing my master thesis and I need to remove the "Chapter" name from my chapter without removing the relative number of the chapter. (I am using the book class)

What I have now is:

Chapter 1.
Name of the chapter.

What I need is:

  1. Name of the chapter.

I tried with titlesec, but the code I had changed the font as well.

marli
  • 165
Matteo
  • 53
  • Welcome to TeX.SX! We prefer a starting document, not just some feature request. Do you really have Chapter 1. Name of the Chapter in one line? –  Dec 27 '15 at 23:08
  • 1
    could you possible produce an MWE for this? It is difficult to know exactly why your code changes your font as well. – Runar Dec 27 '15 at 23:10

2 Answers2

10

Here's how you can do with titlesec (you may be wanting to add some \titlespacing instructions).

\documentclass{book}
\usepackage{titlesec}

\titleformat{\chapter}[display]
  {\Huge\bfseries}
  {}
  {0pt}
  {\thechapter.\ }

\titleformat{name=\chapter,numberless}[display]
  {\Huge\bfseries}
  {}
  {0pt}
  {}

\begin{document}

\frontmatter

\tableofcontents

\chapter{Abstract}

abc

\mainmatter

\chapter{Title}

abc

\end{document}

Technical note: the image has been produced with the oneside option in order to limit the number of pages

enter image description here

egreg
  • 1,121,712
3

This is a small sample code for the \chapter header (not \chapter*, however.). The relevant portion is hidden in \@makechapterhead.

It's valid only for Number. Name without line breaking in between.

\documentclass{book}



\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \Huge\bfseries\space\thechapter.\space
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\makeatother


\begin{document}
\chapter{A chapter}
\end{document}

enter image description here