# Remove chapter from ToC

\documentclass{mwrep}
\begin{document}
\tableofcontents
\chapter{c1}
\chapter{c2}
\chapter*{c3}
\chapter*{c4}
\section*{s}
\chapter{c5}
\end{document}


I know chapter* removes a chapter from numbering. How can I remove it also from ToC? I want to remove c4 but not c3.

-

To remove from the ToC all the entries associated with \chapter* you need to redefine the \chapter@toc command implemented in mwrep.cls; the following example code includes the necessary redefinition:

\documentclass{mwrep}

\makeatletter
\renewcommand*\chapter@toc{%
\fi
}
\makeatother

\begin{document}
\tableofcontents
\chapter{c1}
\chapter{c2}
\chapter*{c3}
\end{document}


To remove from the ToC only a particular entry associated with \chapter* you could 1) use the tocvsec2 package:

\documentclass{mwrep}
\usepackage{tocvsec2}

\begin{document}
\tableofcontents
\chapter{c1}
\chapter{c2}
\chapter*{c3}
\settocdepth{part}
\chapter*{c4}
\settocdepth{section}
\end{document}


or 2) Use \addtocontents to appropriately change the value of the tocdepth counter:

\documentclass{mwrep}

\begin{document}
\tableofcontents
\chapter{c1}
\chapter{c2}
\chapter*{c3}

And this makes every chapter* excluded? This is not what I want. I corrected my question because it was misleading. –  Ichibann Jul 27 '11 at 22:49