# Navigation bar is too long on progressbar theme, can it wrap?

My navigation bar at the top of each slide (that links to each section) has too many sections. I would like to keep the bar and keep each section but I would like to wrap it i.e. have it on two lines.

Is that possible?

I am using compress and I am using progressbar as a theme.

-
Please indicate which beamer theme you use at present. Also, have you tried using the class option compress, as in \documentclass[compress]{beamer}? With this option, beamer will try to make all navigation bars "as small as possible." –  Mico Feb 22 '12 at 2:45
Edited to add this information. –  iKs Feb 22 '12 at 4:26

You could redefine the \insertsectionnavigationhorizontal command and wrap the sections with a parbox.

Here is a quick & dirty example of it could be done in general:

\makeatletter
\hbox to #1{{%
\def\slideentry##1##2##3##4##5##6{}%
#2\hskip.3cm%
\newdimen\tmp@parbox%
\setlength\tmp@parbox{#1}%
\parbox{\tmp@parbox}{\raggedleft%
\setbox\beamer@sectionbox=\hbox{}%
\ht\beamer@sectionbox=1.875ex%
\dp\beamer@sectionbox=0.75ex%
\box\beamer@sectionbox}\hfil\hskip.3cm%
#3}}}
\makeatother


Here is a complete example for the progressbar theme, with increased headline height.

\documentclass[compress]{beamer}

\usetheme{progressbar}

\makeatletter
\hbox to #1{{%
\def\slideentry##1##2##3##4##5##6{}%
#2\hskip.3cm%
\newdimen\tmp@parbox%
\setlength\tmp@parbox{#1}%
\parbox{\tmp@parbox}{\raggedleft%
\setbox\beamer@sectionbox=\hbox{}%
\ht\beamer@sectionbox=1.875ex%
\dp\beamer@sectionbox=0.75ex%
\box\beamer@sectionbox}\hfil\hskip.3cm%
#3}}}

{%
\edef\tempa{sections}
\leavevmode%
\begin{beamercolorbox}[ignorestructure.bg=true,wd=\paperwidth,ht=8ex,dp=1.125ex]{structure.fg}%
\vspace*{0mm}
\end{beamercolorbox}%
\else
\leavevmode%
\begin{beamercolorbox}[wd=\paperwidth,ht=4ex,dp=1.125ex]{structure.fg}%
\end{beamercolorbox}%
\fi
}

\makeatother

\begin{document}

\section{First very long section name}
\section{Second very long section name}
\section{Third very long section name}
\section{Fourth very long section name}
\section{Fifth very long section name}

\begin{frame}{Title}
Content
\end{frame}

\end{document}

-
I'm not sure I understand what you wrote. I tried incorporating your example into my code and got a 'weird error'. Is there perhaps a simpler way to make the text on the sections wrap around? –  iKs Feb 22 '12 at 4:25
@iKs Try including the code in the preamble by putting the code between \makeatletter ..... \makeatother. –  percusse Feb 22 '12 at 9:05
Sry, forgot to mention this. Added the makeat stuff to the example. The example is the original beamer implementation with an added parbox including basic width calculation. –  ejoerns Feb 22 '12 at 12:28
Can you please complete your code into a full working example with one/two dummy frames? It's precisely the cases as above in the comments that we are trying to avoid. Besides, people who ends up on this page directly from Google might have none to little initial (La)TeX knowledge. –  percusse Feb 24 '12 at 11:05