目录忽略某一行之后声明的章节

目录忽略某一行之后声明的章节

问题:除非我删除三张图片,否则目录不会列出特定行后声明的章节。

我有一篇论文,包含六个章节。最后两个章节未列在目录中,除非我删除三幅图像的声明,在这种情况下它们会被包括在内。我使用完全相同的代码在论文中生成一些更高级别的图像,没有任何问题。TexPad 可以识别稍后声明的章节。我该如何修复或解决这个问题?谢谢!

\tableofcontents % Prints the main table of contents

\chapter{this will be displayed in the TOC}

\begin{figure}
\centering
  \includegraphics[scale=0.5]{Figures/ts_analysis_logrets.png}
 \decoRule
  \caption{Log-returns of DAX index}
  \label{fig:logrets}
  \includegraphics[scale=0.5]{Figures/ts_analysis_logrets_squared.png}
 \decoRule
  \caption{DAX log returns squared}
  \label{fig:logretssquared1}
\end{figure}


\begin{figure}
\centering
  \includegraphics[scale=0.5]{Figures/ts_analysis_arch_residuals.png}
 \decoRule
  \caption{Residuals of ARCH model fitted to DAX log returns}
  \label{fig:archresid1}
\end{figure}

\chapter{this will NOT be displayed in the TOC}

截屏

\documentclass[
11pt, % The default document font size, options: 10pt, 11pt, 12pt
oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
%chapterinoneline,% Have the chapter title next to the number in one single line
english, % ngerman for German
singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
%nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
%liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
%toctotoc, % Uncomment to add the main table of contents to the table of contents
parskip, % Uncomment to add space between paragraphs
%nohyperref, % Uncomment to not load the hyperref package
headsepline, % Uncomment to get a line under the header
]{MastersDoctoralThesis} % The class file specifying the document structure

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage{palatino} % Use the Palatino font by default
\usepackage{amsmath}

\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)

%\usepackage{url}
%\usepackage{breakurl}
\usepackage[hidelinks]{hyperref} 
\usepackage{listings}
\usepackage{color}
\usepackage{setspace}
\usepackage{tabulary}
\usepackage[]{mcode}
\addbibresource{hng1} % The filename of the bibliography
\usepackage{lscape}
\usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}

\usepackage{float} %placement
%----------------------------------------------------------------------------------------
%   MARGIN SETTINGS
%----------------------------------------------------------------------------------------

\geometry{
    paper=letterpaper, % Change to letterpaper for US letter a4paper
    inner=2.5cm, % Inner margin
    outer=3.8cm, % Outer margin
    bindingoffset=2cm, % Binding offset
    top=1.5cm, % Top margin
    bottom=1.5cm, % Bottom margin
    %showframe,% show how the type block is set on the page
}

(...)

%----------------------------------------------------------------------------------------
%   LIST OF CONTENTS/FIGURES/TABLES PAGES
%----------------------------------------------------------------------------------------

\tableofcontents % Prints the main table of contents

\listoffigures % Prints the list of figures

\listoftables % Prints the list of tables

答案1

您的图表文件名包含下划线 ( _)。下划线和其他几个符号 ($、\、& 等) 在 LaTeX 中是保留的。

因此,一旦编译器遇到文件名,就会出现错误消息Figures/ts_analysis_logrets_squared.png

但对于您的情况,只需加载包 »grffile«,至少这个错误就会消失。还有其他补救措施,例如参见 https://tex.stackexchange.com/a/65387/4736

如果我错了,而且这并没有导致您的问题,那么,添加一个显示错误的 MWE!

相关内容