Reputation: 25
I have a problem with latex. I want to create a heading with a special name and aumomatic numbering of the chapters.
I use the \chapter{Introduction} command to create the chapter named Introduction. In the Content it is listed as "1 Introduction" which is right. In the text I get two headings. The first is "Chapter 1" and under that I get "Introduction". So actually the \chapter generates two headings. What can I do?
Upvotes: 0
Views: 1594
Reputation: 291
You could also look at MemoirChapterStyles or fncychap for a whole bunch of different chapter heading styles that you could use without having to redefine \@makechapterhead
by hand.
Upvotes: 1
Reputation: 15065
This is the default layout when using a \chapter
in report
or book
. You need to update \@makechapterhead
in order to achieve the layout you're after:
\documentclass{report}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makechapterhead}% <cmd>
{\@chapapp\space\thechapter\par\nobreak\vskip 20\p@}% <search>
{\Huge\thechapter\space}% <replace>
{}{}% <success><failure>
\makeatother
\begin{document}
\tableofcontents
\chapter{ChapterName}
\end{document}
Upvotes: 1