1

Is there a way to display the list of frames in multicolumns (2 or 3). I use the following code from the following post [Is there any way to produce List of frames with beamer?

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{hyperref}

\newif\ifframeinlbf
\frameinlbftrue
\makeatletter
\newcommand\listofframes{\@starttoc{lbf}}
\makeatother

\addtobeamertemplate{frametitle}{}{%
  \ifframeinlbf
  \addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
    \protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}% 
  \protect\hyperlink{page.\insertpagenumber}\insertframetitle\par}
  \else\fi
}
\begin{document}
\frameinlbffalse
\begin{frame}[fragile,t,allowframebreaks]
\frametitle{List of Frames}
\listofframes
\end{frame}
\frameinlbftrue
\begin{frame}
\frametitle{Frame 1}
frame 1
\end{frame}
\begin{frame}
\frametitle{Frame 2}
frame 2
\end{frame}
\begin{frame}
\frametitle{Frame 3}
frame 3
\end{frame}
\begin{frame}
\frametitle{Frame 4}
frame 4
\end{frame}
\begin{frame}
\frametitle{Frame 5}
frame 5
\end{frame}
\begin{frame}
\frametitle{Frame 6}
frame 6
\end{frame}
\begin{frame}
\frametitle{Frame 7}
frame 7
\end{frame}
\begin{frame}
\frametitle{Frame 8}
frame 8
\end{frame}
\begin{frame}
\frametitle{Frame 9}
frame 9
\end{frame}
\begin{frame}
\frametitle{Frame 10}
frame 10
\end{frame}
\begin{frame}
\frametitle{Frame 11}
frame 11
\end{frame}
\begin{frame}
\frametitle{Frame 12}
frame 12
\end{frame}
\begin{frame}
\frametitle{Frame 13}
frame 13
\end{frame}
\begin{frame}
\frametitle{Frame 14}
frame 14
\end{frame}
\begin{frame}
\frametitle{Frame 15}
frame 15
\end{frame}
\begin{frame}
\frametitle{Frame 16}
frame 16
\end{frame}
\begin{frame}
\frametitle{Frame 17}
frame 17
\end{frame}
\begin{frame}
\frametitle{Frame 18}
frame 18
\end{frame}
\begin{frame}
\frametitle{Frame 19}
frame 19
\end{frame}
\begin{frame}
\frametitle{Frame 20}
frame 20
\end{frame}

\end{document}

When using multicol, it does not recognize allowframebreaks option in frame definition as shown in this screen shot

enter image description here

Here is the code I used

    \documentclass{beamer}
\beamertemplatenavigationsymbolsempty % suppress navigation bar
\usepackage{verbatim}
\usepackage{multicol}

\newif\ifframeinlbf
\frameinlbftrue
\makeatletter
\newcommand\listofframes{\@starttoc{lbf}}
\makeatother

\addtobeamertemplate{frametitle}{}{%
  \ifframeinlbf
  \addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
    \protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}
  \protect\hyperlink{page.\insertpagenumber}\insertframetitle\par}
  \else\fi
}
\begin{document}
\frameinlbffalse
\begin{frame}[fragile,t,allowframebreaks]
\frametitle{List of Frames}
\begin{multicols}{3}
\listofframes
\end{multicols}
\end{frame}
\frameinlbftrue

\begin{frame}[fragile,t]
\frametitle{frame 1}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 2}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 3}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 4}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 5}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 6}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 7}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 8}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 9}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 10}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 11}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 12}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 13}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 14}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 15}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 16}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 17}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 18}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 19}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 20}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 21}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 22}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 23}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 24}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 25}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 26}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 27}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 28}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 29}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 30}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 31}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 32}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 33}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 34}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 35}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 36}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 37}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 38}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 39}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 40}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 41}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 42}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 43}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 44}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 45}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 46}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 47}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 48}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 49}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 50}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 51}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 52}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 53}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 54}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 55}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 56}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 57}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 58}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 59}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 60}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 61}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 62}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 63}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 64}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 65}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 66}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 67}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 68}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 69}
\end{frame}
\begin{frame}[fragile,t]
\frametitle{frame 70}
\end{frame}
\end{document}
10
  • 1
    see the code from this question: tex.stackexchange.com/q/109748/36296 Jun 6, 2018 at 13:45
  • You don't need hyperref with beamer Jun 6, 2018 at 13:45
  • I have some 88 frames, when I used {multicols}{3}, it generated 3 columns, the first from frame 3-20, the second 25-42, the third 47-64; and the other frames are not displayed. I compiled the document 3 times.
    – Hany
    Jun 7, 2018 at 3:46
  • I used the multicol package with the code I posted, but I think that the problem is that the multicol package does not recognize the allowframebraks option in the frame definition. How can this be solved?
    – Hany
    Jun 7, 2018 at 7:18
  • 1
    You can manually insert a framebreak at the desired position, see this answer: tex.stackexchange.com/a/109795/36296 Jun 7, 2018 at 7:59

1 Answer 1

3

New answer

Adaptations

(in comparison to the old answer below)

Code

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{forloop}
\usepackage{multicol}
\usepackage{etoolbox}

\newif\ifframeinlbf
\frameinlbftrue
\makeatletter
\newcommand\listofframes{\@starttoc{lbf}}
\makeatother

\newcounter{lbfi}
\setcounter{lbfi}{0}
\addtobeamertemplate{frametitle}{}{%
    \ifframeinlbf%
        \ifnumequal{\value{lbfi}}{16}{%
            \setcounter{lbfi}{0}
            \addtocontents{lbf}{%
                \end{minipage}
            }%
        }{}%
        \ifnumequal{\value{lbfi}}{0}{%
            \addtocontents{lbf}{%
                \begin{minipage}{.49\textwidth}%
            }%
        }{}%
        %
        \addtocontents{lbf}{%
            \protect\makebox[2em][l]{%
                \protect\usebeamercolor[fg]{structure}\insertframenumber\hfill%
            }%
            \protect\hyperlink{page.\insertpagenumber}\insertframetitle\par%
        }%
        \stepcounter{lbfi}

    \else\fi%
}

\newcommand{\lbfend}{
    \addtocontents{lbf}{%
        \end{minipage}
    }%
}

\begin{document}
\frameinlbffalse
\begin{frame}[fragile,t,allowframebreaks]{List of Frames}
    \listofframes
\end{frame}
\frameinlbftrue

\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 40}{%
    \begin{frame}{Frame \arabic{ct}}
        frame \arabic{ct}
    \end{frame}
}

\begin{frame}{last}
    \lbfend% this command must be in the last frame
\end{frame}

\end{document}

Result

enter image description here

Original answer

  • You can use package multicol and than the multicols environment.
  • I used a loop to create the 20 test frames (package forloop)
  • I removed unused packages
  • (Does not work with texlive >=2022)

Code

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{forloop}
\usepackage{multicol}

\newif\ifframeinlbf
\frameinlbftrue
\makeatletter
\newcommand\listofframes{\@starttoc{lbf}}
\makeatother

\addtobeamertemplate{frametitle}{}{%
  \ifframeinlbf
  \addcontentsline{lbf}{section}{\protect\makebox[2em][l]{%
    \protect\usebeamercolor[fg]{structure}\insertframenumber\hfill}% 
  \protect\hyperlink{page.\insertpagenumber}\insertframetitle\par}
  \else\fi
}

\begin{document}
\frameinlbffalse
\begin{frame}[fragile,t,allowframebreaks]
    \frametitle{List of Frames}
    \begin{multicols}{2} % number of columns
    \listofframes
    \end{multicols}
\end{frame}
\frameinlbftrue

\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 21}%
{%
    \begin{frame}{Frame \arabic{ct}}
        frame \arabic{ct}
    \end{frame}
}

\end{document}

Result

enter image description here

8
  • 1
    I have some 88 frames, when I used forloop with {multicols}{3}, it generated 3 columns, the first from frame 3-20, the second 25-42, the third 47-64; and the other frames are not displayed
    – Hany
    Jun 7, 2018 at 3:38
  • 1
    no need to use the forloop package. The multicol package is sufficient, but it does not recognize the allowframebreaks option in the frame definition.
    – Hany
    Jun 7, 2018 at 7:15
  • I tried your code but got < Runaway argument? {\protect \makebox [2em][l]{\protect \usebeamercolor [fg]{structure}\insertfram enumber \ETC. ! Paragraph ended before \addcontentsline was complete.> ---> What to do ? Apr 26, 2023 at 5:36
  • @DuchampGérardH.E. I made a new answer, without that error.
    – dexteritas
    Apr 26, 2023 at 11:07
  • @Hany In the new answer there will be multiple frames for "List of Frames", if necessary. multicols does not work together with allowframebreaks. The forloop package is of course only for the example to create many frames automatically.
    – dexteritas
    Apr 26, 2023 at 11:09

You must log in to answer this question.

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