1

I am using a heavily modified version of the ua-beamer theme by Nico Schlomer available at:

https://github.com/nschloe/ua-beamer/blob/master/theme/beamerouterthemeUniversiteitAntwerpen.sty

I have modified the .sty files and I would like a new section to appear on a new line in the heading once space runs out on the line that it is on. Consider the example in the image below. I have 9 sections in the .tex file, however the last 2 sections are cut off.

section cut off

I would like to get sections to move to a new line once space has run out, such as in the picture below:

Sections on new lien

I have created a minimal example below.

One of the files needed is the beamerthemeUniversityCustom.sty file

% Original from 2009--2011 by Nico Schlomer
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.

% -------------------------------------------------------------------------
% introduce options
\DeclareOptionBeamer{compress}{\beamer@compresstrue}

\newif\ifbeamer@dark
\beamer@darkfalse
\DeclareOptionBeamer{dark}{\beamer@darktrue}

\newif\ifbeamer@darktitle
\beamer@darktitlefalse
\DeclareOptionBeamer{darktitle}{\beamer@darktitletrue}

\newif\ifbeamer@framenumber
\beamer@framenumberfalse
\DeclareOptionBeamer{framenumber}{\beamer@framenumbertrue}

\newif\ifbeamer@totalframenumber
\beamer@totalframenumberfalse
\DeclareOptionBeamer{totalframenumber}{\beamer@totalframenumbertrue}

\ProcessOptionsBeamer
% -------------------------------------------------------------------------

\mode<presentation>

%\useinnertheme{UniversityCustom}
%\usefonttheme {UniversityCustom}
%\usecolortheme{UniversityCustom}
\useoutertheme{UniversityCustom}

%\useoutertheme[subsection=false]{smoothbars}
%\useinnertheme[shadow=true]{rounded}
%\usecolortheme{orchid}
%\usecolortheme{whale}

\setbeamerfont{block title}{size={}}


\mode
<all>

Another file needed is the beamerouterthemeUniversityCustom.sty file.

% Copyright 2009--2011 by Nico Schlomer
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.

% \geometry{paperheight=7.5in,paperwidth=10.0in}
% ... Hang on! As suggested in the manual, don't mess around with beamer's
% assumed page dimensions (128mm x 96mm). Fonts, for example, do no get 
% automatically scaled and will look tiny if the above is executed.
% Instead, define a multiplier 12.8/(10.0*2.54) = 64/127 and adjust all
% respective lengths.


% ----------------------------------------------------------------------------
% *** required packages <<<
% ----------------------------------------------------------------------------
\RequirePackage{calc}
\RequirePackage{ifthen}
% ----------------------------------------------------------------------------
% *** END required packages >>>
% ----------------------------------------------------------------------------

\mode<presentation>

% ----------------------------------------------------------------------------
% *** DEFINE LENGTHS <<<
% ----------------------------------------------------------------------------
\newlength{\margin}
\setlength{\margin}{0.8832cm}% 

\newlength{\ulogowidth}
\setlength{\ulogowidth}{1.1136cm}% 
\newlength{\ulogoheight}
\setlength{\ulogoheight}{0.90066895151709692cm}% 
\ifbeamer@dark\else%
  \newlength{\ulogopadding}
  \setlength{\ulogopadding}{0.2784cm}
\fi
% ----------------------------------------------------------------------------
% *** END DEFINE LENGTHS >>>
% ----------------------------------------------------------------------------


% ----------------------------------------------------------------------------
% *** DEFINE IMAGES <<<
% ----------------------------------------------------------------------------

\pgfdeclareimage[width=2.5cm]{ULogo}{UGlogo}

\newlength{\textlogoheight}
\setlength{\textlogoheight}{0.37218461538461539cm}
\pgfdeclareimage[width=0cm]{uTextColor}{mathstat}


\ifthenelse{ \boolean{beamer@dark} \OR \boolean{beamer@darktitle} }
{\pgfdeclareimage[width=\paperwidth]{uaBackgroundDark}{uaBackgroundDarkBlue}}
{}

\ifbeamer@dark%
  \pgfdeclareimage[width=\paperwidth]{uaBackgroundLight}{uaBackgroundLightBlue}
\else%
  \newlength{\wavewidth}
  \setlength{\wavewidth}{10.0cm}%
  \newlength{\waveheight}
  \setlength{\waveheight}{0.6cm}%
  \pgfdeclareimage[width=\wavewidth,height=\waveheight]{uWave}{uabottomwave}
\fi
% ----------------------------------------------------------------------------
% *** END DEFINE IMAGES <<<
% ----------------------------------------------------------------------------



% ----------------------------------------------------------------------------
% *** HEADLINE <<<
% ----------------------------------------------------------------------------

\ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }{%
  \defbeamertemplate*{headline}{univ theme}%
  {
    % page number
    \ifbeamer@framenumber%
      \ifnum\c@framenumber=1\else
       \pgftext[right,top,at=\pgfpoint{\paperwidth-\margin}{-0.04\paperheight}]{%
          \usebeamerfont{frame number in head}%
          \usebeamercolor[fg]{frame number in head}%
          \insertframenumber{}%
          \ifbeamer@totalframenumber%
            /\inserttotalframenumber%
          \fi
        }%
      \fi
    \fi%
  }%
}{
  \newlength{\logotopmargin}%
  \setlength{\logotopmargin}{0.300cm}%  
  \defbeamertemplate*{headline}{univ theme}%
  {%
    \vskip\logotopmargin%
    \hskip\margin%
    \ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }
    {%
      \vskip5cm
    }
    {

\hspace*{-0.5cm}
\begin{minipage}[t][][b]{0.35\textwidth}
\centering
    \pgfuseimage{ULogo}
\end{minipage}% <---------------- Note the use of "%"
\begin{minipage}[t][][b]{0.5\textwidth}
\raggedright
\hbox{
\begin{beamercolorbox}[wd=\paperwidth,ht=3.00ex,dp=5.5ex]{palette quaternary}%
    \insertnavigation{0.5\textwidth}
  \end{beamercolorbox}%
}
\end{minipage}
    }
  }
}
% ----------------------------------------------------------------------------
% *** END HEADLINE <<<
% ----------------------------------------------------------------------------



% ----------------------------------------------------------------------------
% *** FRAMETITLE <<<
% ----------------------------------------------------------------------------
\newlength\frametitletopmargin
\ifbeamer@compress%
  \setlength{\frametitletopmargin}{-1.01cm}% 
\else
  \setlength{\frametitletopmargin}{-1.01cm}% 
\fi

\ifbeamer@dark\else%
  \newlength{\frametitlewidth}
  \setlength{\frametitlewidth}{\textwidth-\ulogowidth-\ulogopadding}
\fi

\defbeamertemplate*{frametitle}{univ theme}
{%
  \ifbeamer@dark%
    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    \vskip\frametitletopmargin%
    \raggedleft\insertframetitle\par%
    % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  \else%
    \ifbeamer@compress%
      \nointerlineskip%
      \vskip-\ulogoheight%
      \vbox to \ulogoheight{%
        \vfil%
        \leftskip=\ulogowidth%
        \advance\leftskip by\ulogopadding%
        \begin{beamercolorbox}[right=1.1136cm]{frame title}%
        \hfill\insertframetitle\par%
        \end{beamercolorbox}%
        \vfil%
      }%
    \else%
      \vspace*{-0.50cm} %%%% FRAME TITLE HEIGHT
      \rule{\textwidth}{0.50pt}
      \hfill\\[-0.15em]
      \begin{beamercolorbox}[left]{frame title}%
      \parbox{\textwidth}
        \insertframetitle\par%
      \end{beamercolorbox}%
    \fi%
  \fi%
}
% ----------------------------------------------------------------------------
% *** END FRAMETITLE >>>
% ----------------------------------------------------------------------------



% ----------------------------------------------------------------------------
% *** FOOTLINE <<<
% ----------------------------------------------------------------------------

\newlength{\textlogobottommarginDark}
\setlength{\textlogobottommarginDark}{0.41452307692307688cm}% 
\newcommand\uTextColorPosDark {\pgfpoint{\margin}{\textlogobottommarginDark}}

\newlength{\textlogobottommarginLight}
\setlength{\textlogobottommarginLight}{0.45292307692307715cm}% 
\newcommand\uTextColorPosLight{\pgfpoint{\margin}{\textlogobottommarginLight}}

\newlength{\logorightmargin}%
\setlength{\logorightmargin}{12.1344cm}%
\newlength{\logobottommargin}%
\setlength{\logobottommargin}{0.512cm}%
\newcommand\posUlogoFoot{\pgfpoint{\logorightmargin}{\logobottommargin}}

\newcommand{\uWavePos}{\pgfpoint{\paperwidth}{0cm}}

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\defbeamertemplate*{footline}{univ theme dark}
{%
  \ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }
  % *** THEN *** dark footline
  {%
    \pgftext[left,bottom,at=\uTextColorPosDark]{\pgfuseimage{uTextColor}}%
    \pgftext[right,bottom,at=\posUlogoFoot]{\pgfuseimage{ULogo}}%
  }
  % *** ELSE *** light footline
  {%
     % conditionally put the univ text logo on the page
    \ifthenelse{\c@framenumber=1 \OR \NOT \boolean{beamer@compress}}
    {\pgftext[left,bottom,at=\uTextColorPosLight]{\pgfuseimage{uTextColor}}}%

    {}%
    % removed bottom wave image to get more space
    % page number
    \ifbeamer@framenumber%
      \ifnum\c@framenumber=1\else
        \pgftext[right,bottom,at=\pgfpoint{0.98\paperwidth}{0.02\paperwidth}]{%
          \usebeamerfont{frame number in foot}%
          \usebeamercolor[fg]{frame number in foot}\insertframenumber{}%
          \ifbeamer@totalframenumber%
            \inserttotalframenumber%
          \fi
        }%
      \fi
    \fi%
    }
}%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

% ----------------------------------------------------------------------------
% *** END of FOOTLINE >>>
% ---------------------------------------------------------------------------- 


% ----------------------------------------------------------------------------
% *** MARGINS <<<
% ----------------------------------------------------------------------------
% set left and right text margins
\setbeamersize{text margin left=\margin,%
               text margin right=\margin}
% ----------------------------------------------------------------------------
% *** END MARGINS >>>
% ----------------------------------------------------------------------------



% ----------------------------------------------------------------------------
% *** BACKGROUND <<<
% ----------------------------------------------------------------------------
\defbeamertemplate*{background canvas}{univ theme}
{%
  \ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }
  % *** THEN ***
  {%
    \ifnum\c@framenumber=1%
      \pgfuseimage{uaBackgroundDark}
    \else%
      \pgfuseimage{uaBackgroundLight}%
    \fi%
  }
  % *** ELSE ***
  {}
}
% ----------------------------------------------------------------------------
% *** END BACKGROUND <<<
% ----------------------------------------------------------------------------

\mode
<all>

Any 2 dummy images titled UGlogo and mathstat are also required. Any 2 images with these names will suffice. I have used black rectangles such as the one below (please rename and save as UGlogo.jpeg and mathstat.jpeg respectively).

black rectangle

The code for the main presentation.tex file with all of the sections is:

\documentclass[xcolor=svgnames]{beamer}
\mode<presentation>

\setbeamertemplate{navigation symbols}{} 
\usefonttheme{serif}

\usetheme{UniversityCustom}

\useinnertheme{rectangles}
\setbeamertemplate{items}[circle]
\setbeamertemplate{blocks}[rounded=false, shadow=false]

\renewcommand{\contentsname}{Outline}
\AtBeginSection[]
{
\begin{frame}<beamer>{Outline}
        \normalsize{\tableofcontents[currentsection,currentsubsection]}
\end{frame}
}

\makeatletter
  \beamer@compressfalse
\makeatother


\title{Title}
\subtitle{Subtitle}
\author{My Name}
\institute{My University}
\date{Date}



\begin{document}

\begin{frame}[t]
    \maketitle
\end{frame}


\begin{frame}[t]
\frametitle{Outline}
\tableofcontents
\end{frame}

\section{Section 8}

\begin{frame}[t]
\frametitle{Section 8}
Text goes here
\end{frame}

\section{Section 9}

\begin{frame}[t]
\frametitle{Section 9}
Text goes here
\end{frame}

\section{Section 3}

\begin{frame}[t]
\frametitle{Section 3}
Text goes here
\end{frame}

\section{Section 4}

\begin{frame}[t]
\frametitle{Section 4}
Text goes here
\end{frame}

\section{Section 5}

\begin{frame}[t]
\frametitle{Section 5}
Text goes here
\end{frame}

\section{Section 6}

\begin{frame}[t]
\frametitle{Section 6}
Text goes here
\end{frame}

\section{Section 7}

\begin{frame}[t]
\frametitle{Section 7}
Text goes here
\end{frame}

\section{Section 8}

\begin{frame}[t]
\frametitle{Section 8}
Text goes here
\end{frame}

\section{Section 9}

\begin{frame}[t]
\frametitle{Section 9}
Text goes here
\end{frame}

\end{document}

I believe that it has something to do with the section with the \insertnavigation line in the beamerouterthemeUniversityCustom.sty however I can not figure out the changes required to fix my issue.

\begin{beamercolorbox}[wd=\paperwidth,ht=3.00ex,dp=5.5ex]{palette quaternary}%
    \insertnavigation{0.5\textwidth}
  \end{beamercolorbox}%

I have tried using \parbox and specifying a width, but unfortunately this did not solve the issue.

Is it possible to make new sections appear on a new line using this custom template?

Thank you for looking at my post.

1

Your Answer

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

Browse other questions tagged or ask your own question.