删除附录前的空格以及单独纸张上的目录标题和内容

删除附录前的空格以及单独纸张上的目录标题和内容

我对目录和图表列表有疑问:标题和条目显示在两页上。如何删除附录和简历前的较大空白。

\documentclass[]{report} 
\usepackage[md]{titlesec} 
\usepackage{subfiles}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[titles]{tocloft} 
\usepackage[tocindentauto]{tocstyle}
\usepackage{amsmath} 
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{gensymb} 
\usepackage{float} 
\usepackage{floatpag}
\floatpagestyle{plain}
\usepackage{listings} 
\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}
\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}
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} % for parts
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters
\setcounter{tocdepth}{3}%all headings must be displayed in ToC.
\setcounter{secnumdepth}{3}%numbers all headings; not actually required (can set to 0 instead of 3 if wanted)
\renewcommand{\contentsname}{}%this is a kludge; ignore it
\renewcommand{\listfigurename}{}
\renewcommand{\listtablename}{}
\renewcommand{\cftpartfont}{\normalsize\normalfont} %changes font of chapters & parts in ToC.  removes bold, for instance
\renewcommand{\cftchapfont}{\normalsize\normalfont}
\renewcommand{\cftpartpagefont}{\normalsize\normalfont}
\renewcommand{\cftchappagefont}{\normalsize\normalfont}
\cftsetindents{chapter}{.25in}{.25in}%indents the chapters & sections in the ToC
\cftsetindents{section}{.5in}{.25in}
\cftsetindents{subsection}{.75in}{.5in}
\cftsetindents{subsubsection}{1in}{.5in}
\renewcommand\cftsecafterpnum{\vskip-.5\baselineskip} %these make the ToC single spaced within chapters, but keep it double spaced elsewhere
\renewcommand\cftsubsecafterpnum{\vskip-.5\baselineskip}
\renewcommand\cftsubsubsecafterpnum{\vskip-.5\baselineskip}
\newenvironment{MyFigure}[1][]{\begin{figure}[#1]\vspace{\baselineskip}}{\vspace{\baselineskip}\end{figure}}
\doublespacing %double space
\raggedbottom
\begin{document}
    %DO NOT USE \maketitle
    \thispagestyle{empty}
    \renewcommand{\thepage}{\roman{page}}% lowercase roman numerals for pre-document stuff
    \chapter*{}
    \begin{center}
    \vfill
    Copyright \copyright\ 2017
        All Rights Reserved
    \vfill
    \end{center}
    \chapter*{ABSTRACT}
    \addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ABSTRACT}
    \large
    \paragraph{Test}

    \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

    \chapter*{LIST OF FIGURES}
    \vspace{-4\baselineskip}
    \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}}% Arabic numerals, starting at 1, for the actual document


    \addtocontents{toc}{%
        \protect\contentsline{part}{.}{}}


\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} %this single spaces within bib entries, but keeps double spaces between entries

%\bibliography{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}%the last appendix needs to be added strangely


\clearpage
\chapter*{VITA}
\addcontentsline{toc}{part}{VITA}
\large
%\subfile{Sections/Vita}
\end{document}

目录:目录

附录:附录

答案1

你在序言中提到

\renewcommand{\contentsname}{}%this is a kludge; ignore it

拼凑物是一个问题。虽然它删除了目录的标题,但它并没有改变与打印这些标题相关的机制。本质上,在文档类下\tableofcontents设置为。这些章节设置在干净的页面上(在设置章节标题之前执行)。所以,即使你说\chapter*report\cleardoublepage

\chapter*{TABLE OF CONTENTS}
\vspace{-6\baselineskip}
\tableofcontents

\tableofcontents仍然会调用\chapter*{\contentsname},清除当前页面。相反,你可能想要

\renewcommand{\contentsname}{TABLE OF CONTENTS}

并在设置目录之前设置适当的内容\titlespacing以强制执行您的否定内容\vspace。这样,您只需调用它\tableofcontents,它就会按照您想要的方式设置标题,以及间距和实际目录。

上述相同的讨论也适用于\listfigurename/\listoffigures\listtablename/ \listoftables


在设置附录和 Vita 章节之前,您可以使用以下命令更改章节标题格式和间距:

\titleformat{\chapter}[display]{\centering\normalfont\large}{APPENDIX \Alph{chapter}}{0pt}{}{}
\titlespacing*{\chapter}{0pt}{250pt}{40pt}

\titlespacing具体来说,这是titlesec 文档(部分3.2 间距):

\titlespacing*{<command>}{<left>}{<before-sep>}{<after-sep>}[<right-sep>]

带星号的版本取消了标题后段落的缩进,但 和 除外,在这些情况drop下这种可能性没有意义。wraprunin

  • <left>增加左边距,除了在...margindrop形状中,此参数设置标题宽度,在 中设置wrap最大宽度,在 中runin设置标题前的缩进。如果使用负值,标题会伸出。

  • <before-sep>是标题前的垂直空间。

  • <after-sep>是标题与文本之间的间隔——垂直方向为hangblock、 和display,水平方向为runindropwrap...margin。通过使该值为负数,您可以定义小于 的有效空间\parskip

  • hangblock形状display可以<right-sep>通过这个可选参数来增加边距。

您明确设置<before-sep>250pt,这非常大。这就是导致您的标题在这些 s 上被推到页面底部的原因\chapter

相关内容