I am currently using the scrreprt documentclass for my reports. With my current template the List of Figures and List of Listings are shown on two subsequent pages. I realized that the heading "List of Figures" and the heading "List of Listings" are not on the same height on the page.

Is there either a way to change the margins for the \lstlistoflistings heading or change all the other headings to the same value?

problematic set

My current source:

\renewcommand\lstlistlistingname{List of Listings}





% Document body
\pagenumbering{arabic}        % Set numbering back to arabic numbers

  \caption{System response comparison}


\begin{lstlisting}[language=python, caption=\protect\detokenize{Example python listing}]
class GumnutDecoder:
    def __init__(self):
        self.PC = 0

  • Welcome, can you show us the behaviour with actual code? There could be thousands of ways an incompatible package (you did mention template) hacks base functionality to dead. – Johannes_B Oct 15 '15 at 16:25
  • tocloft i knew it right from the start. Kick it out. – Johannes_B Oct 15 '15 at 16:51
  • @Johannes_B I updated my initial post. I just said template because I am using a set of scripts and pandoc to generate LaTeX code from Markdown. This code is then inserted in my template. – Benni Oct 15 '15 at 16:52
  • @Johannes_B Oh my god. I don't know how many hours I have wasted over time trying to fix this problem. But for my thesis it itched me just a bit too much to ignore. Is there any other package capable of changing settings like secnumdepth, etc.? – Benni Oct 15 '15 at 16:55
  • You don't need any package to change that. By the way, check your regular chapters to see, that the toc, lof, and lot are the ones sticking out. – Johannes_B Oct 15 '15 at 16:57

KOMA-script uses packge tocbasic to deal with lists of stuff. There are a lot of options to modify the behaviour of those lists.
Unfortunately, package tocloft doesn't care, it provides its own redefinitions of the lists for own purposes, mainly to change the appearance and behaviour for the standard classes.
Since KOMA has everything prepacked and on board to do the same as package tocloft, you can omit it. Once tat is done, you can also remove those \clearpages, as by default, each list starts with a new chapter.

secnumdepth and tocdepth are counters provided by the LaTeX kernel, no need to add any package to change their value.

| improve this answer | |

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.