图表列表和清单列表之间的间距差异

图表列表和清单列表之间的间距差异

请参阅附件 gif

冲突

您知道如何解决这个问题吗?我正在使用 Koma 类。

答案1

日志文件包含一条警告:

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.

如果我更改代码以包含建议的包,我就会得到预期的结果。

\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}

在此处输入图片描述

相关内容