I want to reduce the font size of my beamer sidebar in the berkeley theme because is not enough for all my sections. How can I save some space to fit all my titles?
[Tex/LaTex] Reduce fontsize beamer sidebar
beamerfontsize
Related Solutions
The following code contains the necessary redefinitions:
\documentclass{beamer}
\usetheme{Marburg}
\makeatletter
\setbeamertemplate{sidebar \beamer@sidebarside}
{
\beamer@tempdim=\beamer@sidebarwidth%
\advance\beamer@tempdim by -6pt%
\vskip4em%
\insertverticalnavigation{\beamer@sidebarwidth}%
\vfill
\ifx\beamer@sidebarside\beamer@lefttext%
\else%
\usebeamercolor{normal text}%
\llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
\vskip2pt%
\fi%
}%
\ifx\beamer@sidebarside\beamer@lefttext%
\defbeamertemplate*{sidebar right}{sidebar theme}
{%
\vfill%
\llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
\vskip2pt}
\fi
\setbeamertemplate{section in sidebar}%{sidebar theme}
{%
\vbox{%
\vskip1ex%
\beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionheadnumber
~\insertsectionhead}%
}%
}
\setbeamertemplate{section in sidebar shaded}%{sidebar theme}
{%
\vbox{%
\vskip1ex%
\beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionheadnumber
~\insertsectionhead}%
}%
}
\makeatother
\title{Some title}
\author{author}
\institute{my workplace}
\date{\today}
\AtBeginSection[]
{
\begin{frame}
\frametitle{Table of Contents}
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section[Outline]{First Section}
\frame{\tableofcontents}
\section{Introduction}
\begin{frame}
\frametitle{Basics}
\begin{itemize}
\item A
\pause
\item B
\pause
\item C
\end{itemize}
\end{frame}
\subsection{More basics}
\begin{frame}
\frametitle{something goes here}
more stuff
\end{frame}
\section{My work}
\begin{frame}
my stuff...
\end{frame}
\end{document}
An image of the first slide:
You can set ht=0pt, dp=0pt
so that the beamercolorbox
has zero height. Then, adjust the second \vskip
to raise the page numbers from the bottom edge. To remove navigation bar, simply use \setbeamertemplate{navigation symbols}{}
, and this does not affect the page numbering.
Code
\documentclass{beamer}
\usetheme[width=2.0cm]{Berkeley}
%% **this part modifies footline to include slide numbers**
\setbeamertemplate{footline}{%
\leavevmode%
\hbox{\begin{beamercolorbox}[wd=\paperwidth,ht=0ex,dp=0ex,center]{frame number}%
\vskip0pt
\usebeamerfont{footline}\usebeamercolor[fg]{footline}
\insertframenumber/\inserttotalframenumber
\vskip.5ex
\end{beamercolorbox}%
}%
\vskip0pt%
}
% \setbeamertemplate{navigation symbols}{} % to remove navigation bar
\usepackage[utf8]{inputenc}
\title{Sample title}
\author{Anonymous}
\institute{ShareLaTeX}
\date{2013}
\begin{document}
\frame{\titlepage}
\begin{frame}
\frametitle{Sample frame title}
This is a text in first frame. This is a text in first frame. This is a text in first frame.
\end{frame}
\end{document}
Best Answer
Corrected answer with respect to @Gonzales Medinas comment:
Just set the beamer fonts
...section in sidebar
.With the first parameter of fontsize you can change the size of the font and with the second one the distance between the elements.
Original answer:
You have to set the beamer templates
section in sidebar
andsection in sidebar shaded
(change\fontsize{2}{2}
to your liking). Probably it also makes sense to reduce thevksip
between the sections. This can be done in thebeamer@sidebarformat
macro. I also added this to the MWE.