# Beamer: how to change the mini frames from circles to rectangles

I would like to change the mini frames from circles to rectangles and also make the already viewed symbols the same color as the background and future symbols the color of foreground.

\documentclass{beamer}
\usetheme{Frankfurt}
\usecolortheme{dove}

\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother

\begin{document}

\section{Introduction}
\subsection{Introduction}
\begin{frame}{Frame}
\end{frame}

\subsection{Introduction}
\begin{frame}{Frame}
\end{frame}
\end{document}

-
Maybe this could help tex.stackexchange.com/q/56946/14757 –  Sigur Apr 29 '13 at 22:56
I had studied that question before posting mine, but didn't understand how the symbols could be changed. –  Artturi Björk May 2 '13 at 22:20

The mini frame and mini frame in current subsection templates have a box option that will give you squares instead of circles (there's also a tick option producing ticks):

\documentclass{beamer}
\usetheme{Frankfurt}
\usecolortheme{dove}

\setbeamertemplate{mini frame}[box]
\setbeamertemplate{mini frame in current subsection}[box]

\begin{document}

\section{Introduction}

\subsection{Test Subsection One}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Two}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Three}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Four}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Five}
\begin{frame}{Frame}
test \thepage
\end{frame}

\end{document}


Since the question asked for rectangles, not necessarily squares, the templates (as defined in beamerbaseauxtemplates.sty) can be redefined; these templates use \pgfpathrectangle to build a rectangle with equal height and width:

\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\beamer@boxsize}{\the\beamer@boxsize}}


In the code below I changed it to

\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\dimexpr0.5\beamer@boxsize\relax}{\the\beamer@boxsize}}


to have the width be equal to half the height.

To implement the change in the coloring schema, a redefinition of \slideentry (original definition in beamerbasenavigation.sty) was also necessary. I intentionally left the already visited subsections drawn and not completely blacked out, since one might need to return to a previous slide:

\documentclass{beamer}
\usetheme{Frankfurt}
\usecolortheme{dove}

\makeatletter
\setbeamertemplate{mini frame}
{%
\begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\dimexpr0.5\beamer@boxsize\relax}{\the\beamer@boxsize}}
\pgfusepath{fill,stroke}
\end{pgfpicture}%
}
\setbeamertemplate{mini frame in current subsection}
{%
\begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\dimexpr0.5\beamer@boxsize\relax}{\the\beamer@boxsize}}
\pgfusepath{fill,stroke}
\end{pgfpicture}%
}

\def\slideentry#1#2#3#4#5#6{%
%section number, subsection number, slide number, first/last frame, page number, part number
\ifnum#6=\c@part\ifnum#2>0\ifnum#3>0%
\ifbeamer@compress%
\else%
\beamer@xpos=#3\relax%
\beamer@ypos=#2\relax%
\fi%
\hbox to 0pt{%
\beamer@tempdim=-\beamer@vboxoffset%
\multiply\beamer@tempdim by\beamer@ypos%
\raise\beamer@tempdim\hbox{%
\beamer@tempdim=\beamer@boxsize%
\multiply\beamer@tempdim by\beamer@xpos%
\kern\beamer@tempdim
\global\beamer@section@min@dim\beamer@tempdim
\usebeamerfont{mini frame}%
\ifnum\c@section=#1%
\ifnum\c@subsection<#2%
\usebeamercolor[fg]{mini frame}%
\ifnum\c@subsectionslide=#3%
\usebeamertemplate{mini frame}%\beamer@minislidehilight%
\else%
\usebeamertemplate{mini frame in current subsection}%\beamer@minisliderowhilight%
\fi%
\else%
\usebeamercolor{mini frame}%
\color{fg!50!bg}%
\usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
\fi%
\else%
\usebeamercolor{mini frame}%
\color{fg!50!bg}%
\usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
\fi%
}}}\hskip-10cm plus 1fil%
}\fi\fi%
\else%
\fakeslideentry{#1}{#2}{#3}{#4}{#5}{#6}%
\fi\ignorespaces
}

\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother

\begin{document}

\section{Introduction}

\subsection{Test Subsection One}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Two}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Three}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Four}
\begin{frame}{Frame}
test \thepage
\end{frame}

\subsection{Test Subsection Five}
\begin{frame}{Frame}
test \thepage
\end{frame}

\end{document}


-
I posed an updated question about the coloring of the squares here: tex.stackexchange.com/questions/112220/… –  Artturi Björk May 3 '13 at 18:09