ToC 打乱了顺序和页码

ToC 打乱了顺序和页码

我的目录之前有 LoF 和 LoT。不知为何,目录将第 1 章放在 LoF 之前,尽管报告中的情况正好相反。页码错误,LoT 位于 iii,就在目录之后。

\documentclass[10 pt, a4paper, leqno, oneside] {report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lscape}
\usepackage{caption}
\usepackage{subfig}
\usepackage[section]{placeins}
\usepackage{listings}
\usepackage{url}
\usepackage{longtable}
\usepackage{multirow}
%\usepackage{geometry}
\usepackage{graphicx}
%\usepackage[export]{adjustbox}
\usepackage[table]{xcolor}
\usepackage[swedish, english]{babel}
\usepackage[tmargin=1cm]{geometry}
%\usepackage{blindtext}

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% The title page %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \input{titlepage}
 \cleardoublepage \pagenumbering {roman}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The Abstract Page %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{Abstract} 
\addcontentsline{toc}{chapter}{Abstract} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TOC %%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tableofcontents{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% List of Tables %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\include{ListofTables} 
\addcontentsline{toc}{chapter}{List of Tables} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% List of Figures %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\include{ListofFigures} 
\addcontentsline{toc}{chapter}{List of Figures} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chapters %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{page}{1}
\cleardoublepage \pagenumbering{arabic}
\include{chapter1}  %Background
\include{chapter2}  %Theory
\include{chapter3}  %Results
\include{chapter4}  %Analysis and conclusions
\include{chapter5}  %Discussions

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bibliography %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\bibliographystyle{unsrtnat} %{amsplain}
\bibliography{Bibliography}
\addcontentsline{toc}{chapter}{Bibliography}
\include{Bibliography}  %Bibliography

\end{document}

在此处输入图片描述

答案1

我不确定是否\include通常使用;只是为了做\listoffigures这件事,肯定太多了。

\addcontentsline但是,你可以通过删除这些命令(摘要命令除外)并添加以下命令来一次性解决所有问题:

\usepackage[nottoc]{tocbibind}

您的方法有什么问题?如果图片列表占两页,\addcontentsline将引用第二页。\include图片列表后面的 也存在问题。使用tocbibind,可以让 LaTeX\addcontentsline在正确的时间(自动)执行命令,问题就解决了。

相关内容