I would like to know how I can hide a section from the table of contents but without loosing the section number in the body of the document. For example, in this tex file I loose the number for hide
, and all the sequences are damaged:
\documentclass{article}
\begin{document}
\tableofcontents
\section{uno}
\section{dos}
\section*{hide}
\section{tres}
\end{document}
I think you are looking for
or make it into a command:
EDIT:
Okay, I think I understand what is wanted now (and it makes more sense then the answer I gave). Here is a command that you can use to suppress adding a section, subsection, etc. to the TOC. The idea is to temporarily disable
\addcontentsline
.Just wanted to say thanks for Ivans great hint! (I was just googling for something similar for my customized (Sub)Appendix{} commands:
Maybe this is useful for someone else, too...)
have just come here from a similar question. The answer above didn't quite work as it gave some formatting issues, but a similar solution seemed to do the trick