我在排版文档时遇到问题。文档类别是book
。我使用以下命令手动将图片列表添加到目录中:
\newpage
\phantomsection\label{listoffig}
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
目录本身有 3 页,从第 xii 页开始。图表列表出现在第 xv 页。但是,目录显示图表列表在第 xiii 页(这是错误的)。
我也尝试过这个命令:
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
但问题仍然存在。目录中的每个页码都是正确的,除了图表列表。奇怪的是,当我打开 .toc 文件时,图表列表的页码是正确的(它显示 xv)。
更新:我仍然无法解决问题,现在目录页码在目录本身内不正确,这是我迄今为止所做操作的示例。
\documentclass[12pt,a4paper,final,titlepage,onecolumn,openright,oneside]{book}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amstext}
\usepackage{color}
\usepackage{enumerate}
\usepackage{eurosym}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{indentfirst}
\usepackage{makeidx}
\usepackage{nomencl}
\usepackage[onehalfspacing]{setspace}
\usepackage{theorem}
\usepackage{ulem}
\usepackage[debug]{hyperref}
\setcounter{MaxMatrixCols}{10}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{acknowledgement}[theorem]{Acknowledgement}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{case}[theorem]{Case}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conclusion}[theorem]{Conclusion}
\newtheorem{condition}[theorem]{Condition}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{criterion}[theorem]{Criterion}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{summary}[theorem]{Summary}
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\topmargin=0.4 cm\headsep=0.5 cm \textwidth=15cm
\textheight=22.5cm\oddsidemargin=1.5cm
\geometry{left=3.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\def\contentsname{Contents}
\renewcommand{\bibname}{Reference}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{\\
hepage}
\lfoot{}
\cfoot{}
\rfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\begin{document}
\frontmatter
\thispagestyle{empty}
\begin{center}
\begin{figure}\begin{center}
\end{center}\end{figure}
\renewcommand
{\baselinestretch}{1}
\textsc{\Large{GREAT UNIVERSITY}}\\
\bigskip\bigskip\bigskip\bigskip
\textsc{\large{TRANSLATION OF SEVERAL LOGICS \\
TO ANOTHER LOGICS}}
\bigskip
\vspace{0.7 in}
\textsc{THESES}\\
\bigskip
\normalsize
\textsc{Submitted as A Partial Fulfillment\\
to Obtain Master Degree\\
In Mathematics}
\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip
\textsc{Harry McKenzie}\\
\textrm{99999}\\
\vfill
\vfill
\vfill
\vfill
\textsc{SCHOOL OF MATH AND CS}\\
\textsc{GRADUATE PROGRAM IN MATH} \\
\textsc{ANTARTICA}\\
\textsc{1998}\\
\bigskip
\end{center}
\chapter{Approval Page}
\chapter{Preface}
\chapter{Abstract}
\cleardoublepage
\phantomsection
\tableofcontents
\addcontentsline{toc}{chapter}{Report Contents} \markboth{Report Contents}{\textbf{Reports Contents}}
\cleardoublepage
\phantomsection
\addtocontents{lof}{\protect\addcontentsline{toc}{chapter}{Figures}}
\listoffigures
\mainmatter
\chapter{Introduction}
\section{Background}
\subsection{The Importance of This Topic}
\subsection{An Example in The Real World}
\subsection{Related Work}
\section{Problem Identification}
\section{Goal of This Project}
\section{Outline of This Project}
\section{Some Mathematical Preliminaries}
\subsection{Set Theory}
\subsection{Order Theory}
\chapter{A Variant of The Logic A and B}
\section{Informal Syntax and Semantics}
\section{Formal Syntax of Logic A and B}
\subsection{Formal Syntax of Logic A}
\subsection{Formal Syntax of Logic B}
\section{Formal Semantics of Logic A and B}
\subsection{Formal Semantics of Logic A}
\subsection{Formal Semantics of Logic B}
\section{Two Specific Variants}
\chapter{Logic 1 and Logic 2}
\section{Logic 1}
\subsection{Syntax of Logic 1}
\subsection{Semantics of Logic 1}
\subsection{A Variant of Logic 1}
\subsection{The Satisfiability Problem of Logic 1}
\section{Logic 2}
\subsection{Syntax of Logic 2}
\subsection{Semantics of Logic 2}
\subsection{The Satisfiability Problem of Logic 2}
\chapter{Translations}
\section{The First Translations}
\subsection{First Model Construction}
\subsection{First Translation Construction}
\subsection{The First Algorithm}
\subsection{Size Propagation}
\section{The Second Translations}
\subsection{Second Model Construction}
\subsection{Second Translation Construction}
\subsection{The Second Algorithm}
\subsection{Size Propagation}
\section{Some Concluding Remarks}
\chapter{The Decidability of The Logic}
\section{Computable Mapping and Mapping Reduction}
\section{The Reduction}
\section{Some Concluding Remarks}
\chapter{Conclusions and Future Works}
\section{Conclusion}
\section{Future Works}
\appendix
\chapter{The Appendix}
\backmatter
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Reference}
\begin{thebibliography}{Gr\"{a}11}
\bibitem[All83]{All83}
\bibitem[All84]{All84}
\bibitem[BGMS07]{BGMS07}
\bibitem[BGMS09]{BGMS09}
\bibitem[BHH07]{BHH07}
\bibitem[BM05]{BM05}
\bibitem[BMSS08]{BMSS08}
\bibitem[BMSS11]{BMSS11}
\bibitem[Bro97]{Bro97}
\bibitem[CH98]{CH98}
\bibitem[CH04]{CH04}
\bibitem[GMS03]{GMS03}
\bibitem[GMS04]{GMS04}
\bibitem[Gr\"{a}11]{Gra11}
\bibitem[HH07]{HH07}
\bibitem[HR04]{HR04}
\bibitem[KJJ03]{KJJ03}
\bibitem[LPS95]{LPS95}
\bibitem[Mar03]{Mar03}
\bibitem[Mei07]{Mei07}
\bibitem[Nel11]{Nel11}
\bibitem[OD08]{OD08}
\bibitem[Rab00]{Rab00}
\bibitem[RB06]{RB06}
\bibitem[Ros07]{Ros07}
\bibitem[SC85]{SC85}
\bibitem[Sip06]{Sip06}
\bibitem[SS94]{SS94}
\bibitem[Vit05]{Vit05}
\bibitem[VKvB89]{VKvB89}
\end{thebibliography}
\end{document}
答案1
您提到的第二段代码应该可以工作,正如 egreg 已经评论的那样。但是,您可以在创建图形之前将\addcontentsline
命令写入.lof
文件,这样它就会在图形列表页面的开头执行:
\addtocontents{lof}{\protect\addcontentsline{toc}{chapter}{List of Figures}}
您需要使用\protect
before\addcontentsline
来阻止该宏在写入 .lof 文件时扩展。
另一种方法是使用tocbibind
包,而不是手动添加这些条目。tocbibind
自动将参考书目和/或索引和/或内容、图表列表、表格列表等添加到目录中。该包提供了关闭任何这些包含内容的选项。