TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a previous question I asked about customizing my table of contents. For now, I have decided to fill the table of contents simply like this for each article:

\addtocontents{toc}{\hspace{1cm} \Title \dotfill \pageref{firstpage}–\pageref{lastpage}\\}

But I still have no clue how to indent the line(s) containing the title (if the title extends over more than one line, all lines should be indented by the same amount):

=== Author's Name ===

    === Title: 1st Line ===
    === Title: 2nd Line ===

Is there a simple solution?

share|improve this question
Instead of adding "(2)" to denote a follow-up question, I have made the question title more specific (and changed some tags). I hope you don't mind. – lockstep Jan 4 '12 at 13:15
up vote 2 down vote accepted

Here is an example inspired of a few internal memoir macros, should work with any class:

\newcommand\Title{This is a very long and complicated title that spans
several lines going on and on}
\newcommand\formatauthor[1]{\noindent \textit{#1}\par}
  \textit{Title:}~{#1}\dotfill\hbox to 4em{\hfil #2}\par%


\AuthorInToc{An Author}

The idea is to remember that each entry in the TOC is actually a paragraph by it self, so treat it like that.

share|improve this answer

Your Answer


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.