![LoF、LoT、摘要、縮寫在目錄中未編號 - 為什麼?](https://rvso.com/image/305766/LoF%E3%80%81LoT%E3%80%81%E6%91%98%E8%A6%81%E3%80%81%E7%B8%AE%E5%AF%AB%E5%9C%A8%E7%9B%AE%E9%8C%84%E4%B8%AD%E6%9C%AA%E7%B7%A8%E8%99%9F%20-%20%E7%82%BA%E4%BB%80%E9%BA%BC%EF%BC%9F.png)
的解決方案是目錄中的 LOF+LOT+BIB,附編號章節在我的情況下不起作用。
誠然,我使用了其他人的模板 - 當我用他的程式碼產生 Pdf 時,所有上述部分都已編號。然而,當我產生代碼的 Pdf 時,這些部分仍然沒有編號 - 這是不想要的。有人可以幫我嗎?我懷疑依賴一些適得其反的用例
這是代碼:
\documentclass[10pt,a4paper,bibliography=totocnumbered,listof=totocnumbered]{scrartcl}
\usepackage[tocbibind]
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage[subfigure,titles]{tocloft}
\usepackage{caption}
\setcounter{tocdepth}{2}
\renewcommand\cftchapafterpnum{\vskip8pt}
\renewcommand\cftsecafterpnum{\vskip10pt}
\usepackage{listings}
\lstset{basicstyle=\footnotesize, captionpos=b, breaklines=true, showstringspaces=false, tabsize=2, frame=lines, numbers=left, numberstyle=\tiny, xleftmargin=3em, framexleftmargin=3.0em}
\makeatletter
\def\l@lstlisting#1#2{\@dottedtocline{1}{0em}{1em}{\hspace{2,0em} Lst. #1}{#2}}
\makeatother
\geometry{a4paper, top=28mm, left=31mm, right=28mm, bottom=26mm, headsep=4mm, footskip=4mm}
\begin{document}
\titlespacing{\section}{0pt}{12pt plus 4pt minus 2pt}{2pt plus 2pt minus 2pt}
\renewcommand{\contentsname}{II Contents}
\phantomsection
\addtocounter{section}{1}
\tableofcontents
\pagebreak
\listoffigures
\pagebreak
\listoftables
\pagebreak
\noindent\section{List of Acronyms}
\begin{acronym}
\setlength{\itemsep}{-\parsep}
\acro{CEO}{Chief Executive Officer}
\end{acronym}
\newpage
\setcounter{section}{0}
\renewcommand\refname{0. Introduction}
\section{{\Large Introduction}}
\markright{Introduction}
\phantomsection
\addcontentsline{toc}{section}{0. Introduction}
\addtocontents{toc}{\vspace{-0.5em}}
Lorem ipsum...
\newpage
\setcounter{section}{1}
\renewcommand\refname{Chapter 1}
\section*{{\Large Chapter 1}}
\markright{Chapter 1}
\phantomsection
\addcontentsline{toc}{section}{Chapter 1}
\addtocontents{toc}{\vspace{-0.5em}}
Lorem Ipsum again
\end{document}
答案1
不建議將tocbibind
、tocloft
、titlesec
和包與 KOMA 類別一起使用。fancyhdr
它們提供了標準類所缺少的功能。 KOMA-script 提供了這些功能,但它們被上述軟體包超越了。不使用它們是解決方案。
據稱,上述程式碼是在模板中找到的。該程式碼做了很多奇怪的事情,我無法建議任何人使用它。
小心,很多模板都是不好的。