I am trying to create a sidebar like the one present in beamer documents, which lists the Table of Contents information for easy document navigation. Even better if it can automatically show only the subsections for the current section. How can this be implemented in other LaTeX classes, such as the article class, for use with pdflatex? This page has a suggestion but it does not work in pdflatex.

  • please help us by adding an example of your code. – touhami Mar 8 '16 at 19:35
  • There is no example because I do not know how to implement this. Thus, the question. – user5359531 Mar 8 '16 at 19:53
  • What I mean is that we need to know class, packages used. – touhami Mar 8 '16 at 20:24
  • article class would be most convenient but is not essential. I do not know which packages are best suited for this. I am interested in any examples or any suggestions anyone might have on implementing this. – user5359531 Mar 8 '16 at 20:39
  • well i will try to see. – touhami Mar 8 '16 at 21:34

Here is a solution using etoc package


\etocsettocdepth{2}% only subsection
\etocsettocstyle{}{}% no heading
\etocsetstyle {subsection}

% here with fancyhdr package
\fancyhead[C]{\tableofcontents \ref{\mt}} 

% or with background package
%\backgroundsetup{contents={\tableofcontents \ref{\mt}},color=blue}


\subsection{Foo bar}
\subsection{Foo baz}
\subsubsection{Foo baz}
\subsection{Foo Bye}
\subsection{Baz bar}
\subsection{Baz baz}
\subsection{Baz Bye}

with fancyhdr enter image description here

with background

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.