For specific subsections you may modify the behavior before they start: you could change \AtBeginSubsection
locally. This means you could change that, for a subsection, but keep this change local by enclosing it within a group. For example, disabling \AtBeginSubsection
and thus the subsection TOC:
\begingroup
\AtBeginSubsection{}
\subsection{No TOC}
\begin{frame}
...
\end{frame}
\endgroup
\subsection{Here's a TOC}
After the group ended, the globally by \AtBeginSubsection
defined macro returns being active. The following subsections will show the TOC - I tested it.
This works because \AtBeginSubsection
uses \def
to redefine internal macros, which works local, thus visible only inside a group, in contrary to \gdef
.
Your minimal example produces a ToC that looks like this (in code form):
\contentsline {section}{\numberline {1}\relax $\@@underline {\hbox {The Client}}\mathsurround \z@ $\relax }{2}{section.1}
\contentsline {subsection}{\numberline {1.1}Sub section 1}{2}{subsection.1.1}
\contentsline {section}{\numberline {2}\relax $\@@underline {\hbox {Scope}}\mathsurround \z@ $\relax }{2}{section.2}
\contentsline {subsection}{\numberline {2.1}Sub Section 2}{2}{subsection.2.1}
Note that each of the \contentsline
entries for a \section
contains \@@underline
. A crude solution would be to redefine \@@underline
to be a "no-op" (do nothing) when processing \tableofcontents
:
{\makeatletter
\def\@@underline#1{#1}
\tableofcontents
\makeatother}
If only some of your sections require this "special treatment", then manual underlining is most likely the way to go, together with the correction above, or by using the optional argument for sections:
\section[The Client]{\underline{The Client}}
However, for more far-reaching or consistent requirement across your entire document, consider using a package dedicated to sectional titles. For example, sectsty
provides an example in its documentation doing exactly this:
\documentclass{article}
\usepackage{sectsty}% http://ctan.org/pkg/secsty
\usepackage[normalem]{ulem}% http://ctan.org/pkg/ulem
\usepackage{xcolor,hyperref}% http://ctan.org/pkg/{xcolor,hyperref}
\hypersetup{
colorlinks=true, %set true if you want colored links
linktoc=all, %set to all if you want both sections and subsections linked
linkcolor=black, %color for links
}
\begin{document}
\tableofcontents
\newpage
\sectionfont{\underline}
\section{The Client}
\subsection{Sub section 1}
\section{Scope}
\subsection{Sub Section 2}
\end{document}
Note the difference in the underlining between the choice of sectsty
and that of a manual underline.
Best Answer
As the O.P. stated he uses
memoir
as document class, so this is a possible (and most likely the easiest) solution:Use the
\nobibintoc
command to prevent the inclusion of the bibliography in the ToC -- by default (see the relevant code at the end of this answer)\bibintoc
is effective and enables the inclusion.And here is the solution:
Only for interested readers
Here's the relevant portion of
memoir.cls
which shows that inclusion ofbibliography
in the ToC is the default.