beamer add tag
JeT
Following a previous question regarding counters restarting after \lecture. https://topanswers.xyz/tex?q=1338

**My question**

How can we base the navigation TOC on lectures ?

![NavigationLectureToc.png](/image?hash=d91162c69183a053ae3e8c4b9a7db9046c9e32a591053762a4f461dd0fdb02cc)

**Related question**

It would probably solve another issue I have had to display the TOC for the lecture as below

![NavigationLectureToc2.png](/image?hash=2e40912e263427015b56e671759ae3ad79750d5e977d803e306a59b935d559ef)

MWE (based on SamCarter's answer)


```
\documentclass{beamer}
\usetheme{Copenhagen}


\makeatletter

\AtBeginLecture{
%-------   Restart section counter on Lecture ---------
\setbeamercolor{lecture in toc}{parent=structure}
  \addtocontents{toc}{%
    \protect\usebeamercolor[fg]{lecture in toc}%
    \vfill%
    \beamer@lecturename%
  }
  \beamer@tocsectionnumber=0
%-------   Lecture page ---------
	\begingroup% 
	\hsize\textwidth
	\columnwidth\textwidth
	\begin{frame}[plain]
		\begin{block}{}
			\begin{center}
				\vspace{1.5cm}
				\huge \textsc{Lecture}  \\
				\vspace{0.3cm}
				\Large \insertlecture%
				\vspace{1.5cm}
			\end{center}
		\end{block}
	\end{frame}
	
	\endgroup
}	
\makeatother


\title{Some Title}

\begin{document}

\lecture{Lecture1}{lec1}
\begin{frame}
  \tableofcontents
\end{frame}


\section{Section 1}
\subsection{Subsection 1a}
\frame{}
\subsection{Subsection 1b}
\frame{}
\subsection{Subsection 1c}
\frame{}

\section{Section 2}
\frame{}

\lecture{Lecture2}{lec2}
\section{Section 1}
\subsection{Subsection 1a}
\frame{}
\subsection{Subsection 1b}
\frame{}
\subsection{Subsection 1c}
\frame{}

\end{document}
```
Top Answer
samcarter
Splitting the headline navigation by lectures is actually quite tricky, so I suggest to use `\part` behind the scenes. To make sure this does not interfere with your usage of part in `beamerarticle`, one can differentiate them in different modes.

```
\documentclass{beamer}
\usetheme{Copenhagen}

\setbeamercolor{lecture in toc}{parent=structure}

\usepackage{pgffor}
\usepackage{totcount}
\regtotcounter{part}

\makeatletter
\AtBeginLecture{%
  \mode<beamer>{
    \part{\beamer@lecturename}
    \expandafter\NR@gettitle\expandafter{\beamer@lecturename}
    \label{part:\thelecture}
    \begin{frame}
        \begin{beamercolorbox}[sep=16pt,center]{part title}
          {\Large\textsc{Lecture}\par}
          {\large\insertpart\par}
        \end{beamercolorbox}
        \tableofcontents
    \end{frame}
  }
  \beamer@tocsectionnumber=0
}
\makeatother

\title{Some Title}

\begin{document}

\begin{frame}
  \tableofcontents
  \foreach\x in {1,...,\totvalue{part}}{%
      \vskip-0.4cm
      \protect\usebeamercolor[fg]{lecture in toc}%
      \vfill%
      \hyperlink{part:\x}{\nameref{part:\x}}%
      \tableofcontents[part=\x]%
  }%
\end{frame}

\lecture{Lecture1}{lec1}
\section{Section 1}
\subsection{Subsection 1a}
\frame{}
\subsection{Subsection 1b}
\frame{}
\subsection{Subsection 1c}
\frame{}

\mode<article>{\part{part for your book with beamerarticle}}

\section{Section 2}
\frame{}

\lecture{Lecture2}{lec2}
\section{Section 1}
\subsection{Subsection 1a}
\frame{}
\subsection{Subsection 1b}
\frame{}
\subsection{Subsection 1c}
\frame{}

\end{document}
```

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.