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 checked extensively the forum and the net in order to solve this seemingly simple problem, without success. I know that there are a lot of posts regarding this problem, but I was unable to find the one that was fitting my purpose.

I would like to add an extra line inside the List of Figures and Tables when switching from one chapter to another, when using the scrbook class of ClassicThesis.

So for example it should be:

  1. Figure 1.1
  2. Figure 1.2

  3. Figure 2.1

  4. Figure 3.1

while what I obtain now is:

  1. Figure 1.1
  2. Figure 1.2
  3. Figure 2.1
  4. Figure 3.1

Here is the MWE that reproduces my problem, with a possible solution that I took from here, which unfortunately doesn't work in my case:

\documentclass{scrbook}
\usepackage{classicthesis}
\usepackage{classicthesis-ldpkg}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}

\makeatletter
\let\my@chapter\@chapter
\renewcommand*{\@chapter}{%
  \addtocontents{lof}{\protect\addvspace{10pt}}%
  \my@chapter}
\makeatother

\listoffigures

\clearpage

\chapter{1}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig1}
\caption{Figure 1 of the chapter 1}
\end{figure}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig2}
\caption{Figure 2 of the chapter 1}
\end{figure}
1
\chapter{2}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig3}
\caption{Figure 1 of the chapter 2}
\end{figure}

\chapter{3}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig4}
\caption{Figure 1 of the chapter 3}
\end{figure}

\end{document}

Thanks for your kind help.

share|improve this question
3  
I think it's a bug of the package classicthesis. You should write an e-mail to the author. KOMA provides the option chapteratlists which is disabled. The package titlesec loaded by classicthesis provides the possibility by changing the command chaptertolists or the commmand \ttl@tocsep. Both fails. –  Marco Daniel Apr 7 '12 at 11:06
1  
Thanks for accepting my answer, but please also upvote it (this has to be done separately from accepting). Please consider also to upvote helpful answers to your other questions. –  lockstep Apr 7 '12 at 12:44
    
@MarcoDaniel: actually, I don't think it can be considered a bug. In the 2009 version of classicthesis, it was possible to activate the listsseparated option, whose aim was exactly to group the figures and tables related to the same chapter. This option was disabled in the 2011 version, because of some conflicts with other packges/options. @locktep: thanks for your suggestion. I upvoted your answer and I did the same with the ones that gave successful solutions to my previous questions. –  mp87 Apr 9 '12 at 9:44
add comment

1 Answer

up vote 9 down vote accepted

classicthesis adds a \deactivateaddvspace macro at the start the .lof file. This macro does exactly what its name suggests, and so your patch fails. Looking into the package code, this behaviour seems to be related to a listsseparated option (and associated boolean) that is set to false. I wasn't able to set it to true again, so here's a brute force method: Define a new macro \killdeactivateadddvspace that will cause \deactiveateaddvspace to do nothing, and add the former macro at the very start of the .lof file -- I've used the etoolbox package and its \AtEndPreamble macro to do so.

Notes: I didn't use the classicthesis-ldpkg package as it is not available at CTAN. Also, adding the demo option to the graphicx package makes it easier for helpers to test your code.

\documentclass{scrbook}
\usepackage{classicthesis}
%\usepackage{classicthesis-ldpkg}
\usepackage{subfig}
\usepackage[demo]{graphicx}

\usepackage{etoolbox}
\newcommand{\killdeactivateaddvspace}{\let\deactivateaddvspace\relax}
\AtEndPreamble{\addtocontents{lof}{\protect\killdeactivateaddvspace}}

\begin{document}

\listoffigures

\clearpage

\chapter{1}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig1}
\caption{Figure 1 of the chapter 1}
\end{figure}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig2}
\caption{Figure 2 of the chapter 1}
\end{figure}
1
\chapter{2}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig3}
\caption{Figure 1 of the chapter 2}
\end{figure}

\chapter{3}

\begin{figure}
\centering
\includegraphics[scale=.9]{fig4}
\caption{Figure 1 of the chapter 3}
\end{figure}

\end{document}

enter image description here

share|improve this answer
    
thank you very much for your help. I wasn't aware that classicthesis was loading a specific command to deactivate the spacing between one chapter and the other. Good to know! –  mp87 Apr 9 '12 at 9:37
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.