Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
\setbeamercolor{section in head/foot}{fg=white, bg=black}

\makeatletter
\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother

\begin{document}

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

        \subsection{Introduction}   
            \begin{frame}{Frame}
            \end{frame}
\end{document}
share|improve this question
    
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

1 Answer 1

up vote 10 down vote accepted

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}
\setbeamercolor{section in head/foot}{fg=white, bg=black}

\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}

enter image description here

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}
\setbeamercolor{section in head/foot}{fg=white, bg=black}

\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}}
    \pgfsetfillcolor{section in head/foot.bg}
    \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%
      \advance\beamer@xpos by1\relax%
    \else%
      \beamer@xpos=#3\relax%
      \beamer@ypos=#2\relax%
    \fi%
  \hbox to 0pt{%
    \beamer@tempdim=-\beamer@vboxoffset%
    \advance\beamer@tempdim by-\beamer@boxsize%
    \multiply\beamer@tempdim by\beamer@ypos%
    \advance\beamer@tempdim by -.05cm%
    \raise\beamer@tempdim\hbox{%
      \beamer@tempdim=\beamer@boxsize%
      \multiply\beamer@tempdim by\beamer@xpos%
      \advance\beamer@tempdim by -\beamer@boxsize%
      \advance\beamer@tempdim by 1pt%
      \kern\beamer@tempdim
      \global\beamer@section@min@dim\beamer@tempdim
      \hbox{\beamer@link(#4){%
          \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{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \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}

enter image description here

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.