我试图在论文的目录中包含多个未编号的部分。我使用\chapter*{Summary}
和\chapter*{Samenvatting}
来定义未编号的部分,并使用\addcontentsline{toc}{chapter}{Summary}
和\addcontentsline{toc}{chapter}{Samenvatting}
将它们添加到目录中。摘要从第 1 页开始...并且在目录中显示正确,但 Samenvatting 从第 3 页开始,在目录中它再次出现在第 1 页。这是我的文档:
\documentclass[10pt,b5paper,openright,twoside]{book}
\usepackage{graphicx}
\usepackage[width=170.00mm, height=240.00mm, left=2.0cm, right=2.00cm, top=2.2 cm, bottom=1.80cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{textcomp}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{rotating}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage{wrapfig}
\usepackage{epigraph}
\usepackage[font={small},labelfont={bf}]{caption} %to set caption font small and with bold label
\captionsetup[table]{skip=5pt} %to add space below table caption
\renewcommand{\arraystretch}{1.2} % to increase row heigth in tables
\makeatletter % to set the layout of the chapters header
\def\@makechapterhead#1{%
\vspace*{60\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
%\huge\bfseries \@chapapp\space \thechapter
\huge\bfseries \thechapter.\space%
%\par\nobreak
%\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
\usepackage{fancyhdr} %necessary to set your own header and footer style
\pagestyle{fancy} %necessary to set your own header and footer style
\fancyhf{} %clear the header and the footer before you define your own
\fancyfoot[RO]{\thepage} %footer in odd pages on the right
\fancyfoot[LE]{\thepage} %footer in even pages on the left
\renewcommand\bibname{{{\tiny } }References} %change bibliography to References
\author{Elisa Calignano}
\title{Elisa tesi}
\begin{document}
\frontmatter %the text between \frontmatter and \mainmatter will be numbered with roman numbers
\renewcommand{\headrulewidth}{0pt} %set the thickness of the header line in the frontmatter at 0
\clearpage %in order to remove page numbers from the title page
\thispagestyle{empty}
\include{titlepage}
\clearpage %in order to remove page numbers from the empy page before the tabel of contents
\thispagestyle{empty}
\tableofcontents
\setcounter{secnumdepth}{3} %to number subsections
\setcounter{tocdepth}{3} %to include subsections number in the table of contents
\mainmatter
\renewcommand{\headrulewidth}{0.5 pt}%set the thickness of the header line in the mainmatter at 0.5
\fancyhead[LE]{\slshape\nouppercase{\leftmark}}%set header in even pages to the left=current chapter
\fancyhead[RO]{\slshape\nouppercase{\rightmark}}%set header in odd pages to the right=current section
\addcontentsline{toc}{chapter}{Summary}% to add the summary to the table of contents witouth number
\include{summary}
\addcontentsline{toc}{chapter}{Samenvatting}% to add the summary to the table of contents witouth number
\include{samenvatting}
\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4C}
\include{chapter5}
\include{chapter6}
\listoffigures
\listoftables
\bibliographystyle{apalike2}
\bibliography{Myref}
\backmatter
\include{author}
\include{acknowledgments}
\end{document}
答案1
\chapter*
有效地\cleardoublepage
确保新章节从其自己的页面开始,并且该页面是奇数页(右侧)。因此,当您说
\addcontentsline{toc}{chapter}{Summary}% to add the summary to the table of contents witouth number
\include{summary}
\addcontentsline{toc}{chapter}{Samenvatting}% to add the summary to the table of contents witouth number
\include{samenvatting}
会发生什么?
首先,在文件中添加一个内容,.toc
包括对当前页面的引用。这是针对Summary
条目的。
接下来,LaTeX 检查当前页面上是否有任何内容,以及当前页面是否为右侧页面。由于这里没有任何内容,并且是右侧页面,因此 LaTeX 将继续从\chapter*{Summary}
当前页面开始您开始的章节。由于这与文件中的条目相匹配.toc
,因此一切正常。
当它完成摘要的排版后,下一条指令告诉它向文件中添加一个条目.toc
。Samenvatting
它再次将引用添加到当前页面。
现在,它找到了,\chapter*{Samenvatting}
所以它检查当前页面上是否有任何内容。有。有所有这些Summary
东西。所以,它清除页面并开始一个新页面。现在它检查这是否是右侧页面。不是。我们现在在左侧页面上。所以,它清除另一页并开始一个新页面。现在我们在一页空白的右侧页面上,所以它开始这一Samenvatting
章。所以现在我们在第 3 页,但文件中的条目.toc
是在我们仍在第 1 页时发出的。
为了避免这种情况,请在发出后立即添加内容行\chapter*
。在这种情况下,这可能是在我们没有的包含文件中。在summary.tex
:
\chapter*{Summary}
\addcontentsline{toc}{chapter}{Summary}
在samenvatting.tex
:
\chapter*{Samenvatting}
\addcontentsline{toc}{chapter}{Samenvatting}