附录内容在目录中以错误标题显示

附录内容在目录中以错误标题显示

我正在为我的论文更改一个预建的模板。有一个名为的主文件,thesis.tex其中包含所有章节文件、参考文献文件和附录文件。该文件的结构如下

\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}
\include{chapter7}


% NEED TO CHANGE THE SECTION NUMBER FOR REFERENCES ACCORDINGLY
\addcontentsline{toc}{chapter}{8 \hskip 3.55em References}

\bibliographystyle{IEEEtran}  
\bibliography{references}

% COMMENT THE LINES ABOUT APPENDIX OUT IF YOU DO NOT HAVE THIS SECTION.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                 %
%                            APPENDICES                           %
%                                                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage\pagestyle{plain}
\theappendix

% NEED TO CHANGE THE SECTION NUMBER FOR REFERENCES ACCORDINGLY.
\addcontentsline{toc}{chapter}{9 \hskip 3.55em Appendices}

\include{appendix1}
%\include{appendix2}
\include{appendix3}

问题:
问题出在附录部分。我的第一个附录包含一些章节和图表。当我将此部分添加到主文件时,此附录的内容在目录中的其他章节下错误显示。

在此处输入图片描述

如您所见,附录的内容显示在参考文献章节下。我希望它们显示在附录部分下或完全隐藏它们。可能的解决方案是什么?

答案1

这种行为的解释如下https://tex.stackexchange.com/a/386799。但是那里的 OP 使用了 KOMA-Script 类及其\addchaptertocentry命令。

建议:替换\include{appendix1}应该\input{appendix1}可以解决您的问题。


如果您确实必须使用\include,则加载包scrlfile并使用:

\BeforeFile{appendix1.tex}{\addcontentsline{toc}{chapter}{9 \hskip 3.55em Appendices}}%  needs package scrlfile
\include{appendix1}

顺便说一句:您手动设置的章节编号看起来很奇怪。

相关内容