In a beamer document, I am trying to customize a table of contents with pausesections and \addcontentsline, (see my previous questions first and second). You may see how the added toc items get repeated out of place. Your help is appreciated.
\documentclass{beamer}
\usetheme{Antibes}
\usecolortheme{seahorse}
\useoutertheme{tree}
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{navigation symbols}{}
\begin{document}
\begin{frame}[t]
\frametitle{Index}
\tableofcontents[pausesections, pausesubsections,sections={-1}]
\end{frame}
\begin{frame}[t,noframenumbering]
\frametitle{Index}
\tableofcontents[pausesections, pausesubsections,sections={2-2}]
\end{frame}
\begin{frame}[t,noframenumbering]
\frametitle{Index}
\tableofcontents[pausesections, pausesubsections,sections={3-3}]
\end{frame}
\begin{frame}[t,noframenumbering]
\frametitle{Index}
\tableofcontents[pausesections, pausesubsections,sections={4-}]
\end{frame}
\begin{frame}
\section{section one \& A}
\end{frame}
\begin{frame}
\subsection{subsection one}
\addcontentsline{toc}{subsection}{\hskip5ex line added to TOC: AAA \par}
\end{frame}
\begin{frame}
\subsection{subsection two}
\addcontentsline{toc}{subsection}{\hskip5ex line added to TOC: BBB \par}
\addcontentsline{toc}{subsection}{\hskip5ex line added to TOC: CCC \par}
\end{frame}
\begin{frame}
\subsubsection{subsubsection after addcontentsline: three}
LAST
\end{frame}
\section{B} B
\subsection{1} B1
\subsection{2} B2
\subsection{3} B3
\subsection{4} B4
\section{C}
\subsection{1} C1
\subsection{2} C2
\subsection{3} C3
\subsection{4}
\subsection{5}
\subsection{6}
\subsection{7}
\subsection{8}
\subsection{9}
\subsection{10}
\subsection{11}
\subsection{12}
\subsection{13}
\subsection{14}
\subsection{15}
\subsection{16}
\section{D}
\subsection{1}
\subsection{2}
\subsection{3}
\subsection{4}
\section{E}
\end{document}


\@writefile{toc}{\beamer@subsectionintoc {1}{1}{subsection one}{34}{0}{1}}vs\@writefile{toc}{\contentsline {subsection}{\hskip 5ex line added to TOC: AAA}{34}{}\protected@file@percent }– John Kormylo Aug 22 '23 at 19:09