Skip to content

Instantly share code, notes, and snippets.

Created January 31, 2009 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/55492 to your computer and use it in GitHub Desktop.
Save anonymous/55492 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{lipsum}
\makeatletter
\let\old@addcontentsline\addcontentsline
\def\trivial@addcontentsline#1#2#3{}
\def\hiddensection#1{%
\let\addcontentsline\trivial@addcontentsline
\section{#1}
\let\addcontentsline\old@addcontentsline
}
\makeatother
\begin{document}
\tableofcontents
\section{A}
\lipsum[1]
\hiddensection{B}
\lipsum[2]
\section{C}
\lipsum[3]
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment