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.

I would like to \flushright the toc's and bibliography's title, but the font size and spaces above and below should be the same as for regular chapters.

Here is what I did:

\documentclass{report}
\usepackage{titlesec}
\usepackage[titles]{tocloft}

\titlespacing*{\chapter}{0pt}{-20pt}{20pt}
\titleformat{\chapter}{\Large\bfseries}{}{0pt}{}{}

\begin{document}

{\titleformat{\chapter}{\Large\bfseries}{}{0pt}{\flushright}{}\tableofcontents}
\chapter{First line of title\\second line of title}

\end{document}

There are two issues I cannot solve:

  1. The toc's title is aligned with the second line of the chapter's title, and I would like it to be so with the first
  2. A minor issue, but when calling the scope limited \titleformat I have to redefine the title's format, can that be avoided?
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I can't understand what you mean with point 1. However, \flushright is wrong:

{\titleformat{\chapter}{\Large\bfseries}{}{0pt}{\raggedleft}{}\tableofcontents}

won't add vertical space.

You can redefine \tableofcontents:

\let\origtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{%
  \begingroup 
  \titleformat{\chapter}
              {\Large\bfseries}
              {}
              {0pt}
              {\raggedleft}
              {}%
  \origtableofcontents
  \endgroup}

so that issuing \tableofcontents will be enough.

share|improve this answer
    
\raggedleft does the trick. What I meant was that the space below the toc's title was the same as the space below the second line of the title and consequently the space above 'Contents' was large than the space above the chapter's title's first line. –  D.Roepo Mar 28 '12 at 9:59
    
@Mico Thanks for having fixed the error –  egreg Mar 28 '12 at 11:38
add comment

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.