3

I'm having a slight problem with the width of the sidebar and the width of the text in the sidebar using beamer.

enter image description here

As seen here, I have manually set the width of the sidebar to 2.9cm, but while there are plenty of room, the text in the sidebar (which currently acts as a table of contents) are still a fixed size, hence some items taking up two lines instead of one.

Complete MWE:

\documentclass[aspectratio=169]{beamer}
\usepackage[utf8]{inputenc} % UFT8 - danske bogstaver
\usepackage[T1]{fontenc}
\usepackage[version=3]{mhchem}

\usepackage{asymptote}

\usetheme{Hannover}
\usecolortheme{rose}
%\useoutertheme{infolines}

\def\swidth{2.2cm}
\setbeamersize{sidebar width left=\swidth}
\setbeamertemplate{sidebar left}
{
  {\usebeamerfont{title in sidebar}%
    \vskip1.5em%
    \usebeamercolor[fg]{title in sidebar}%
    \insertshorttitle[width=\swidth,center,respectlinebreaks]\par%
    \vskip1.25em%
  }%
  {%
    \usebeamercolor[fg]{author in sidebar}%
    \usebeamerfont{author in sidebar}%
    \insertshortauthor[width=\swidth,center,respectlinebreaks]\par%
        \vskip1.25em%
      }%
      \hbox to2cm{\hss\insertlogo\hss}
      \vskip1.25em%
      \insertverticalnavigation{\swidth}%
      \vfill
      \hbox to2cm{\hskip0.6cm\usebeamerfont{subsection in
          sidebar}\strut\usebeamercolor[fg]{subsection in
          sidebar}\insertframenumber/\inserttotalframenumber\hfill}%
      \vskip3pt%
}%



\title{Teknikfags-eksamen}
\date{}
\author{Philip Jakobsen}

\setbeamersize{sidebar width left = 2.9cm}

\begin{document}
%
\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{Indhold}
\tableofcontents
\end{frame}

\section{NMR - kort teori}
%
\begin{frame}

\begin{itemize}
    \item $x$-aksen: elektrontæthed omkring det atom, som proton(erne) er     bundet til
    \pause
    \item $y$-aksen: antal \ce{^{1}H}-kerner 
    \pause
    \item Intensitet $=$ areal (integral) under signal
    \pause
    \item Kan ``mærke'' nærliggende \ce{^{1}H}-kerner $\to$ opsplitning
\end{itemize}

\end{frame}

\section{Isoeugenol Acetat}
%
\begin{frame}

\end{frame}


\subsection{Syntese}
%
\begin{frame}

\end{frame}


\subsection{NMR-spektrum}
%
\begin{frame}

\end{frame}
\end{document} 
  • 1
    it works if you pass the option through the theme declaration: \def\swidth{2.2cm}\usetheme[width=\swidth]{Hannover} – Nico Vecchio Jun 8 '14 at 19:47
6

According to the Documentation the Hannover theme has the option width specified in the way you need it:

width=⟨dimension⟩ sets the width of the sidebar.

So replace your custom code to define the sidebar width with

\usetheme[width=2.2cm]{Hannover}

and it works fine.

  • 1
    Where on earth is the documentation of the Hannover theme? – Kartik Apr 6 at 23:45

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.