My objective is to print a mini ToC under a section but this mini ToC should only print the subsection* automatically and not appear in the main ToC. As a reference, I am using the following: sample and another sample.
What I have gathered so far is that I can use, say:
\startcontents[sections]
\printcontents[sections]{}{3}{} % allows printing of subsection* only
and
\subsection*{Test subsection not in ToC}
\addcontentsline{ptc}{subsection}{Test subsection in ToC now} % must be added manually unless a command is created that takes as argument the subsection.
but all of this seems a bit cumbersome.
Can anyone suggest an automatic minitoc creation of subsection* level under a section?
For the sake of completion, here is mwe:
\documentclass{article}
\usepackage{titletoc}
\begin{document}
\section*{Contents}
\startcontents[mytoc]
\printcontents[mytoc]{}{1}{}
\section{Test section in ToC}
\subsection*{Test subsection not in ToC}
\subsection{Test subsection in ToC}
\end{document}

mytocshould only appear under the corresponding section and not under the main ToC. – azetina Jun 23 '16 at 19:25\tableofcontentsat the start of the document, I get the\subsection*only in the section ToC, not the\tableofcontents. That's because the\subsection*ToC-entry is written to.ptc, not.toc. – Werner Jun 23 '16 at 19:35