3

So I am trying to remove the words Chapter n, and replace it by the chapter title. BUT I want it to show up in the table of contents... (So I cannot use \chapter*{...}).

Is there a way to achieve that?

Thanks!

3

Use titlesec

\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{0pt}{\Huge}
\titlespacing*{\chapter} {0pt}{20pt}{40pt}
\begin{document}
  \tableofcontents
  \chapter{Some chapter}
\end{document}

enter image description here

enter image description here

1

If you use the book or report document class, and if you don't want to employ a LaTeX package such as titlesec, you could proceed by redefining (simplifying, really) the low-level macro \@makechapterhead. Here's a working example that uses the book document class; tthe lines starting with %% are commented out from the original code of \@makechapterhead.

\documentclass{book}
\makeatletter
\def\@makechapterhead#1{%
  %%\vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    %%\ifnum \c@secnumdepth >\m@ne
      %%\if@mainmatter
      %%  \huge\bfseries \@chapapp\space \thechapter
      %%  \par\nobreak
      %%  \vskip 20\p@
      %%\fi
    %%\fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\makeatother
\begin{document}
\tableofcontents
\mainmatter
\chapter{First}
\chapter{Second}
\end{document}
0

Maybe try:

\newcommand{\mychapter}{#1}{%
\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}

It looks like it works for me. I can't guarantee that it will for you though.

  • For this to work, don't you also need an instruction such as \refstepcounter{chapter}, to increment the chapter counter? – Mico May 2 '15 at 3:26
  • @Mico good point. Didn't think of that. – Samuel Flint May 2 '15 at 3:48
  • This looks like the simplest solution. Why no more up votes, at least? – KcFnMi Apr 27 at 16:29
0

This worked for me:

\chapter*{Introduction}\stepcounter{chapter}\addcontentsline{toc}{chapter}{Introduction}

Place that code at the beginning of your chapter.

  • In this case did you loose the previous definition of \chapter*? Which just do not enumerate it, if I'm not wrong. – KcFnMi Apr 27 at 16:24

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.