2

I'd like to customize the footer in a Beamer document to show the section name with a bar over the top of the name in the document footer. For example: enter image description here

Using code found on Stack Exchange, I was able to produce, in the footer, the following:

enter image description here

I was wondering if anyone could suggest changes to my code that produces the latter in order to get to the former (or at least as close as possible). Specifically, I'd like the section name below the symbol, the symbols visible across the page for all sections (with the current section darker) and the shape roughly rectangular. I'd also like, if possible, to enable navigation to the relevant section by clicking on the blocks above the section title. My code to produce the latter is below, Many thanks, Joe

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{shapes,calc,positioning,arrows}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}{%
\leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=4.8ex,dp=5.125ex]{palette}%
        \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
    \end{beamercolorbox}%
  }
}

\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{objective 1}

\begin{frame} \frametitle{My First Slide} Slide 1 \end{frame} 

\section{objective 2}

\begin{frame} \frametitle{My Second Slide} Slide 2 \end{frame} 

\end{document}

1 Answer 1

0

So if I get you right, you basically want to change the drawing in the TikZ code. First of all we can simply, because the shapes do not differ based on the section. Then we adapt the drawing and the colors to follow your example. Basically the drawing happens in two steps. First fill an area that is to your liking \fill[fill=blue,draw=none] (0,0) -| (1.5,0.2) -- (0.4,0.2) -- (0.3,0.3) -- (0.2,0.2) -| cycle;, then add a node below that contains the text \node(text)[text=blue,anchor=north west] at (0,0) {\strut\insertsectionhead\hskip.3cm};

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{shapes,calc,positioning,arrows}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}{%
\leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=4.8ex,dp=5.125ex]{palette}%
        \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
    \end{beamercolorbox}%
  }
}

\setbeamertemplate{section in head/foot}{%
\begin{tikzpicture}%
    \node[anchor=north west,inner sep=0pt,outer sep=0pt,text=white] at (0,0.3) {\hyperlink{Outline\insertpartheadnumber.\insertsectionheadnumber}{\rule{1.5cm}{0.6cm}}};
    \fill[fill=blue,draw=none] (0,0) -| (1.5,0.2) -- (0.4,0.2) -- (0.3,0.3) -- (0.2,0.2) -| cycle;
    \node(text)[text=blue,anchor=north west] at (0,0) {\strut\insertsectionhead\hskip.3cm};
\end{tikzpicture}
}

\setbeamertemplate{section in head/foot shaded}{%
\begin{tikzpicture}%
        \node[anchor=north west,inner sep=0pt,outer sep=0pt,text=white] at (0,0.3) {\hyperlink{Outline\insertpartheadnumber.\insertsectionheadnumber}{\rule{1.5cm}{0.6cm}}};
        \fill[fill=blue!50,draw=none] (0,0) -| (1.5,0.2) -| cycle;
        \node(text)[text=blue,anchor=north west] at (0,0) {\strut};
\end{tikzpicture}
}

\begin{document}

\section{objective 1}
\begin{frame} \frametitle{My First Slide} Slide 1 \end{frame} 

\section{objective 2}
\begin{frame} \frametitle{My Second Slide} Slide 2 \end{frame} 

\section{objective 3}
\begin{frame} \frametitle{My Second Slide} Slide 2 \end{frame} 

\end{document}

Addition to your request to have a working link

Actually beamer uses targets that are named Outline<part>.<section> to identify the starting page of a section. beamer also offers the \hyperlink command to link to such targets. A quick&dirty solution I found is to put a surface in the background that can be used for the link and then refer to the section by using the given part and section number. Therefore we are adding this line: \node[anchor=north west,inner sep=0pt,outer sep=0pt,text=white] at (0,0.3) {\hyperlink{Outline\insertpartheadnumber.\insertsectionheadnumber}{\rule{1.5cm}{0.6cm}}};

I am sure there is a better solution to create an empty box in the node for the hyperlink to work, in this case you could remove the text=white and maybe also dynamically adjust the size of the node to the actual content. Nevertheless this solution produces a link for the area of the rectangle and button, if you want to see the size, change text=white to text=red and it will be drawn red.

enter image description here

6
  • This looks absolutely perfect! One question though, is it possible to enable the blocks on the bottom to take you to the section it references?
    – retzerjj
    Jul 24, 2020 at 18:51
  • @retzerjj this is a tough one, as the hyperlink is generated by beamer and one would have to look into the details. Please edit the question to mention this point as a requirement.
    – TobiBS
    Jul 24, 2020 at 19:12
  • Done, thanks again very much for your help!!!!
    – retzerjj
    Jul 24, 2020 at 20:43
  • @retzerjj I found a solution, nothing more then a quick hack, but it should work.
    – TobiBS
    Jul 24, 2020 at 21:38
  • Perfect! This works great and is exactly what I needed! Thanks so very much, Joe
    – retzerjj
    Jul 25, 2020 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .