1

I'm writing my thesis with classic thesis. It is possible to include the title of the chapter, but only when figure are present therein to the lof?

The use of listof = chapterentry in the option to KOMA also include chapters without figures, and I would avoid these.

Thank you!!

MWE

\documentclass[10pt, a4paper, twoside, openright, titlepage, fleqn, headinclude, footinclude, BCOR5mm, numbers=noenddot, cleardoublepage=empty, 
listof = withchapterentry]{scrbook}
%classic thesis template
\usepackage[eulerchapternumbers, eulermath, pdfspacing, listings, floatperchapter,parts]{classicthesis}
\begin{document}
\listoffigures
\chapter{Introduction with no Figures}

\chapter{Test Chapter with Figures}
\begin{figure}
\caption{caption text}
\end{figure}
\begin{figure}
\caption{caption text}
\end{figure}

\chapter{Test Chapter with no Figures}

\chapter{Another Test Chapter with Figures}
\begin{figure}
\caption{caption text}
\end{figure}

\end{document}

As you can see in the picture introduction and chapter one are also listed but contain no figures. I would avoid listing chapter without figures.

enter image description here

  • Could you please post a minimal compilable document? It will save us a lot of time and avoids wrong guesses on our side. Thank you. – LaRiFaRi Sep 26 '14 at 15:00
  • @LaRiFaRi You have perfectly reason. I added it. Thank you – BBrill Sep 26 '14 at 15:11
  • 1
    One way would be to remove the listof=chapterentry and write the corresponding records to the lof ONLY for the chapters with figures. Another would be to modify the \listoffigures command to ignore a \contentsline{chapterenty}... if it is followed by another. – John Kormylo Sep 26 '14 at 16:20
  • @JohnKormylo Thank you this is a possible solution, and a good starting point for further tuning! – BBrill Sep 26 '14 at 16:41
  • @JohnKormylo I can't believe I didn't thought at it! :) – BBrill Sep 26 '14 at 16:42
2

tof

\documentclass[10pt, a4paper, twoside, openright, titlepage, fleqn, headinclude, footinclude, BCOR5mm, numbers=noenddot, cleardoublepage=emptyast]{scrbook}
%classic thesis template
\usepackage[eulerchapternumbers, eulermath, pdfspacing, listings, floatperchapter,parts]{classicthesis}

\makeatletter
\newcommand{\chapterwithfigures}{\addxcontentsline{lof}{chapteratlist}[{\thechapter}]{\scr@ds@tocentry}}%
\makeatother

\begin{document}
\listoffigures
\chapter{Introduction with no Figures}

\chapter{Test Chapter with Figures}
\chapterwithfigures
\begin{figure}
\caption{caption text}
\end{figure}
\begin{figure}
\caption{caption text}
\end{figure}

\chapter{Test Chapter with no Figures}

\chapter{Another Test Chapter with Figures}
\chapterwithfigures
\begin{figure}
\caption{caption text}
\end{figure}

\end{document}

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.