How to hide the table of content's heading?
If you are using the article
class you can find the definition of \tableofcontents
in the article.cls
file:
\newcommand\tableofcontents{%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}%
}
Now you can just remove the part where \section*
is defined:
\documentclass{article}
\makeatletter
\renewcommand\tableofcontents{%
\@starttoc{toc}%
}
\makeatother
\begin{document}
\tableofcontents
\section{test}
\section{test2}
\end{document}
If you want no TOC, but still want the "sidebar" created by hyperref you may do this:
\documentclass{...}
...
\usepackage{hyperref}
\begin{document}
\newsavebox{\hidden}\sbox{\hidden}{\vbox{\tablefocontents}}
<code>
\end{document}
You say that using an empty name does not remove the space before the TOC. You can change that using the extra code below:
\renewcommand\contentsname{} % the empty name
\begingroup
\let\clearpage\relax
\vspace{-5cm} % the removed space. Set as appropriate
\tableofcontents
\endgroup