# \section*[toc]{normal section title} not working for me

for my thesis I want to have a section appear differently in the ToC than in the text.

After googling a bit, I found \section[short]{long} as a proposed answer, but this does not seem to work for me.

Here is a MnotWE:

\documentclass[12pt,a4paper,reqno]{amsbook}
\usepackage{fontspec}
\setmainfont[SlantedFont={Latin Modern Roman Slanted},
SmallCapsFont = {Latin Modern Roman Caps},
]{Latin Modern Roman}

\usepackage[activate=true,nocompatibility},final,tracking=true,factor=1100,stretch=10,shrink=10]{microtype}

\usepackage[bindingoffset=1cm]{geometry}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\usepackage{csquotes}

\title{\textsc{Some Title}}
\author{me}

\begin{document}
\maketitle
\frontmatter
\tableofcontents
\mainmatter

\part[toc part]{normal part}
\section*[toc section]{normal section}
some text

\end{document}


It just takes "toc part" as normal and as ToC heading for the \part command.

For the section I am interested in the starred version. Here the [toc section] part of the command seems to be completely ignored.

I use LuaLaTeX to build my document. Does anyone have a suggestion how to get a \section* appear with a different title in the ToC?

• although the answer to the question linked by @LaRiFaRi does work, that technique is outmoded; the answer given below by egreg is the recommended method now. (i'll add a link to the old question to point here.) – barbara beeton Feb 19 '16 at 17:09

## 2 Answers

The AMS classes use a different method for changing the title in the TOC; here's an example, which can be used in all sectional titles (including \part, but for that the usual method works too).

It can be summarized in this way:

\documentclass[12pt,a4paper,reqno]{amsbook}

\begin{document}

\frontmatter
\tableofcontents
\mainmatter

\part{%
\for{toc}{toc part}\except{toc}{normal part}%
}

\chapter[This will go in the running head]{%
\for{toc}{toc chapter}\except{toc}{normal chapter}%
}

\section*[sec]{\for{toc}{toc section}\except{toc}{normal section}}

some text

\clearpage
\mbox{}
\clearpage
\mbox{}

\end{document}


The tricks with \for and \except are thought for adding appropriate line break points, which might be different in the body or in the TOC.

Here is the Contents page

Here is the chapter page

• For me the '\part[tocpart]{normalpart}' does not work, it shows tocpart in both cases. However the '\for' and \except’ commands do the job. – MarkusParker Feb 19 '16 at 16:50
• @MarkusParker My bad, I didn't check carefully. – egreg Feb 19 '16 at 16:54
• Can \for and \except be used without AMS classes? – Alexey Sep 8 '16 at 17:42
• @Alexey No, they can't unless you borrow the infrastructure. – egreg Sep 8 '16 at 18:08

This is documented behaviour for amsbook, see instr-l.pdf page 13:

Unlike the LaTeX book class, the AMS document classes will place entries for unnumbered chapters in the table of contents, as required by AMS style.

and a little further down

If the chapter title is too long to fit as a running head, a shortened form can be supplied in a similar way. Full chapter titles and section headings will be used in the table of contents (this is different from basic LaTeX)

So with \section[optional]{mandatory}, optional will only affect the running header, not the TOC.

On TeX Live this manual can be found via texdoc amsbook

• Thanks, good to know. Is there some way to change this behavior within amsbook or do I have to change to a different document class? – MarkusParker Feb 19 '16 at 16:14
• amsbook is specifically made for AMS books etc, if you have other needs, it might be better to use a different class. I have not looked into the details of that it takes to make it "normal", might be easy, might be hairy. – daleif Feb 19 '16 at 16:22
• Also see the item LaRiFaRi links to – daleif Feb 19 '16 at 16:23
• unfortunately, the file instr-l is completely outdated, but not yet removed from ctan and tex live. it has been superseded by the "ams author handbook" which comes in several variations, depending on category of the publication (journal article, monograph, etc.). on p.14 of the monograph version, the available mechanism is shown for providing different versions of various kinds of header text for headings and the contents list. – barbara beeton Feb 19 '16 at 16:44