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 am creating a presentation using the beamer class and the Singapore theme, however I have so many sections that the slide ticker bar at the top runs off the edge of the page.

Is there a way to make a second row of section names in the header, or alternatively insert a line break into the section names? I have tried following the advice here: using \textit in \section{} with beamer class to try and get formatting in the section to no avail, and here How to put a line-break in section heading? but it doesn't seem to work with beamer.

Minimum working example:

\documentclass[compres]{beamer}
\documentclass[compres]{beamer}
\usetheme{Singapore}

\begin{document}

\section{Bijection to nondeterministic metric space}
\subsection{}
\begin{frame}{}
\end{frame}

\section{Introduction to Langevin diffusion}
\subsection{}
\begin{frame}{}
\end{frame}

\section{Twice differentiable complexity classes}
\subsection{}
\begin{frame}{}
\end{frame}

\section{Applications in 4D}
\subsection{}
\begin{frame}{}
\end{frame}

\section{Conclusions}
\subsection{}
\begin{frame}{}
\end{frame}

\end{document}

In this example, line breaking the section headings would allow the problem to be fixed.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Here's one possible solution: now each title is typeset inside a \parbox; the width of the \parboxes is internally calculated as the available width divided by the total number os sections.

\documentclass[compress]{beamer}
\usetheme{Singapore}
\usepackage{ragged2e}

\makeatletter
\setbeamertemplate{section in head/foot}{%
  \parbox[c][0.33cm][t]{\dimexpr(\textwidth-1.3cm)/\beamer@sectionmax\relax}{%
    \RaggedRight\fontsize{4}{4}\selectfont\insertsectionhead}}
\makeatother

\begin{document}

\section{Bijection to nondeterministic metric space}
\subsection{}
\begin{frame}{Test Frame One}
test
\end{frame}
\begin{frame}{}
\end{frame}
\begin{frame}{}
\end{frame}

\section{Introduction to Langevin diffusion}
\subsection{}
\begin{frame}{}
\end{frame}

\section{Twice differentiable complexity classes}
\subsection{}
\begin{frame}{}
\end{frame}

\section{Applications in 4D}
\subsection{}
\begin{frame}{}
\end{frame}

\section{Conclusions}
\subsection{}
\begin{frame}{}
\end{frame}

\end{document}

An image of the new headline:

enter image description here

If your titles are too long, you could consider using the optional argument of \section instead:

\section[Title in Nav and Toc]{Title in Document}
share|improve this answer
    
That worked great, thank you so much –  John Lees Aug 15 '12 at 8:44
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.