1

I want my List of Figures AND List of Tables to look kinda like this:

List of Figures

Chapter 1: Bla bla bla

1.1 Lorem ipsum

1.2 dfgr grgr grgr

1.3 fgog gofrg afe

Chapter 3: ROFL LOL MAO

3.1 fdef

3.2 dfd

3.4 df df d fd

You get the idea? If Chapter 2 do not contain figures, I do not want the headline of chapter 2 to be there.

I want the same for the List of Tables.

I once found something familiar on this site, but I cant find it right now. And as far as I can recall, that was only for the List of Figures

I'd be very grateful for all help!

\documentclass[a4paper, 12pt, twoside, dvipsnames,cmyk]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\listoffigures
\listoftables
\include{chapters/contents}
\end{document}

I'm using a lot of other packages, but I'm not sure if they are relevant?

ROLF
  • 1,296
  • 5
  • 15
  • 22
  • Hi and welcome, this is dependant on the class in use. The KOMA-classes scrbook and scrreprt have a simple option for that. But without more information there is nothing much to do. – Johannes_B Nov 13 '14 at 09:40
  • I'm not using those. I'm new to LaTex, but maybe this will be of help:

    \documentclass[a4paper, 12pt, twoside, dvipsnames,cmyk]{report}

    What else do you need?

    – ROLF Nov 13 '14 at 09:48
  • Please follow the link in my first comment and add the information to the question. The button to edit is left to your name and user picture. – Johannes_B Nov 13 '14 at 09:52
  • Done :). Anything else you need? – ROLF Nov 13 '14 at 09:56
  • The KOMA classes will write every chapter to the lists if asked, this can be seen either as a sign of consistency (how does it look if one list contains chapters 3, 4 and 9; and another list chapter 5, 6 and 9?) but on the other hand, when starting a new chapter, there is no way to know if a figure will be typeset. You would need a hack that writes a toggle for every chapter to a auxiliary file reading it back on the next run. – Johannes_B Nov 13 '14 at 14:06
  • What you want to do can be done automatically; some time ago I provided a solution in my answer to http://tex.stackexchange.com/q/52746/3954. – Gonzalo Medina Nov 13 '14 at 16:09
  • @Johannes_B what is the simple option for scrreprt? Thanks in advance – riddleculous Mar 28 '16 at 23:59
  • @riddleculous To do what? – Johannes_B Mar 29 '16 at 05:56
  • @Johannes_B: in your first comment you mentioned that there is an option in KOMA Script for doing what was asked in the question (sorting the list of figures/tables by the chapters). – riddleculous Mar 29 '16 at 10:09
  • 1
    @riddleculous listof=chapterentry – Johannes_B Mar 29 '16 at 17:08
  • @Johannes_B: thanks! Unfortunately, it lists chapters without any figure/table, too. – riddleculous Mar 29 '16 at 19:24
  • @riddleculous Yes, as written in the manual. If you have chapter 3, 7 and 11 with figures, it will look like Freddy Kruger was at work and took something. Horrible. – Johannes_B Mar 29 '16 at 20:14

1 Answers1

1

You have to manually add chapters' entries you need. It's done like that:

\addcontentsline{lof}{chapter}{My chapter with Figures}
\addcontentsline{lot}{chapter}{My chapter with Tables}

so in your code:

\documentclass{report}

\begin{document}

\chapter{My chapter with Figures and Tables}
\addcontentsline{lof}{chapter}{My chapter with Figures and Tables}
\addcontentsline{lot}{chapter}{My chapter with Figures and Tables}
This chapter contains Figures and Tables

\chapter{My chapter with Tables}
\addcontentsline{lot}{chapter}{My chapter with Tables}
This chapter contains Tables

\chapter{My chapter with Figures}
\addcontentsline{lof}{chapter}{My chapter with Figures}
This chapter contains Figures

\listoftables
\listoffigures

\end{document}
RicoRally
  • 1,252
  • Yes, that'll work :). I combined it with some referencing and larger font:

    '\addcontentsline{lof}{chapter}{{\large Chapter \ref{sec:

    This is working, and I dont have too many chapters. However, it should be possible to do this in another way, so that I dont have to paste it in the beginning of every chapter?

    – ROLF Nov 13 '14 at 10:49
  • Maybe scrreprt class can help you. But I'm not sure. Try a search here: http://ftp.oleane.net/pub/CTAN/macros/latex/contrib/koma-script/doc/scrguien.pdf – RicoRally Nov 13 '14 at 11:10