2

The top of my slides have a title and subtitle (I eliminated the headline). However, I want to put the navigation bar, only for sections, at the corner right of the title and subtitle lines. This is shown below for the first slide. However, it is messy, as it changes the size of the bar and the font type and sizes are not consistent.

  1. How can I adjust this properly so it retains the size of the bar of slide 2?
  2. Is there a way I can create this for all slides? So far I do it by writing it on each slide's title, as can be seen below.

MWE:

\documentclass[10pt]{beamer}
\usetheme{Warsaw}
\usefonttheme[onlymath]{serif}
\setbeamertemplate{footline}{}
\setbeamertemplate{headline}{}
\setbeamertemplate{section in head/foot}
{ %
\fontsize{20}{25}
}
\setbeamertemplate{navigation symbols}{}

\begin{document}

\section{Section 1}
\begin{frame}{Topic 1 \hfill \insertsectionnavigation{2cm}}
\framesubtitle{Frame 1}
Frame 1
\end{frame}
\section{Section 2}
\begin{frame}{Topic 2}
\framesubtitle{Frame 2}
Frame 2
\end{frame}
\end{document}
1
  • Don't know how to show slide here...
    – luchonacho
    May 13, 2015 at 9:58

1 Answer 1

3

You can do this redefining the frametitle template as defined by the shadow outer theme (internally used by Warsaw) to include the navigation bar. The theme displays the title and the subtitle using a minipage having a width of \paperwidth width, so I changed the width to 0.5\paperwidth and added another minipage of the same width to add the navigation bar; of course, feel free to make the modifications that better suit your needs:

\documentclass[10pt]{beamer}
\usetheme{Warsaw}
\usefonttheme[onlymath]{serif}
\setbeamertemplate{footline}{}
\setbeamertemplate{headline}{}
\setbeamertemplate{section in head/foot}
{ %
\fontsize{20}{25}
}
\setbeamertemplate{navigation symbols}{}

\makeatletter
\defbeamertemplate*{frametitle}{myshadow theme}
{%
  \nointerlineskip%
  \vskip-2pt%
  \hbox{\leavevmode
    \advance\beamer@leftmargin by -12bp%
    \advance\beamer@rightmargin by -12bp%
    \beamer@tempdim=\textwidth%
    \advance\beamer@tempdim by \beamer@leftmargin%
    \advance\beamer@tempdim by \beamer@rightmargin%
    \hskip-\Gm@lmargin\hbox{%
      \setbox\beamer@tempbox=\hbox{\begin{minipage}[b]{.5\paperwidth}%
          \vbox{}\vskip-.75ex%
          \leftskip0.3cm%
          \rightskip0.3cm plus1fil\leavevmode
          \insertframetitle%
          \ifx\insertframesubtitle\@empty%
            \strut\par%
          \else
            \par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par}%
          \fi%
          \nointerlineskip
          \vbox{}%
          \end{minipage}%
          \begin{minipage}[b]{.5\paperwidth}
            \hfill\raisebox{0.5\height}[0pt][0pt]{%
              \insertsectionnavigationhorizontal{.5\paperwidth}{\hskip1em}{\hskip1em}%
              }%
          \end{minipage}%
          }%
      \beamer@tempdim=\ht\beamer@tempbox%
      \advance\beamer@tempdim by 2pt%
      \begin{pgfpicture}{0pt}{0pt}{\paperwidth}{\beamer@tempdim}
        \usebeamercolor{frametitle right}
        \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
        \pgfusepath{clip}
        \pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
      \end{pgfpicture}
      \hskip-\paperwidth%
      \box\beamer@tempbox%
    }%
    \hskip-\Gm@rmargin%
  }%
  \nointerlineskip
    \vskip-0.2pt
    \hbox to\textwidth{\hskip-\Gm@lmargin\pgfuseshading{beamer@topshade}\hskip-\Gm@rmargin}
    \vskip-2pt
}
\makeatother

\begin{document}

\section{Section 1}
\begin{frame}{Topic 1}
\framesubtitle{Frame 1}
Frame 1
\end{frame}

\section{Section 2}
\begin{frame}{Topic 2}
\framesubtitle{Frame 2}
Frame 2
\end{frame}

\section{Section 3}
\begin{frame}{Topic 3}
\framesubtitle{Frame 3}
Frame 2
\end{frame}

\end{document}

An image of the resulting document:

enter image description here

3
  • I can't really understand the code but two things: I want it vertically aligned, so I replaced your horizontal navigation by \insertsectionnavigation by dissapears. I fail to see how to fix it. Also, how can I control the text size?
    – luchonacho
    May 13, 2015 at 14:10
  • Got it! added \tiny in front of that command and changed some of the height properties. Now it works!! :)
    – luchonacho
    May 13, 2015 at 14:24
  • I'm only missing some bits. There are more items than those that fit in the navigation bar, which doesn't adjust automatically. In fact, it changes according to title and subtitle. How can make them all visible?
    – luchonacho
    May 13, 2015 at 14:31

You must log in to answer this question.

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