I'm looking for a command to remove at will the first or the last X items of the TOC displayed in the sidebar.
My problem appear when there is too many items in the sidebar. For example, the above picture shows a small sidebar.
But, later in my presentation (see above), I will display so many subsections that the last TOC item disappear (and TeX issues an overfull vbox…)
Ideally, I'm wanting some advice in order to write some macro that will remove the 1 or 2 first TOC items (here Sommaire and Objectifs pédagogiques) when I am in the problematic section (Méthode …).
I already check this question that is a little similar, but it does not solve my problem as there are always only 3 section displayed.
Best Answer
For information, here is what I have done to solve my problem
1/ I have defined a couple of counters
2/ Definition of the function to set the counters; they have to be called before the
\section
command3/ Installation of the hooks using
\AtBeginSection
command:4/ Redefinition of the relevant template: a) reset the counter for the section index
b) code for a normal section, essentially to count the index of the section
c) code for a shaded section