我有以下页面,但是当我运行它时,我在献词和表格列表后得到了一个额外的页码,不确定为什么会这样。如能得到任何帮助我将不胜感激。
\documentclass[]{report}
%\usepackage[latin1]{inputenc}
\usepackage[md]{titlesec}
\usepackage{subfiles}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{tocloft}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{gensymb}
\usepackage{float}
\usepackage{floatpag}
\floatpagestyle{plain}
\usepackage{listings}
\usepackage[nottoc]{tocbibind}
\usepackage[verbose]{cite}
\usepackage{cleveref}
\usepackage{url}
\usepackage{breakurl}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}% LoF
\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{}% LoT
\makeatother
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{quotes,angles}
\pgfplotsset{every axis/.append style={
axis x line=middle,
axis y line=middle,
axis line style={<->},
xlabel={$x$},
ylabel={$y$},
},
cmhplot/.style={color=black,mark=none,line width=1pt,<->},
soldot/.style={color=black,only marks,mark=*},
holdot/.style={color=black,fill=white,only marks,mark=*},
}
\tikzset{>=stealth}
\titleformat{\chapter}[display]{\centering\normalfont\large}{CHAPTER \arabic{chapter}}{0pt}{}{}
\titleformat*{\section}{\centering\bfseries\large}
\titleformat*{\subsection}{\bfseries\large}
\titleformat*{\subsubsection}{\normalfont\large}
\titlespacing*{\section}{0pt}{1\baselineskip}{0pt}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\titlespacing*{\subsubsection}{0pt}{2\baselineskip}{0pt}
\titlespacing{\paragraph}{0pt}{0pt}{1em}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\renewcommand{\contentsname}{}
\renewcommand{\listfigurename}{}
\renewcommand{\listtablename}{}
\renewcommand{\cftpartfont}{\normalsize\normalfont}
\renewcommand{\cftchapfont}{\normalsize\normalfont}
\renewcommand{\cftpartpagefont}{\normalsize\normalfont}
\renewcommand{\cftchappagefont}{\normalsize\normalfont}
\cftsetindents{chapter}{.25in}{.25in}
\cftsetindents{section}{.5in}{.25in}
\cftsetindents{subsection}{.75in}{.5in}
\cftsetindents{subsubsection}{1in}{.5in}
\renewcommand\cftsecafterpnum{\vskip-.5\baselineskip}
\renewcommand\cftsubsecafterpnum{\vskip-.5\baselineskip}
\renewcommand\cftsubsubsecafterpnum{\vskip-.5\baselineskip}
\newenvironment{MyFigure}[1][]{\begin{figure}[#1]\vspace{\baselineskip}}{\vspace{\baselineskip}\end{figure}}
\doublespacing
\raggedbottom
\begin{document}
%DO NOT USE \maketitle
\thispagestyle{empty}
\begin{center}
\large
\vspace*{2in}
TITLE\\
\vspace{2in}
By\\
AUTHOR
\vspace{1in}
\end{center}
PERSON1 \hfill PERSON2\\
PERSON1 \hfill PERSON2\\
(Chair) \hfill (Committee Member)\\
\newline\newline
PERSON3 \\
PERSON3 \\
(Committee Member) \\
\renewcommand{\thepage}{\roman{page}}
\begin{center}
\vspace*{2in}
TITLE\\
\vspace{1in}
By\\~\\
AUTHOR\\
\vspace*{1in}
A Thesis \\~\\~\\~\\
A UNI\\
PLACE\\~\\
DATA\ %month is GRADUATION month;
\end{center}
\chapter*{}
\begin{center}
\vfill
Copyright \copyright\ 2017
\bigskip
By AUTHOR
\bigskip
All Rights Reserved
\vfill
\end{center}
\chapter*{ABSTRACT}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ABSTRACT}
\large
\paragraph{ABSTRACT}
\chapter*{ACKNOWLEDGMENTS}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ACKNOWLEDGMENTS}
\paragraph{ACKNOLEDGE}
%\subfile{sections/Acknowledge}
\chapter*{DEDICATION}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}DEDICATION}
\paragraph{DEDICATION}
%\subfile{sections/Dedication}
\chapter*{TABLE OF CONTENTS}
\vspace{-6\baselineskip}
\tableofcontents
\chapter*{LIST OF TABLES}
\vspace{-6\baselineskip}
\listoftables
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF TABLES}
\cleardoublepage
\chapter*{LIST OF FIGURES}
\vspace{-6\baselineskip}
\listoffigures
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF FIGURES}
\cleardoublepage
\chapter*{LIST OF SYMBOLS}
%\vspace{-6\baselineskip}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF SYMBOLS}
\paragraph{LOS}
%\subfile{sections/Los}
\chapter*{LIST OF ABBREVIATIONS}
%\vspace{-6\baselineskip}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF ABBREVIATIONS}
\paragraph{LOA}
%\subfile{sections/Loa}
\cleardoublepage
\cleardoublepage
\large
\clearpage
\setcounter{page}{1}
\renewcommand{\thepage}{\arabic{page}}% Arabic numerals, starting at 1, for the actual document
\addtocontents{toc}{%
\protect\contentsline{part}{CHAPTER}{}}
\chapter{INTRODUCTION}
\label{Intro}
\section{Background}
\label{Backgrnd}
\paragraph{INTRO}
%\subfile{Sections/Background}
\section{Questions}
\label{Quest}
\paragraph{QUEST}
%\subfile{Sections/quest}
\section{Limitations}
\label{Limit}
\paragraph{LIMIT}
%\subfile{Sections/Limit}
\chapter{RELATED WORKS}
\label{RelWorks}
\paragraph{REL}
%\subfile{Sections/Relworks}
\chapter{METHODOLOGY}
\label{Method}
\paragraph{METHO}
%\subfile{Sections/Methodology}
\chapter{RESULTS}
\label{Result}
\paragraph{RES}
%\subfile{Sections/Result}
\chapter{CONCLUSION}
\label{Conclusion}
\paragraph{CONCLU}
%\subfile{Sections/conclusion}
\cleardoublepage
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}REFERENCES}
\cleardoublepage
\renewcommand\bibname{REFERENCES}
\setstretch{1} %this single spaces within bib entries, but keeps double spaces between entries
\bibliographystyle{IEEEtran}
\bibliography{ref}
\nocite{*}
\bibliographystyle{unsrt}
\addtocontents{toc}{%
\protect\contentsline{part}{APPENDIX}{}}
\appendix
\titleformat{\chapter}[display]{\centering\normalfont\large}{APPENDIX \Alph{chapter}}{0pt}{}{}
\titlespacing*{\chapter}{0pt}{250pt}{40pt}
\chapter{NON-FINAL APPENDIX TITLE}
\clearpage
First through $n-1^{th}$ appendix goes here
\chapter[\vspace{-.5\baselineskip}FINAL APPENDIX TITLE]{FINAL APPENDIX TITLE}%the last appendix needs to be added strangely
\clearpage
\begin{lstlisting}
LST LISTING IS HELPFUL FOR CODE
\end{lstlisting}
\titlespacing*{\chapter}{0pt}{50pt}{40pt}
\chapter*{VITA}
\addcontentsline{toc}{part}{VITA}
\large
\paragraph{}
\end{document}
答案1
包tocbibind
会导致这种情况。您有如此多的手写内容,以至于完全删除该包可能不会引起任何问题:从快速浏览来看,\addcontentsline
您甚至可能不需要添加任何内容。但还是检查一下。\addcontentsline
答案2
\listoftables
是\listoffigures
默认列表,它们会将自己的条目添加到目录中(默认情况下),即使你将其标题 ( \<list>name
) 设置为空白
他们仍然将内容推送到目录。您可以通过在目录中插入以下更正来避免这种情况:
\addtocontents{toc}{%
\protect\setcounter{tocdepth}{-1}% Only print up to \part
}
\chapter*{LIST OF TABLES}
\addcontentsline{toc}{part}{LIST OF TABLES}
\listoftables
\chapter*{LIST OF FIGURES}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF FIGURES}
\listoffigures
\addtocontents{toc}{%
\protect\setcounter{tocdepth}{2}% Only print up to \subsection
}
请注意,我删除了您在目录条目后和目录中添加的一些间距调整\chapter*
。为了保持一致性,我建议在设置条目(如\chapter
s 或目录条目等分段标题)时,在序言中更改这些内容。