I want to have a first level ToC in the beginning of the document, and full ToC at the end. I'm using titletoc.
There's a similar question but it is actually about printing ToC by parts.
I expected to be able just to call \tableofcontents twice in a document:
\documentclass{article}
\usepackage{titletoc}
\begin{document}
{
\setcounter{tocdepth}{1}
\tableofcontents
}
\section{H1}
\subsection{H2}
\section{H1}
\subsection{H2}
\section{H1}
\subsection{H2}
{
\setcounter{tocdepth}{2}
\tableofcontents
}
\end{document}
but it doesn't work.