Here it was answered how to implement a progress bar for a beamer presentation. In particular, I liked the first solution. However it has one shortcoming, namely that the progress bar is valid for the entire presentation, so the main part of the code defining the size of the bar is \insertframenumber/\inserttotalframenumber.

Now, imagine I have slides with several sections and subsections, where each subsection has several/many slides (the entire document is more than 100 pages). So I would like to have a progress bar that shows progress in the current section (or even subsection). Actually, many of the default themes have this functionality (as noted here) but not in the form of a progress bar.

I could easily adapt the code in the first solution, but for this I need to find commands that would give the number of frames and the number of the first frame in the current section, if they exist.

1 Answer 1


Add the following to your preamble.

    \definecolor{lightgr}{rgb}{0.7 0.7 0.7}


    \apptocmd{\beamer@section}{\beamer@sectionstartframe=\c@framenumber\advance\beamer@sectionstartframe by1\relax}{}{}

            \ifnum \c@framenumber>#2%

    \def\beamertextwidth{\dimexpr 0.875 \textwidth\relax}

        \color{lightgr}% to color the progressbar
        \rlap{\rule{\numexpr (\insertframenumber-\insertsectionstartframe)+1  \dimexpr  \beamertextwidth/(\insertsectionendframe -\insertsectionstartframe+1) \relax}{3pt}}%

The above code should create a section progressbar in the footline of each slide. Note that the above code does work properly if you create new frames inside the AtBeginSection environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .