1

I have some problems with my TOC.

I would like to know if some of you could help to put "chapter" above "chapter name" as shown below:

enter image description here

If thats possible in TeX - and without \usepackage{tocloft}?

I appreciate any kind of help!

I have tried to put following code in preamble - without luck:

\usepackage{titletoc} 
\titlecontents{chapter} [1.5em] % ie, 1.5em (chapter) + 2.3em {} {\contentslabel{2.3em}} {\hspace*{-2.3em}} {} 
  • 1
    Can you please add a minimal example of code for us to play with? It's quite important to know what class you're using, for instance. – egreg Jun 18 '15 at 9:19
  • 1
    With titletoc (a member of the titlesec bundle), it should be easy. – Bernard Jun 18 '15 at 9:30
  • Hmm... It won't work. I might do something wrong: \usepackage{titletoc} \usepackage{titletoc} \titlecontents{chapter} [1.5em] % ie, 1.5em (chapter) + 2.3em {} {\contentslabel{2.3em}} {\hspace*{-2.3em}} {} – A. F. Jun 18 '15 at 12:07
  • Please don't post code in the comments, you know you can edit the question. – Johannes_B Jun 18 '15 at 12:46
  • Dear @Johannes_B. I am sorry, I was kind a frustrating, that it didn't work. I have now updated my post. Let me know, if I should add more information. Thank you! – A. F. Jun 18 '15 at 13:25
1

Is that OK? (I reused the code in my answer to your previous post, but modified the last parameter of \titlespacing):

\documentclass[11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{MinionPro}

\usepackage[english]{babel}

\usepackage[pagestyles ,newparttoc, explicit]{titlesec}%
\usepackage{titletoc}

\usepackage{microtype}
 \SetTracking[no ligatures = {f}]{encoding = *}{100}

\usepackage[explicit]{titlesec}
\titleformat{name=\chapter}[display]{ \figureversion{lining}\uppercase
\titleformat{name=\chapter, numberless}{\lsstyle\Large}{}{0pt}{\MakeUppercase{#1}}
\titlespacing*{\chapter}{0pt}{2.5ex}{6ex}

\titlecontents{chapter}[0em]{\large\bfseries\protect\addvspace{15pt}}%
{\textssc{\mdseries\MakeLowercase\chaptername~\scalebox{1}[1.333]{\thecontentslabel}}\\\medskip}
{}%
{\hfill\contentspage}%
\AtBeginDocument{\def\contentsname{table of contents}}

\begin{document}

\tableofcontents

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

\chapter{A first chapter}
\section{A nice little section}
\section{Another section}

\end{document}

enter image description here

  • How can I adjust the layout of the chapter's "number"? If I remove \bfseries, both bold at the number and text will be removed. Is there a way just to remove and change size of a number? Otherwise this i brilliant! THX once again! I owe you a beer :-) – A. F. Jun 18 '15 at 14:01
  • Last: If I have Appendix A, Appendix B and Appendix C. Would you use "\chapter*" or \appendix. I want "Appendix A" to be bold in TOC and the Appendix A's name, i.e. "Survey Example" to be normal text as above, but below Appendix A. If that makes sense. – A. F. Jun 18 '15 at 14:17
  • For the appendices, they're considered numbered chapters. I'll try to think of a solution. Concerning the layout of the chapter numbers in toc, if I understand well, you want them a little higher than the word chapter’? I solved it with a scalebox command, which allows for stretching in the vertical direction only (while changing fontsize stretches in both directions). See if you like it. – Bernard Jun 18 '15 at 14:22
  • Scalebox works well, but it aint possible just to choose a different font size for chapter "numbers"? Thank you regarding the appendices-problem! – A. F. Jun 19 '15 at 7:39
  • You can: in the code replace \scalebox{1}[1.333]{\thecontentslabel} with, say, {\Large\thecontentslabel} (the number will be a little smaller), or {\LARGE\thecontentslabel} (it will be a little bigger). Note this depends on the size chosen for the word ‘chapter’ (\large) so if you should decide tho change it, you'll have to change the size for the number too. Concerning the appendix problem, it's more tricky, because of the way the table of contents is built. I'll probably have to patch the \addcontentsline command to add an extra information – if it works… – Bernard Jun 19 '15 at 9:35
1

No need to load extra packages. Since classicthesis already loads tocloft, you can simply say

\renewcommand\cftchapaftersnumb{\par\noindent}
\makeatletter
\renewcommand\cftchappresnum{\textsc{\@chapapp~}}
\makeatother
\setlength\cftchapnumwidth{0pt}

A complete example:

\documentclass[hidelinks]{scrbook}
\usepackage{classicthesis}

\renewcommand\cftchapaftersnumb{\par\noindent}
\makeatletter
\renewcommand\cftchappresnum{\textsc{\small\@chapapp~}}
\makeatother
\setlength\cftchapnumwidth{0pt}

\begin{document}

\tableofcontents
\chapter{A test chapter}
\chapter{Another test chapter}
\chapter{Yet another test chapter}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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