我使用的代码是
\documentclass[]{report}
\usepackage[md]{titlesec} %required for section titles
\usepackage{subfiles}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[titles]{tocloft} %required for Table of Contents formatting
\usepackage{tocbasic}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{gensymb} %more symbols
\usepackage{subcaption}
\usepackage{float}
\usepackage{floatpag}
\floatpagestyle{plain}
\usepackage{listings}
\usepackage[verbose]{cite}
\usepackage{cleveref}
\usepackage{url}
\usepackage{breakurl}
\usepackage{graphicx} %picture handling
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}%margins
\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, % put the x axis in the middle
axis y line=middle, % put the y axis in the middle
axis line style={<->}, % arrows on the axis
xlabel={$x$}, % default put x on x-axis
ylabel={$y$}, % default put y on y-axis
},
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}%spacing between headings
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\titlespacing*{\subsubsection}{0pt}{2\baselineskip}{0pt}
\titlespacing{\paragraph}{0pt}{0pt}{1em}
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} % for parts
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters
\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}
%\renewcommand*\cftchapnumwidth{2em}
%\renewcommand*\cftsecnumwidth{3em}
\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}
\thispagestyle{empty}
\begin{center}
\large
\vspace*{2in}
TITLE\\
\vspace{2in}
By\\
Author
\vspace{1in}
\end{center}
Dr. \hfill Dr. D\\%only if you have 3 committee members
\hfill \\
(Chair) \hfill (Committee Member)\\
\newline\newline
Dr. \
s \\
(Committee Member) \\
\renewcommand{\thepage}{\roman{page}}
\begin{center}
\vspace*{2in}
TITLE\\
\vspace{1in}
By\\~\\
Author\\
\vspace*{1in}
Desc\\~\\~\\~\\
College\\
Location\\~\\
Date\ %month is GRADUATION month; that is, it was august for me
\end{center}
\chapter*{}
\begin{center}
\vfill
Copyright \copyright\ 2022
\bigskip
Author
\bigskip
All Rights Reserved
\vfill
\end{center}
\chapter*{ABSTRACT}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ABSTRACT}
\large
\subfile{Sections/Abstract}
\chapter*{ACKNOWLEDGMENTS}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ACKNOWLEDGMENTS}
\subfile{Sections/Acknowledge}
\chapter*{DEDICATION}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}DEDICATION}
\subfile{Sections/Dedication}
\chapter*{TABLE OF CONTENTS}
%\vspace{-6\baselineskip}
\tableofcontents
%\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}
\subfile{Sections/Los}
\chapter*{LIST OF ABBREVIATIONS}
%\vspace{-6\baselineskip}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF ABBREVIATIONS}
\subfile{Sections/Loa}
\cleardoublepage
\cleardoublepage
\large
\clearpage
\setcounter{page}{1}
\renewcommand{\thepage}{\arabic{page}}
\addtocontents{toc}{%
\protect\contentsline{part}{.}{}}
\chapter{INTRODUCTION}
\label{Intro}
\section{Background}
\label{Backgrnd}
\subfile{Sections/Background}
\section{Questions}
\label{Quest}
\subfile{Sections/quest}
\section{Limitations}
\label{Limit}
\subfile{Sections/Limit}
\chapter{RELATED WORKS}
\label{RelWorks}
\subfile{Sections/Relworks}
\chapter{Smart Meter Privacy}
\label{Method}
\subfile{Sections/Methodology}
\chapter{Blockchain Based Management and Authentication}
\label{Result}
\subfile{Sections/BMgmt}
\chapter{Blockchain Based Privacy Preserving for IoT Devices}
\label{Result}
\subfile{Sections/Result}
\chapter{CONCLUSION}
\label{Conclusion}
\subfile{Sections/conclusion}
\cleardoublepage
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}REFERENCES}
\cleardoublepage
\renewcommand\bibname{REFERENCES}
\setstretch{1}
\bibliography{./Sections/ref}
\bibliographystyle{IEEEtran}
\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{Equations }
\label{eqn}
\subfile{Sections/Equation}
\clearpage
%\chapter[\vspace{-.5\baselineskip}FINAL APPENDIX TITLE]{ Equation}
\clearpage
%\begin{lstlisting}
%LST LISTING IS HELPFUL FOR CODE
%\end{lstlisting}
%\titlespacing*{\chapter}{0pt}{50pt}{40pt}
\chapter*{VITA}
\addcontentsline{toc}{part}{VITA}
\large
\subfile{Sections/Vita}
\paragraph{}
\end{document}
谢谢
答案1
你的问题是你假设
\renewcommand{\contentsname}{}
删除插入的常规标题
\tableofcontents
事实并非如此,因为\tableofcontents
通常问题
\chapter*{\contentsname}
\contentsname
即使章节为空,也会设置未编号的章节和本章前面有\cleardoublepage
。这解释了为什么你手动设置章节标题,然后目录从下一页开始,带有一个很大的空白“标题”空间(未编号的章节,标题为空)。因此,你最好发布
\renewcommand{\contentsname}{TABLE OF CONTENTS}
并调用\tableofcontents
没有前面的\chapter*{TABLE OF CONTENTS}
。这同样适用于您的 LoF 和 LoT 调用。
答案2
您的代码非常不完整,并且有很多“\cleardoublepage”。我建议您先阅读(简短的)手册。同时我向您推荐这个代码(您可以根据您的语言进行定制):
\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage[italian]{babel}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\listoffigures
\chapter{One}
\lipsum[1]
\section{Test}
\lipsum[2-5]
\end{document}