See attached gif
You got any clues how to fix that? I’m using a Koma class.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityThe 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}
TeX
to find good page breaks.etoolbox
and do\AtBeginEnvironment{listings}{\KOMAoptions{parskip=never}}
.\documentclass{...}
and ending with\end{document}