Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have several sections in a Beamer document, starting the section number 1 on the second section. For that I use

\tableofcontents[firstsection=2]

but the first section has the number zero. So, I would like the first section without number. Soomething like the option \frontmatter for the book class. Any idea?

This is the MWE:

\documentclass{beamer}

\usetheme{CambridgeUS}

\begin{document}

\begin{frame}{Contents}
\tableofcontents[firstsection=2]
\end{frame}

\section{no-numerated section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\section{First Section}

\subsection{First sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\subsection{Second sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\section{Second Section}

\subsection{First sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\subsection{Second sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\section{Third section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\end{document}
share|improve this question
1  
Please add a minimal working example (MWE). –  Jubobs May 22 '13 at 19:43
add comment

1 Answer

up vote 1 down vote accepted

Here's a solution, using a redefinition of the internal command \beamer@sectionintoc implemented in the beamerbasetoc.sty file; with the redefinition, no number is typeset in the ToC if it's less than 1:

\documentclass{beamer}

\usetheme{CambridgeUS}

\makeatletter
\def\beamer@sectionintoc#1#2#3#4#5{%
  \ifnum\c@tocdepth>0%
  \ifnum#4=\beamer@showpartnumber%
  {
  \beamer@saveanother%
  \gdef\beamer@todo{}%
  \beamer@slideinframe=#1\relax%
  \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
      \beamer@tempcount=#5\relax%
      \advance\beamer@tempcount by\beamer@sectionadjust%
      \ifnum\beamer@tempcount>0
      \edef\inserttocsectionnumber{\the\beamer@tempcount}\else
      \edef\inserttocsectionnumber{}\fi%
      \def\inserttocsection{\hyperlink{Navigation#3}{#2}}%
      \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}%
      {
        \ifbeamer@pausesections\pause\fi%
        \ifx\beamer@toc@ooss\beamer@hidetext
          \vskip1.5em
        \else
          \vfill
        \fi
        {%
          \hbox{\vbox{%
              \def\beamer@breakhere{\\}%
              \beamer@tocact{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}{section in toc}}}%
         \par%
        }%
      }%
    }
  }%
  \beamer@restoreanother%
  }
  \beamer@todo%
  \fi\fi%
}
\makeatother
\begin{document}

\begin{frame}{Contents}
\tableofcontents[firstsection=2]
\end{frame}

\section{no-numerated section}
\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\section{First Section}

\subsection{First sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\subsection{Second sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\section{Second Section}

\subsection{First sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\subsection{Second sub-section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\section{Third section}

\begin{frame}
\begin{itemize}
\item

\end{itemize}
\end{frame}

\end{document}

enter image description here

share|improve this answer
    
I've added this code to beamer: it will be in the next release, probably once TeX Live starts updating again. –  Joseph Wright May 23 '13 at 7:20
    
Thanks! It works perfectly. –  Gitano May 23 '13 at 19:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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