I have the following section title:

\subsection[Einfluss auf das Standardfranz.]{Einfluss auf das Standardfranzösisch}\label{standardFranz}

The text between the [...] is shorter, because I need a shorter title in the header of the page.

This works fine but I need the full section title to be in the table of contents. How can I achieve this? At the moment it takes the text between the [...] for the table of content but I want it to take the text between the {...}.

  • What \documentclass are you using? Are you using fancyhdr?
    – Werner
    Sep 20, 2016 at 19:15

2 Answers 2


You can momentarily avoid your \sectioning to set the usual \sectionmark and then set it yourself manually just after the section:

enter image description here


\newcommand{\gobble}[1]{}% Similar to \@gobble




{\let\sectionmark\gobble% Avoid setting \sectionmark
\section{A section}}% Set \section
\sectionmark{A different sectional heading}% Set actual mark


We group the placement of the \section together with a \gobble of the \sectionmark.

  • Now I got one problem. If I use \label{test} and later ~\ref{test} then the link works well, but the number of the chapter shown in the ref is in my case 2.6 but in real it is 2.7. Do you know how to fix that?
    – texNewbie
    Sep 21, 2016 at 19:06
  • 1
    @texNewbie: You should place \label{test} immediately after \section{..} and still within the group.
    – Werner
    Sep 21, 2016 at 19:11

This is one of the defects in the standard classes: in my opinion, the short title (optional argument to the sectional commands) should only be used for the headers, not for the table of contents.

Here's a set of patches for the standard classes (article, report and book). Other classes, such as memoir or KOMA have their own methods for solving the problem.

\usepackage{lipsum} % just for the example

% the following three lines only if the class is report or book
\patchcmd{\@chapter}{#1}{#2}{}{} % #1 is the optional argument
\patchcmd{\@chapter}{#1}{#2}{}{} % #2 is the mandatory argument
\patchcmd{\@sect}{\fi#7}{\fi#8}{}{} % #7 is the optional argument
\patchcmd{\@sect}{\fi#7}{\fi#8}{}{} % #8 is the mandatory argument



\chapter[Short chapter title]{A long long chapter title}

\section[Short title]{A long long section title}



Here is a picture of the TOC:

enter image description here

Here is a picture of the headers:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .