[Tex/LaTex] Remove “chapter #” from the chapter title but keep chapter number in the table of contents

chapterssectioningtable of contents

I am using report document class.
I want to remove word "Chapter" and "chapter number" from chapter title, so when new chapter starts I will get only chapter title. I can do it using:

\renewcommand{\chaptername}{}
\renewcommand{\thechapter}{}

It looks ok, but it breaks the table of contents. I want numbered chapters on table of contents, e.g.

  1. Function name one

1.1 Parameters

1.2 Returned value

but the table of contents looks like this:

Function name one

.1 Parameters

.2 Returned value

I know I can do it using the package titlesec, but is there a way to do it without it?

Best Answer

You can redefine the internal way of the chapter output:

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\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@
  }}
  \makeatother