我终于在这里提出了自己的问题,因为我在网上搜索了 5 天之后确实找不到我的问题的答案:
由于某种原因,我的\lstlistoflistings
命令没有在 pdf 中产生任何输出。但是 .lol 文件确实有内容。
这是我的最小工作示例:
\documentclass[parskip=half,fontsize=11.5pt,a4wide,bibliography=totocnumbered,listof=totocnumbered]{scrartcl}
\usepackage{listings}
\usepackage[usenames,dvipsnames,table,xcdraw]{xcolor}
\definecolor{mGreen}{rgb}{0,0.6,0}
\definecolor{mGray}{rgb}{0.5,0.5,0.5}
\definecolor{mPurple}{rgb}{0.58,0,0.82}
\definecolor{backgroundColour}{rgb}{0.95,0.95,0.92}
\begin{document}
\lstdefinestyle{CStyle}{
backgroundcolor=\color{backgroundColour},
commentstyle=\color{mGreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{mGray},
stringstyle=\color{mPurple},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
language=C,
\vspace{1em}
\begin{lstlisting}[caption=Java-GUI Automatisierung Pseudocode, language=C, escapeinside={(*}{*)}, style=CStyle]
...
\end{lstlisting}
\vspace{1em}
\vspace{1em}
\begin{lstlisting}[caption={Java-\ac{GUI}: Speicher Aufräumen Pseudocode},label=cleanpseudo, language=C, escapeinside={(*}{*)}, style=CStyle]
...
\end{lstlisting}
\vspace{1em}
\vspace{1em}
\begin{lstlisting}[caption={Java-\ac{GUI}: Speicher aktuelle Simulation abbrechen Pseudocode},label=cancelpseudo, language=C, escapeinside={(*}{*)}, style=CStyle]
modbusConnect()
modbusWriteCancelCommand()
modbusDisconnect()
\end{lstlisting}
\vspace{1em}
\vspace{1em}
\begin{lstlisting}[caption={Java-\ac{GUI}: Speicher aktuelle Logdatei herunterladen Pseudocode},label=latestpseudo, language=C, escapeinside={(*}{*)}, style=CStyle]
...
\end{lstlisting}
\vspace{1em}
\pagebreak
\rhead{LISTINGS}
\lstlistoflistings
这将生成以下 .lol 文件:
\contentsline {lstlisting}{\numberline {1}Java-GUI Automatisierung Pseudocode}{29}{lstlisting.1}%
\contentsline {lstlisting}{\numberline {2}Java-GUI Speicher Aufräumen Pseudocode}{30}{lstlisting.2}%
\contentsline {lstlisting}{\numberline {3}Java-GUI Speicher aktuelle Simulation abbrechen Pseudocode}{30}{lstlisting.3}%
\contentsline {lstlisting}{\numberline {4}Java-GUI Speicher aktuelle Logdatei herunterladen Pseudocode}{30}{lstlisting.4}%
但是我的列表页面是空的:
先感谢您!
更新:我创建了一个新的 Overleaf 项目,在这个项目中它也适用于我。我注意到 .lol 文件有差异,也许这就是原因?我主项目中的原始 lol 文件以 结尾,{lstlisting.x}
而新文件如下所示:
\contentsline {lstlisting}{\numberline {2}Java-GUI: Speicher Aufräumen Pseudocode}{1}{}%
\contentsline {lstlisting}{\numberline {3}Java-GUI: Speicher aktuelle Simulation abbrechen Pseudocode}{1}{}%
\contentsline {lstlisting}{\numberline {4}Java-GUI: Speicher aktuelle Logdatei herunterladen Pseudocode}{1}{}%```