0

I would like to create a beamer theme for my presentations. I like to show in the presentations a horizontal navigation bar in the header to give a reference of the progress of the presentation.

In my PowerPoint presentations I usually add a shape similar to tikz's signal for each section, shading everyone except for the current section or changing fill colour as shown in the figure.

Deasired header result

After checking how the \insertsectionnavigationhorizontal and \dohead beamer macros are implemented, I am still not able to identify where each section name and hyperlink is included in the header. It is the first time I dig into Plain TeX macros, so I don't fully understand the default definitions. Adding a tikz node to my custom \myinsertsectionnavigationhorizontal definition allows me to include a common shape for the whole header:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes}

\usetheme{default}

\makeatletter
\def\myinsertsectionnavigationhorizontal#1#2#3{%
  \hbox to #1{{%
     \def\slideentry##1##2##3##4##5##6{}%
     #2\hskip.3cm%
     \usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
     \setbox\beamer@sectionbox=\hbox{}%
     \ht\beamer@sectionbox=1.875ex%
     \dp\beamer@sectionbox=0.75ex%
     \tikz\node[draw=myblue,fill=myblue,shape=signal,signal to=east,very thick,text=white]%
         {\hskip-1.875ex plus-1fill\dohead\box\beamer@sectionbox\hfil\hskip.3cm};%
     #3}}}
\makeatother

\definecolor{myblue}{RGB}{0,112,188}
\setbeamercolor*{section in head/foot}{fg=white}

\setbeamertemplate{frametitle}
{%
\begin{beamercolorbox}[wd=\paperwidth,ht=1.1cm]{frametitle} 
\begin{tikzpicture}
\useasboundingbox[fill=white](0,0) rectangle(\the\paperwidth,1.2);
\node[anchor=west, myblue,font=\large] at (0.5cm,0.61cm){\insertframetitle};
\end{tikzpicture}
\end{beamercolorbox}
}

\setbeamertemplate{headline}
{%
\begin{beamercolorbox}{section in head/foot}
    \vskip5pt\myinsertsectionnavigationhorizontal{\paperwidth}{\hspace{0.5cm}}{\hspace{0.5cm}}\vskip5pt
\end{beamercolorbox}
}

\begin{document}

\section[Introduction]{Introduction}
\begin{frame}
\frametitle{Introduction}
Text here.
\end{frame}

\section[Prev. Work]{Previous Work}
\begin{frame}
\frametitle{Previous Work Overview}
Text here.
\end{frame}

\section[Design]{Design Procedure}
\begin{frame}
\frametitle{Design Overview}
Text
\end{frame}

\section[Results]{Experiment Results}
\begin{frame}
\frametitle{Results}
Example text.
\end{frame}

\section[Conclusion]{Final Conclusions}
\begin{frame}
\frametitle{Conclusion}
Text.
\end{frame}

\end{document}    

Resulting Header Style

How would it be possible to specify an individual shape for each section name, and if possible a different one for the current section?

  • 1
    Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. A MWE should compile and be as small as possible to demonstrate your problem. it's much easier to help you if we have full working code to start from. – Andrew Oct 27 '17 at 14:07
  • Thank you for the suggestion! I have just added the MWE, and sorry for the newbie issues. – G. Borque Oct 27 '17 at 14:46
2

You could do something like:

\documentclass{beamer}


\setbeamertemplate{headline}{%
\leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=4.8ex,dp=0.125ex]{palette}%
        \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
    \end{beamercolorbox}%
  }
}

\usepackage{tikz}
\usetikzlibrary{shapes}

\setbeamertemplate{section in head/foot}{%
    \if\insertsectionheadnumber1
        \tikz\node[draw=blue,fill=blue,shape=signal,very thick,text=white]{\insertsectionhead\hskip.3cm};
    \else
        \tikz\node[draw=blue,fill=blue,shape=signal,signal from=west, signal to=east,very thick,text=white]     {\insertsectionhead\hskip.3cm};
  \fi
}

\setbeamertemplate{section in head/foot shaded}{%
    \if\insertsectionheadnumber1
        \tikz\node[draw=blue,fill=white,shape=signal,very thick,text=blue]{\insertsectionhead\hskip.3cm};
    \else
        \tikz\node[draw=blue,fill=white,shape=signal,signal from=west, signal to=east,very thick,text=blue]     {\insertsectionhead\hskip.3cm};
  \fi
}

\begin{document}

\section{Introduction}
\subsection{The questions}
\begin{frame}\frametitle{A test frame}Test\end{frame}
\subsection{Another questions}
\begin{frame}\frametitle{Another test frame}Test
%\textcolor‎{‎letterfoot‎}{\rule{2cm}{2cm}}‎
\end{frame}

\section{section2}
\subsection{The questions}
\begin{frame}\frametitle{A test frame}Test\end{frame}
\subsection{Another questions}
\begin{frame}\frametitle{Another test frame}Test
%\textcolor‎{‎letterfoot‎}{\rule{2cm}{2cm}}‎
\end{frame}

\end{document}

enter image description here

  • Oh! I can't imagine the solution could be that simple, I was definately heading towards the wrong direction. Thanks for the help! – G. Borque Oct 30 '17 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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