这是我的附录在目录中的样子,如何修复附录标题和点引号中的间距?我可以通过使用 tocstyle=auto 来修复此问题,但当我这样做时,它会以不同的方式弄乱我的目录。
以下是代码:
\documentclass[]{report}
\usepackage[md]{titlesec} %required for section titles
\usepackage{subfiles}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[titles]{tocloft}
%\usepackage[tocindentauto]{tocstyle}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{gensymb} %more symbols
\usepackage{float}
\usepackage{floatpag}
\floatpagestyle{plain}
\usepackage[verbose]{cite}
\usepackage{cleveref}
\usepackage{url}
\usepackage{breakurl}
\usepackage{graphicx}
\usepackage{wrapfig, framed, 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
\makeatother
\titleformat{\chapter}[display]{\centering\normalfont\large}{CHAPTER \arabic{chapter}}{0pt}{}{} %format of chapter & section headings
\titleformat*{\section}{\centering\bfseries\large}
\titleformat*{\subsection}{\bfseries\large}%see guidelines for what is allowed and what is not
\titleformat*{\subsubsection}{\normalfont\large}%try really hard not to use subsubsubsections
\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} %this removes the vertical space before each \paragraph{}
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\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}
\doublespacing
\raggedbottom
\begin{document}
\thispagestyle{empty}
\large
\vspace*{2in}
J\\
\vspace{2in}
By\\
J
\renewcommand{\thepage}{\roman{page}}
\begin{center}
\vspace*{2in}
\vspace{1in}
By\\~\\
J\\
\vspace*{1in}
A Thesis \\~\\~\\~\\
\end{center}
\chapter*{}
\begin{center}
\vfill
Copyright \copyright\ 2017
\bigskip
By J
\bigskip
All Rights Reserved
\vfill
\end{center}
\chapter*{ABSTRACT}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ABSTRACT}
\large
\paragraph{O}
\chapter*{ACKNOWLEDGMENTS}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ACKNOWLEDGMENTS}
%\subfile{sections/Acknowledge}
\chapter*{DEDICATION}
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}DEDICATION}
%\subfile{sections/Dedication}
\vspace{-6\baselineskip}
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\tableofcontents
\vspace{-4\baselineskip}
\renewcommand{\listfigurename}{LIST OF FIGURES}
\listoffigures
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF FIGURES}
\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}}
\chapter{INTRODUCTION}
\label{Intro}
\section{Background}
\label{Backgrnd}
%\subfile{Sections/Background}
\section{Questions and Limitations}
\label{Quest}
%\subfile{Sections/quest}
\chapter{RELATED WORKS}
\label{RelWorks}
%\subfile{Sections/Relworks}
\chapter{METHODOLOGY}
\label{Method}
%\subfile{Sections/Methodology}
\chapter{RESULTS}
\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}
\makeatletter
\renewcommand{\@dotsep}{100000000}
\makeatother
\addtocontents{toc}{%
\protect\contentsline{part}{APPENDIX }{}}
\appendix
\titleformat{\chapter}[display]{\centering\normalfont\large}{APPENDIX \Alph{chapter}}{0pt}{}{}
\makeatletter
\addtocontents{toc}{\def\string\@dotsep{10}}
\makeatother
\chapter{Equations }
\label{eqn}
%\subfile{Sections/Equation}
\clearpage
\chapter*{VITA}
\addcontentsline{toc}{part}{VITA}
\large
%\subfile{Sections/Vita}
\end{document}