为什么当添加需要两页的长列表代码时,页码的位置会稍微移动?

为什么当添加需要两页的长列表代码时,页码的位置会稍微移动?

我注意到,每当我将源代码添加到我的 latex 文件时,添加代码的页面的编号看起来都会错位。我不知道列表配置中是否存在导致这种情况的原因,但这是我编写的配置:

\usepackage{listings}
\usepackage{color}
\lstdefinestyle{customc}{
    breaklines=true,
    language=C,
    showstringspaces=false,
    keywordstyle=\bfseries\color{blue},
    commentstyle={\color{green!40!black}},
    identifierstyle=\color{black},
}

通过使用列表命令(begin{lstlisting}),我根据这种代码样式在我的文件上编写代码。我上传了页码的图片: https://i.stack.imgur.com/i5aeh.png 是否有其他命令或行可以强制页码停留在线下?

非常感谢您的帮助

%==========Grundeinstellungen
\documentclass[ngerman,12pt,a4paper,oneside,listof=totoc,plainfootsepline]{scrbook}
\addtokomafont{disposition}{\rmfamily} 
\addtokomafont{captionlabel}{\bfseries}
\RedeclareSectionCommand[beforeskip=-.5\baselineskip,afterskip=.25\baselineskip]{subsubsection}

\include{Kapitel/Voreinstellungen}

%===========================================================================================
%===========================================================================================
%===========================================================================================
%==========Dokument
\begin{document}
\addtocontents{toc}{~\hfill\textbf{Seite}\par}
\renewcommand\contentsname{Inhaltsverzeichnis}

\tableofcontents
%\pagestyle{plain}

\listoffigures
\listoftables
\vspace{1cm}
\begingroup
\let\clearpage\relax
%\listofformels
\vspace{1cm}
...
\endgroup
\newpage
    
\pagenumbering{arabic}
\setcounter{page}{1}
....
\newpage    
\pagenumbering{Roman}
\setcounter{page}{12}
%\interlinepenalty 10000    
\bibliographystyle{unsrt}
\input{Kapitel/Hauptkapitel/Anhang}
\end{document}

相关内容