1

I'm trying to get a frame list containing frames that I select adding \frameintoc after frame environment begin. I Used [List of frames with beamer]Is there any way to produce List of frames with beamer?. My MWE is here:

\makeatletter%
\let\@starttocorig\@starttoc
\makeatother%%
\documentclass[fleqn,calc,xcolor={usenames}]{beamer}
\usepackage{calc,bookmark}
\definecolor{todo}{rgb}{0.75, 0.0, 0.2}
\makeatletter
\newcommand{\linkdest}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
\makeatother
%%% COUNTERS
\newcounter{todokey}%
\newcommand\todo[2][todo-\thetodokey]{%todo
    \addtocounter{todokey}{1}
    \noindent{%
        \color{todo}{#2}%
    }%
    \phantomsection% comment out if hyperref is not used
    \linkdest{#1}%
   \addcontentsline{todo-\thepart}{subsubsection}{\textbullet\protect\hyperlink{#1}{#2}\hspace{1mm}}%
    %\addcontentsline{todo-\thepart}{subsubsection}{todo}
}
 \makeatletter
\newcommand{\listoftodosbasic}{%listoftodos
    \@starttocorig{todo-\thepart}
}
\newcommand\listtodosname{TODO}%listoftodo
\newcommand\listoftodos{%
\listtodosname\phantomsection: 

\listoftodosbasic}

%%frameintoc
\makeatletter
\newcommand\listofframesbasic{\@starttoc{cherryframes}}%%frameintoc cherrry
\makeatother
\newcommand\listofframesname{Important frames}
\newcommand\listofframes{\listofframesname: \listofframesbasic}
\newcommand\frameintoc{%
    \def\boolframeintoc{1}
%\phantomsection\linkdest{frametarget-\insertframenumber}%
%\addcontentsline{section}{makebox[2em][l]{hyperlink{frametarget-insertframenumber}{insertframenumber}hfill}hyperlink{frametarget-insertframenumber}{insertframetitle}par}%
}%
\makeatletter
\addtobeamertemplate{frametitle}{}{%
    \mode<presentation>{%
        \only<1>{%
            \hypertarget{\insertframetitle}{}%
            %\ifx\beamer@shortframetitle\beamer@frametitle
                %\ifx\boolframeintoc1%
                    %frametitle - prioritate 3
                    %\addcontentsline{cherryframes}{section}{\protect\makebox[2em][l]{\scriptsize\insertframenumber\hfill}\insertframetitle\par}%
            %\fi
        }%
    }%
\def\boolframeintoc{0}
}
\makeatother 
\title{problem setting length block?}
\begin{document}
\begin{frame}
  \titlepage
\end{frame}
\begin{frame}{list of todo}
    \listoftodos
\end{frame}
\begin{frame}[fragile]{list of frames}
    \listofframes
\end{frame}
\begin{frame}[allowframebreaks,fragile]{one frame}\frameintoc
    \begin{block}{block 1}
check

this\todo{ad}, sjdsndns\todo{cawwo}


frame: \todo{889665}

\begin{align}
    &a+rt+6+44\label{oh}\\
    &r=0
\end{align}
    \end{block}
\end{frame}
\begin{frame}[allowframebreaks,fragile]{two frame}\frameintoc
    \begin{block}{block 1}
check

this\todo{ad}, sjdsndns\todo{cawwo}


frame: \todo{889665}

\begin{align}
    &a+rt+6+44\label{oh}\\
    &r=0
\end{align}
    \end{block}
\end{frame}
\end{document}

I get an error for \only<1>: Argument of \beamer@@@only has an extra }; and one error for \addcontentsline: Paragraph ended before \addcontentsline was complete. I've also tried to not use \addtobeamertemplate but can't make addcontentsline working when used inside \newcommand. Any suggestions? Thankyou for attention and best regards.

Update

Running the code in the answer of Is there any way to produce List of frames with beamer? result in the error: Paragraph ended before \addcontentsline was complete. error| Extra }, or forgotten \endgroup.; while same code compile without error on overleaf using TeXLive 2021. I'm running pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian).

Update two

Part of the problem seems related to use of allowframebreaks that causes the difference between first and second line in the toc file output.cherryframes:

\contentsline {section}{\makebox [1em][l]{\normalsize 4\hfill }\normalsize {one frame\relax {} \let \reserved@d = *\def \par }\par } 
\contentsline {section}{\makebox [1em][l]{\normalsize 5\hfill }\normalsize {two frame}\par 

where the frame titled "one frame" has the argument allowframebreaks. I'll try the makerobust pkg. There could be problems related also to \ifx usage.

1 Answer 1

1

It seems there were two problems:

  1. use of allowframebreaks for frame to be added in the list of frames
  2. Automatically Reset \boolframeintoc to zero after being set to one by \frameintocdo not work

In the code below the first problem is solved using package makerobust, the second using the approach of Is there any way to produce List of frames with beamer? (ie \newif):

\makeatletter%
\let\@starttocorig\@starttoc
\makeatother%%
\documentclass[fleqn,calc,xcolor={usenames}]{beamer}
\usepackage{calc,bookmark,trace}
\definecolor{todo}{rgb}{0.75, 0.0, 0.2}
\usepackage{makerobust}
\MakeRobustCommand\usebeamertemplate
\makeatletter
\newcommand{\linkdest}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
\makeatother
%%% COUNTERS
\newcounter{todokey}%
\newcommand\todo[2][todo-\thetodokey]{%todo
\addtocounter{todokey}{1}
\noindent{%
    \color{todo}{#2}%
}%
\phantomsection% comment out if hyperref is not used
\linkdest{#1}%
\addcontentsline{todo-\thepart}{subsubsection}{\textbullet\protect\hyperlink{#1}{#2}\hspace{1mm}}%
%\addcontentsline{todo-\thepart}{subsubsection}{ todo}
}
\makeatletter
\newcommand{\listoftodosbasic}{%listoftodos
\@starttocorig{todo-\thepart}
}
\makeatother
\newcommand\listtodosname{TODO}%listoftodo
\newcommand\listoftodos{%
\listtodosname\phantomsection: 
\listoftodosbasic}
\makeatletter
\newif\ifframeinlbf
\frameinlbftrue
\newcommand\listofframes{\@starttocorig{cherryframes}}
\makeatother
\addtobeamertemplate{frametitle}{%\protect\insertframenumber:
\ifframeinlbf
\mode<presentation>{%
\only<1>{%
\hypertarget{\protect\insertframetitle}{}%
\addcontentsline{cherryframes}{section}{%
\protect\makebox[1em][l]{\normalsize\insertframenumber\hfill}\normalsize\insertframetitle%}%
}%
}%
\else\fi}%
{}%
\title{problem setting length block?}
\begin{document}
\frameinlbffalse
\begin{frame}
\titlepage
\end{frame}
\begin{frame}[fragile]{list of todo}
\listoftodos
\end{frame}
\begin{frame}[allowframebreaks,fragile]{list of frames}
\listofframes
\end{frame}
\frameinlbftrue
\begin{frame}[fragile]{one frame}
\begin{block}{block 1}
check
this\todo{ad}, sjdsndns\todo{cawwo}
frame: \todo{889665}
\begin{align}
&a+rt+6+44\label{oh}\\
&r=0
\end{align}
\end{block}
\end{frame}
\frameinlbftrue
\begin{frame}[fragile,allowframebreaks]{two frame}
\begin{block}{block 1}
check
this\todo{ad}, sjdsndns\todo{cawwo}
frame: \todo{889665}
\begin{align}
&a+rt+6+44\label{oh}\\
&r=0
\end{align}
\end{block}
\end{frame}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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