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.

This is a continuation of my last (answered) question:

I want to style the Title of TOC, LOF and LOT exactly the same as the Sectioning-Titles. Problem is that they (a) start "higher" than normal \chapter-titles (means the space between "page head" and title body is smaller) and (b) the space between the title body and the titlerule is noticably varying.

Example (current progress):

\documentclass[twoside=false]{book}

\usepackage{tocloft}

        \usepackage[ngerman]{babel}             
        \usepackage[T1]{fontenc}
        \usepackage{lmodern}
        \usepackage[ansinew]{inputenc}      
        \usepackage{tgheros}                            
        \usepackage[expert]{mathdesign}     
        \usepackage{amssymb}                            
        \usepackage{ae,aecompl}                     
        \usepackage{charter}                            



%-------Styling of Titles-------%
\usepackage{titlesec}

\titleclass{\part}{top}
\titleclass{\chapter}{straight}

\titleformat{\part}[hang]
  {\usefont{T1}{qhv}{b}{n}\selectfont\huge\raggedright}{\thepart}
  {20pt}{\Huge}
\titleformat{\chapter}[hang]
  {\usefont{T1}{qhv}{b}{n}\selectfont\huge\raggedright}{\thechapter}
  {20pt}{\Huge}[\vskip8pt{\titlerule[1.5pt]}]

\titlespacing*{\part}
  {0pt}{50pt}{40pt}
\titlespacing*{\chapter}
  {0pt}{0pt}{20pt}

%--------------------------------%

%-------Styling of TOC-, LOT-, LOF-Titles-------------------------%
    \usepackage{tocloft}
%------ TOC ---------------------------------------%
        \renewcommand{\cfttoctitlefont}{\usefont{T1}{qhv}{b}{n}\selectfont\huge} 
                \addtolength{\cftbeforetoctitleskip}{4.0ex}
                \renewcommand{\cftaftertoctitle}{
    \vskip8pt{\titlerule[1.5pt]
    %           \vspace{4.5ex}
    %           \hrule height 1.5pt
    %           \vspace{-2.6ex
                }}
    %------LOF-----------%
        \renewcommand{\cftloftitlefont}{\usefont{T1}{qhv}{b}{n}\selectfont\huge}
                \addtolength{\cftbeforeloftitleskip}{4.0ex}
                \renewcommand{\cftafterloftitle}{
    \vskip8pt{\titlerule[1.5pt]
    %           \vspace{3.2ex} 
    %           \hrule height 1.5pt
    %           \vspace{-2.6ex
                }}
    %------LOT----------%       
        \renewcommand{\cftlottitlefont}{\usefont{T1}{qhv}{b}{n}\selectfont\huge} 
                \addtolength{\cftbeforelottitleskip}{4.2ex} % o,2 Differenz zu anderen beiden Überschriften ist seltsamerweise notwendig...
                \renewcommand{\cftafterlottitle}{
    \vskip8pt{\titlerule[1.5pt]
    %           \vspace{4.0ex}
    %           \hrule height 1.5pt
    %           \vspace{-2.6ex
                }}

    \begin{document}

        \newpage

    \tableofcontents

        \newpage

        \listoftables

        \newpage

        \listoffigures

        \newpage

\chapter{Test}

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus


        \begin{table}[bp]
            \centering
                %\begin{tabular}

                %\end{tabular}
            \caption{Testtable}
            \label{tab:Testtable}
        \end{table}


        \begin{figure}[bp]
            \centering
                %\includegraphics{}
            \caption{Testfigure}
            \label{testfigure}
        \end{figure}


    \end{document}
share|improve this question
1  
In an unmodified book class there is no special formatting for TOC titles, it simply explicitly calls \chapter*{\contentsname so any formatting set up for unnumbered chapters \chapter* should apply. If the packages you are loading are making that not true, perhaps they are not helping? –  David Carlisle Mar 8 '13 at 10:49
    
A justified question but I need the tocloft-package to modify the TOC-listings and the titlesec-package to modify the sectioning-titles. Is there a way to make this work? –  FLW Mar 8 '13 at 11:23
    
oh there's always a way to make things work, I don't know that package though:-) –  David Carlisle Mar 8 '13 at 11:26
    
Seems the tocloft-package is the cause. Perhaps I can substitute tocloft with titletoc - I'll try that, although judging from the documentation I'll probably open a new question for this, after trying my own skill. –  FLW Mar 8 '13 at 11:35

1 Answer 1

up vote 3 down vote accepted

You can simply use the titles package option for tocloft:

\usepackage[titles]{tocloft}

This option option causes the titles of the ToC, LoF, and LoT lists to be typeset using the modified titles. A complete example with your code:

\documentclass[twoside=false]{book}

\usepackage[titles]{tocloft}

        \usepackage[ngerman]{babel}             
        \usepackage[T1]{fontenc}
        \usepackage{lmodern}
        \usepackage[ansinew]{inputenc}      
        \usepackage{tgheros}                            
        \usepackage[expert]{mathdesign}     
        \usepackage{amssymb}                            
        \usepackage{ae,aecompl}                     
        \usepackage{charter}                            



%-------Styling of Titles-------%
\usepackage{titlesec}

\titleclass{\part}{top}
\titleclass{\chapter}{straight}

\titleformat{\part}[hang]
  {\usefont{T1}{qhv}{b}{n}\selectfont\huge\raggedright}{\thepart}
  {20pt}{\Huge}
\titleformat{\chapter}[hang]
  {\usefont{T1}{qhv}{b}{n}\selectfont\huge\raggedright}{\thechapter}
  {20pt}{\Huge}[\vskip8pt{\titlerule[1.5pt]}]

\titlespacing*{\part}
  {0pt}{50pt}{40pt}
\titlespacing*{\chapter}
  {0pt}{0pt}{20pt}


\begin{document}

        \newpage

    \tableofcontents

        \newpage

        \listoftables

        \newpage

        \listoffigures

        \newpage

\chapter{Test}

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus


        \begin{table}[bp]
            \centering
                %\begin{tabular}

                %\end{tabular}
            \caption{Testtable}
            \label{tab:Testtable}
        \end{table}


        \begin{figure}[bp]
            \centering
                %\includegraphics{}
            \caption{Testfigure}
            \label{testfigure}
        \end{figure}


\end{document}
share|improve this answer
1  
It's an unfortunate choice of tocloft to change by default the making of titles and to offer the titles option for avoiding it; the option name is misleading, at least. I'd much prefer the titles option switched to the modified titles. –  egreg Mar 8 '13 at 13:10
1  
@egreg yes, I agree. In my opinion, the default behaviour should be to honor possible modifications to the titles. –  Gonzalo Medina Mar 8 '13 at 13:13

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.