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 get a little confused about the difference between \section{} and \section*{} in Beamer. Could you please explain in detail with examples.

share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

Brief Answer

The brief answer is, \section inserts a new entry into the table of contents at the appropriate tree-level and also inserts a new entry into the navigation bars. But \section* only adds an entry in the navigation bars, not in the table of contents.

Detailed Answer

Now, let us go to the detailed answer, as you asked for. For this we consider this short file.

\documentclass{beamer}

\usetheme{Berkeley}

\usepackage{times}

\begin{document}
\begin{frame}
  \tableofcontents
\end{frame}


\begin{frame}
\section{Section without Star}

\begin{itemize}
\item This will 
  \begin{itemize}
  \item insert a new entry into the table of contents,
  \item and will insert a new entry into the navigation bars.
  \end{itemize}
\end{itemize}

\end{frame}

\begin{frame}
\section*{Section with Star}

\begin{itemize}
\item This will 
  \begin{itemize}
  \item {\itshape not} insert a new entry into the table of contents,
  \item but will insert a new entry into the navigation bars.
  \end{itemize}
\end{itemize}


\end{frame}


\end{document}

We are creating three slides (frames) here. The first one being the table of contents, the second with one normal section (not starred), the third one with a starred section.

Output

Now as you can see, in the following table of contents slide, name of the the normal section without a star, appears both at the navigation bar at left as well as in the table of contents. The section, created with a starred command, though appears fine in the navigation bar, it does not appear in the table of contents.

enter image description here

You can compile the complete file using pdflatex and observe the effects. Please remember to compile at least three times.

Additional Points

Please remember that the difference between \section and \section* is only important if you create a table of contents and use a theme with navigation bar. Otherwise, you do not notice any difference. Perhaps that was the source of confusion in your case.

Also, please be advised that the case of \section and \section* in beamer is different from that in documents (article or book class).

share|improve this answer
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.