0

See attached gif

Conflict

You got any clues how to fix that? I’m using a Koma class.

3
  • 1
    There is probably some stretchable space after the heading. If you post an example code that reproduces this then someone will be able to show you how to remove it. However, removing stretchable spaces can make it difficult for TeX to find good page breaks. Commented Jun 19, 2016 at 9:52
  • 1
    You should post the example in the question, not in an answer. in any case, if the problem is the spacing in listings, you can load etoolbox and do \AtBeginEnvironment{listings}{\KOMAoptions{parskip=never}}.
    – Manuel
    Commented Jun 19, 2016 at 12:54
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document} Commented Jun 19, 2016 at 19:04

1 Answer 1

4

The log file contains a warning:

Class scrreprt Warning: \float@listhead detected!
(scrreprt)              Implementation of \float@listhead became
(scrreprt)              deprecated in KOMA-Script v3.01 2008/11/14 and
(scrreprt)              has been replaced by several more flexible
(scrreprt)              features of package `tocbasic`.
(scrreprt)              Maybe implementation of \float@listhead will
(scrreprt)              be removed from KOMA-Script soon.
(scrreprt)              Loading of package `scrhack' may help to
(scrreprt)              avoid this warning, if you are using a
(scrreprt)              a package that still implements the
(scrreprt)              deprecated \float@listhead interface  on input line 8.

If I change the code to include the suggested package, I get the expected result.

\documentclass[parskip]{scrreprt}

\usepackage{scrhack} %%% <---- ADDED
\usepackage{graphicx}           % benötigt für Grafiken
\usepackage{listings}

\begin{document}

\lstlistoflistings
\listoffigures

\clearpage

\begin{figure}[ht]
    \includegraphics[width=5cm]{_img/Link.png}
    \caption[Link]{Eine Beispielabbildung}
\end{figure}


\clearpage

\begin{lstlisting}[caption={Hello World}]
public class HelloWorld
{
    public static void main (String[] args)
    {
    // Prints Hello World!
        System.out.println("Hello World!");
    }
}
\end{lstlisting}

\end{document}

enter image description here

2
  • That nailed it. Dafuq is scrhack. I’ll study the doc... Thanks man.
    – Kalaschnik
    Commented Jun 19, 2016 at 13:42
  • Is there something to take care of when using scrhack package?
    – Kalaschnik
    Commented Jun 19, 2016 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .