![为什么当添加需要两页的长列表代码时,页码的位置会稍微移动?](https://linux22.com/image/439310/%E4%B8%BA%E4%BB%80%E4%B9%88%E5%BD%93%E6%B7%BB%E5%8A%A0%E9%9C%80%E8%A6%81%E4%B8%A4%E9%A1%B5%E7%9A%84%E9%95%BF%E5%88%97%E8%A1%A8%E4%BB%A3%E7%A0%81%E6%97%B6%EF%BC%8C%E9%A1%B5%E7%A0%81%E7%9A%84%E4%BD%8D%E7%BD%AE%E4%BC%9A%E7%A8%8D%E5%BE%AE%E7%A7%BB%E5%8A%A8%EF%BC%9F.png)
我注意到,每当我将源代码添加到我的 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}