# Remove first word from section title in ToC

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\begin{document}

\tableofcontents

\chapter{MyChapter}
\section{Term: Foo}
\section{foobar}
\section{Term: Bar}
\end{document}


Some of my section titles begin with a special word. In my example it is the text "Term: ". Of course this is part of the whole title. But I want them not appear in the ToC:

Current ToC:

1 MyChapter               3
1.1 Term: Foo ..........3
1.2 foobar .............3
1.3 Term: Bar ..........3


Expected ToC:

1 MyChapter               3
1.1 Foo ................3
1.2 foobar .............3
1.3 Bar ................3


Of course a solution that works other way round would be great too: If there is a solution that would add the "Term: " prefix to my section titles afterwards this could also work. But in this case it needs to be assured that only a few section titled have to be expanded.

you can simply do:

\section*{Term: Foo}                  % suppresses output in TOC


Edit: the code above also suppresses the numbering, which you probably don't want. So here's another suggestion to do it all with one command:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\newcommand{\customsec}[1]{\section[#1]{Term: #1}}

\begin{document}

\tableofcontents

\chapter{MyChapter}
\customsec{Foo}
\section{foobar}
\customsec{Bar}
\end{document}


• No a) This removes the numbering which is not acceptable and b) I am looking for a solution which does not need me to duplicate the headers if possible – S-Man Mar 7 '19 at 9:17
• @S-Man I added the option to do all in one command :) – Superuser27 Mar 7 '19 at 9:27
• Obviously you can call it whatever you want. If you want it also for subsections or chapters, or if you want some sections to have a different "term" you need to define separate commands. Enjoy! – Superuser27 Mar 7 '19 at 9:37
• Yes in fact I need if for the subsection. It works great. – S-Man Mar 7 '19 at 9:38

You can use short titles as optional argument in the \section command. This preserves numbering. MWE:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\begin{document}

\tableofcontents

\chapter{MyChapter}
\section[Foo]{Term: Foo}
\section{foobar}
\section[Bar]{Term: Bar}
\end{document}


Result:

• Thanks. I didn't even know about it. – S-Man Mar 7 '19 at 9:25