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 want to do the following changes to the mini frames coloring: All previous frames almost the same solid color as the background so that the squares are barely visible. The current frame and all future frames the color of the foreground.

    \documentclass{beamer}
    \usetheme{Frankfurt}
    \usecolortheme{dove}
    \setbeamercolor{section in head/foot}{fg=white, bg=black}
\definecolor{dark-gray}{gray}{0.10} %color for the navigation squares


    \makeatletter
\setbeamertemplate{mini frame}
{%
  \begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}
    \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\beamer@boxsize}{\the\beamer@boxsize}}
    \pgfusepath{fill,stroke}
  \end{pgfpicture}%
}
\setbeamertemplate{mini frame in current subsection}
{%
  \begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}
    \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\beamer@boxsize}{\the\beamer@boxsize}}
    \pgfsetfillcolor{dark-gray}
    \pgfusepath{fill}
  \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 2pt{%
    \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]{section 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]{section in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{section 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}
                    1
                \end{frame}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \end{document}

This is an update to a question I posted earlier: Beamer: how to change the mini frames from circles to rectangles, but since it was answered and I suspect that the answer to the updated question is going to differ from the original question I posted this as a new question.

share|improve this question
1  
Have you tried a command like \setbeamercolor{navigation symbols}{fg=red} ? (See p. 11 and 72 of the manual) ? –  ach May 3 '13 at 19:49
    
I tried it now and it didn't do what I was looking for. To be clear the code that I posted colors all frames after the one I'm on in the section I'm in correctly. I would like to color the current frame and following frames in other sections the same. –  Artturi Björk May 4 '13 at 3:47
    
Ah I think I misunderstood, navigation symbols are the ones that appear in the lower right by default, that you can use to navigate, not the boxes / circles that appear in the top for some templates. –  ach May 4 '13 at 9:32
1  
Hmmm... but I seem to get exactly the result you described. Am I missing something? What id the difference between the result obtained with the current code (the one in your question) and the desired result? –  Gonzalo Medina May 4 '13 at 22:59
1  
As the code stands the current frame is colored dark-gray. I would like it to be colored white. All frames in following sections are colored dark-gray. I would like them to be colored white. –  Artturi Björk May 6 '13 at 2:02

1 Answer 1

up vote 1 down vote accepted

To color the mini frames of slides already shown gray and the current and all future frames white, the existing solution can be modified like this:

\documentclass{beamer}
\usetheme{Frankfurt}
\usecolortheme{dove}
\setbeamercolor{section in head/foot}{fg=white, bg=black}
\definecolor{dark-gray}{gray}{0.10} %color for the navigation squares

\makeatletter
\setbeamertemplate{mini frame}
{%
  \begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}
    \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\beamer@boxsize}{\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%
      \advance\beamer@xpos by1\relax%
    \else%
      \beamer@xpos=#3\relax%
      \beamer@ypos=#2\relax%
    \fi%
  \hbox to 2pt{%
    \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%
            \color{dark-gray}%
          \else%
            \ifnum\c@section=#1%
              \ifnum\c@subsection>#2%
                \color{dark-gray}%
              \else%
                \ifnum\c@subsection=#2%
                  \ifnum\c@subsectionslide>#3%
                    \color{dark-gray}%
                  \else%
                    \color{white}%
                  \fi%
                \else%
                  \color{white}%
                \fi%
              \fi%
            \else%
              \color{white}%
            \fi%
          \fi%
          \usebeamertemplate{mini frame}%
        }}}\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]{section 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]{section in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{section 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}
                    1
                \end{frame}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \end{document}

headline of slide 7, with the previous frames colored gray and the current and future frames color white

Explanation

The decision whether a mini frame should be colored gray or white is made in ll. 39-59, where the section, subsection, and "frame in subsection" numbers of the currently processed mini frame are subsequently compared to the actual position in the presentation. This is necessary as the "absolute" frame number of the current mini frame isn't available.

share|improve this answer

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.