I'm making a presentation in Warsaw theme of Beamer with headline structure as follows:

\setbeamertemplate{headline}{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette quaternary}%
\end{beamercolorbox}%
}
}


How to display only three sections or like so, previous-current-after sections, with highlighting current section ? As I've a large number of sections ~10, all of them can not be displayed in headline. Please suggest.

• I think that this kind of headline intention is to show audience in which point of the presentation you are. If you suppress part of this information, headline is useless. Did you considered to change to a sidebar theme? – Ignasi Apr 28 '15 at 12:14
• Thank you Ignasi for your reply. If you are asking about using themes like Bergen or Marburg , then it is the same reason I did not used default Warsaw theme; i.e. I need more space in slides to add images. And these themes consume space from it. So I used above type of headline , so that it can be confined within a line with less use of space. – shreekant Apr 28 '15 at 13:55
• Have a look at this answer tex.stackexchange.com/a/54956/36296 – samcarter_is_at_topanswers.xyz Apr 28 '15 at 15:06
• Thank you samcarter for your reply. This solves the problem little bit :) Is it possible to keep it as line at top instead of generating bands at top ? – shreekant Apr 28 '15 at 15:33

\documentclass{beamer}

\usetheme{Warsaw}

\AtBeginSection[]{\label{sec:\thesection}}

\usepackage{totcount}
\newcounter{totalsection}
\regtotcounter{totalsection}

\AtBeginDocument{%
\pretocmd{\section}{\refstepcounter{totalsection}}{}{}%
}%

\newcounter{start}
\newcounter{stop}

\usepackage{pgffor}

\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette quaternary}%
\ifnum\value{section}>0%
\setcounter{start}{\value{section}}
\setcounter{stop}{\value{section}}
\ifnum\value{section}>1
\fi
\ifnum\value{section}<\totvalue{totalsection}
\fi
\foreach \i in {\thestart,...,\thestop}{%
\ifnum\i=\value{section}
\else
\fi
}
\fi
\end{beamercolorbox}%
}
}

\begin{document}

\section{test1}\begin{frame}abc\end{frame}
\section{test2}\begin{frame}abc\end{frame}
\section{test3}\begin{frame}abc\end{frame}
\section{test4}\begin{frame}abc\end{frame}
\section{test5}\begin{frame}abc\end{frame}
\section{test6}\begin{frame}abc\end{frame}
\section{test7}\begin{frame}abc\end{frame}
\section{test8}\begin{frame}abc\end{frame}
\section{test9}\begin{frame}abc\end{frame}
\section{test10}\begin{frame}abc\end{frame}
\section{test11}\begin{frame}abc\end{frame}

\end{document}