Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Title in mainmatter (long title):


Sec.1 The introduction of TEX --- A powerful typsetting system

blabla...

Sec.2 installation

blabla...


Title in TOC (short title, line break before em dsah):


Sec.1  TEX
       --- A typsetting system ....................... 1

Sec.2  Installation .................................. 2

Title in header (short title):


Sec.1 TEX --- A typesetting system


share|improve this question
4  
It depends on the class you are using. For example, memoir provides two optional arguments to \section just to distinguish among the actual title, the short title for the toc and the short title for the header. –  egreg May 23 '11 at 8:41

1 Answer 1

In the article document class you can use the optional argument of \section to change the entry in the ToC; this change will also affect the header, but using \markright you can control header; the following example illustrates this:

\documentclass{article}
\usepackage{lipsum}% just to generate filler text

\pagestyle{headings}

\begin{document}
\tableofcontents

\section[\TeX\\--- A typsetting system]{The introduction of \TeX ---A powerful typsetting system}
\markright{Section \thesection. \TeX ---A typsetting system}
\lipsum[1-20]

\end{document}

The memoir document class offers two optional arguments for the \section command; the first one will control the ToC entry, and the second one will control the header; a little example:

\documentclass{memoir}
\usepackage{lipsum}% just to generate filler text

\pagestyle{headings}

\begin{document}
\tableofcontents

\section[\TeX\\--- A typsetting system][\TeX ---A typsetting system]{The introduction of \TeX ---A powerful typsetting system}
\lipsum[1-20]

\end{document}
share|improve this answer
    
Nice solution, Thanks. –  dearmath May 23 '11 at 15:26
    
@dearmath: Since my answer seems to answer your question, please consider marking it as ‘Accepted’ by clicking on the tickmark below the vote count. –  Gonzalo Medina May 23 '11 at 16:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.