beamer add tag
JeT
**Context**

I have a course (`note.tex`) consisting in multiple chapters (each `\chapter` in `book`, corresponds to a `\lecture` in `beamer`, hence the reference to `beamerarticle` and frames in `MWE` ).

Thanks to great answers here https://topanswers.xyz/tex?q=1348 I can generate as many courses as I want, easily. 

I need to create a new syllabus for this new course.

**Question**

Since `note.toc` is already generated, i'd like to display in `syllabus.tex`, a subset (the chapters and sections, without page numbers) of the `note.toc` 

```
%------- `note.tex`------------------------
\documentclass[11pt]{book}
%\documentclass{beamer}
\usepackage[envcountsect]{beamerarticle}

\usetheme{Copenhagen}
\usecolortheme{crane}
\usepackage{hyperref}

\begin{filecontents}[overwrite]{Lecture1.tex}
\chapter{Lecture1}
\section{Section 1}
\subsection{Subsection 1a}
\subsection{Subsection 1b}
\subsection{Subsection 1c}
\section{Section 2}
\end{filecontents}

\begin{filecontents}[overwrite]{Lecture2.tex}
\chapter{Lecture2}
\section{Section 3}
\frame{}
\subsection{Subsection 3a}
\frame{}
\subsection{Subsection 3b}
\frame{}
\subsection{Subsection 3c}
\end{filecontents}

\begin{filecontents}[overwrite]{Lecture3.tex}
\chapter{Lecture3}
\section{Section 4}
\subsection{Subsection 4a}
\frame{}
\subsection{Subsection 4b}
\frame{}
\subsection{Subsection 4c}
\frame{}
\end{filecontents}

\begin{document}

\title{Notes for my course}
\maketitle
\tableofcontents

\input{Lecture1.tex}
\input{Lecture2.tex}
\input{Lecture3.tex}


\end{document}
```
Top Answer
samcarter
You can use the `tocloft` package to remove page numbers and dots and then input the `note.toc` file. If you do this inside a group, it won't disturb the rest of the document.

```
\documentclass[11pt]{book}

\usepackage{tocloft}
\newcounter{savetocdepth}

\begin{document}

\begingroup

  \makeatletter 
    \renewcommand{\cftsubsecpagefont}{\@gobble}
    \renewcommand{\cftsecpagefont}{\@gobble}
    \renewcommand{\cftchappagefont}{\@gobble}
    \renewcommand{\cftsecdotsep}{\cftnodots}
    \renewcommand{\cftsubsecdotsep}{\cftnodots}
    \setcounter{savetocdepth}{\value{tocdepth}}
    \setcounter{tocdepth}{1}
    \input{note.toc}
  \makeatother
  \setcounter{tocdepth}{\value{savetocdepth}}
\endgroup

\tableofcontents

\chapter{title}
\section{title}
\subsection{title}

test


\end{document}
```

![Screen Shot 2020-10-03 at 18.02.44.png](/image?hash=b2e84d73acd12c20ebe20efe1309315aa642ee34550e02ad619e6a311d879dbb)

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.