0

The headline in beamer which spans the width of the top or height of the side in most examples I have seen displays the section/subsection/subsubsection labels. Can I produce a header/headline which is a specified portion/percentage of the slide size or length depending if it was placed along a particular edge?

I have in mind placing the headline as a stunted/shortened rectangle along the top, and beside it to have another 'rectangle' to display the frame title with a logo.

 \setbeamertemplate{frametitle}
{\vskip 0.25pt
  \leavevmode
  \hbox{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=1.8ex,dp=1ex]{frametitle}%
     \insertsection\insertsubsection\\
    \raggedright\hspace*{5em}\Large\insertframetitle 
  \end{beamercolorbox}
  }%
  \vspace{-25pt}
  \hfill
  \includegraphics[width=1cm]{UCFLOGO}
  \hspace*{0.0cm}
  \vskip0pt
  %{\color{ucfBlack}\rule{\textwidth}{0.4mm}}
}


%footer
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.4\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
  \usebeamerfont{author in head/foot}\insertshortauthor
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle\hspace*{3em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{1ex}
  \end{beamercolorbox}}%
  \vskip0pt%
}
1

Depends on the theme, but in most standard themes this should be possible.

As you did not provide any code for your headline, I am going to use the headline from the miniframe outer theme in the following:

\defbeamertemplate*{headline}{miniframes theme}
{%
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip2pt\insertnavigation{\paperwidth}\vskip2pt
  \end{beamercolorbox}%
  \ifbeamer@theme@subsection%
    \begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
    \end{beamercolorbox}
    \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
      \usebeamerfont{subsection in head/foot}\insertsubsectionhead
    \end{beamercolorbox}%
  \fi%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}

To adjust the width, you have to do two things

  1. Specify the width of the bemaercolorboxes width wd={⟨width⟩}
  2. adjusting the width of the navigation element by modifying \insertnavigation{\paperwidth}

So for a headline spanning half the page:

\documentclass{beamer}
\usecolortheme{whale}

\setbeamertemplate{headline}{%
  \begin{beamercolorbox}[colsep=1.5pt, wd=.5\paperwidth]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}[wd=.5\paperwidth]{section in head/foot}
    \vskip2pt\insertnavigation{.5\paperwidth}\vskip2pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt, wd=.5\paperwidth]{lower separation line head}
  \end{beamercolorbox}
}

\begin{document}

\section{1}\begin{frame}\end{frame}
\section{2}\begin{frame}\end{frame}
\section{3}\begin{frame}\end{frame}
\section{4}\begin{frame}\end{frame}
\section{5}\begin{frame}\end{frame}
\section{6}\begin{frame}\end{frame}
\section{7}\begin{frame}\end{frame}
\section{8}\begin{frame}\end{frame}
\section{9}\begin{frame}\end{frame}
\section{10}\begin{frame}\end{frame}

\end{document}

enter image description here

(The colour theme is only loaded to make things more visible)

5
  • I am getting an error, ! Undefined control sequence. \beamer@@tmpl@headline ..beamer@theme@subsection \begin {beamercolorbox}[co..., At the moment I am not importing any theme as I would like to make one from scratch. I cannot figure out where this error I am getting is coming from ... – Vass Feb 6 '17 at 17:51
  • @Vass Can you provide a MWE of what you have tried? – samcarter_is_at_topanswers.xyz Feb 6 '17 at 17:56
  • here is a link to the recent state of the .sty file on github, prior to adding your recommended code, github.com/mantzaris/PegasusBeamer/blob/master/… – Vass Feb 6 '17 at 18:00
  • @samcarter: I would like to nominate you for the TUG Membership 2017 'competition' in order to appreciate your enormous support here on TeX.SE (and because your answers are very often underrated :-() – user31729 Feb 7 '17 at 10:17
  • @ChristianHupfer Please don't worry about the rating of my answers, that is just an intrinsic problem of answering beamer questions. The few occasions I answer different stuff, like siunitx there are many upvotes. – samcarter_is_at_topanswers.xyz Feb 7 '17 at 12:55

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.