目錄中的問題清單(清單清單)

目錄中的問題清單(清單清單)

我正在使用 Latex 編寫文檔。我的文件中有群組 pf 程式碼,我想在內容清單中顯示它。我設法做到了這一點,但我仍然有(內容)出現在(程式碼清單)之外的表格中。您可以在下面找到我使用過的內容:

\documentclass[11pt, oneside]{Thesis} % The default font size and one-sided printing (no margin offsets)
\begin{document}
\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages
\setstretch{1.3} % Line spacing of 1.3
\begin{titlepage}
\begin{center}
\lhead{\emph{Contents}} % Set the left side page header to "Contents"
\tableofcontents % Write out the Table of Contents
\lhead{\emph{List of Figures}} % Set the left side page header to "List of Figures"
\listoffigures % Write out the List of Figures
\lhead{\emph{List of Tables}} % Set the left side page header to "List of Tables"
\listoftables % Write out the List of Tables
\lhead{\emph{List of Listings}}
\addcontentsline{toc}{chapter}{Listings} %to show the listings as a chapter.
\lstlistoflistings
\end{center}
\end{titlepage}
\end{document} 

請幫我解決這個問題,因為我有提交文件的截止日期。

答案1

為了澄清更多,問題是:產生的清單清單包含在目錄中,如下所示內容代替房源清單。解決方案是:第一步是添加

\renewcommand\lstlistlistingname{List of Listings}

在序言中更改名稱內容房源清單,在文件內(在 之後\begin{document})只需包含

\addcontentsline{toc}{chapter}{\lstlistlistingname}{\lstlistoflistings}

在所需的位置。我希望答案有幫助。

相關內容