章节/小节/段落等之间的间距问题

章节/小节/段落等之间的间距问题

**更新

这可能是一个重复的问题,但我不知道如何防止这个额外的空白出现。

附件是我的 MWE,用于显示我无法消除的额外空白。具体来说,第 11 页的段落和小节之间。我需要指定所有部分/小节/段落等之间的严格间距。

这是我的MastersDoctoralThesis.cls文件:


\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{MastersDoctoralThesis}[12/7/20 MastersDoctoralThesis]

\DeclareOption{11pt}{
    \PassOptionsToClass{\CurrentOption}{article} % book report
}

\ExecuteOptions{11pt}

\ProcessOptions\relax

\LoadClass[11pt,letterpaper]{report}

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5} 

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}

\RequirePackage{amssymb}
\let\bvec\mathbf 
\RequirePackage{empheq}
\RequirePackage{amsbsy}
\RequirePackage{mathtools}
\DeclarePairedDelimiterX{\norm}[1]{\lVert}{\rVert}{#1}

\RequirePackage{mathpazo}

\newlength{\UOneInChapterSpace}
\newlength{\UHeadSpace}
\newlength{\UDoubleSpace}
\makeatletter

\RequirePackage{calc}
\setlength{\UOneInChapterSpace}{-40pt + 1in} 
\setlength{\UHeadSpace}{3ex}
\setlength{\UDoubleSpace}{1ex}

\RequirePackage{setspace}
\RequirePackage{etoolbox}

\AtBeginEnvironment{figure}{\addvspace{\UHeadSpace}}
\AtEndEnvironment{figure}{\addvspace{\UHeadSpace}}
\AtBeginEnvironment{table}{\addvspace{\UHeadSpace}}
\AtEndEnvironment{table}{\addvspace{\UHeadSpace}}
\AtBeginEnvironment{equation}{\addvspace{\UHeadSpace}}
\AtEndEnvironment{equation}{\addvspace{\UHeadSpace}}
\AtBeginEnvironment{tabular}{\singlespacing}

\RequirePackage{subfiles}

\RequirePackage{lipsum}

\RequirePackage{longtable} 
\RequirePackage{booktabs}

\newbool{graphicDraft}
\DeclareOption{graphicFinal}{\boolfalse{graphicDraft}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\ProcessOptions\relax
\ifbool{graphicDraft}
    {\RequirePackage[draft]{graphicx}}
    {\RequirePackage[final]{graphicx}}

\RequirePackage{subcaption}
\RequirePackage{animate}
\RequirePackage{pdfpages}

\RequirePackage[font=singlespacing]{caption}

\RequirePackage{todonotes}

\RequirePackage{geometry}
\geometry{
    paper          = letterpaper,
    inner          = 1.25in,
    outer          = 1.25in,
    bindingoffset  = 0in,
    top            = 1in,
    bottom         = 1in,
    %head           = 2in,
    %showframe,
}

\RequirePackage{xcolor} % Required for specifying custom colors
\definecolor{BLACK}{HTML}{000000}
\definecolor{URED}{HTML}{CC0000}
\definecolor{midnightBlue}{HTML}{145680} % midnight blue
\definecolor{darkBrown}{HTML}{654321} % Dark brown
\definecolor{arsenic}{HTML}{3B444B}
\definecolor{darkGreen}{HTML}{00b300} % Dark green
\definecolor{tab:blue}{HTML}{1f77b4} % python

\RequirePackage{sectsty}

\chapternumberfont{\normalsize} 
\chaptertitlefont{\normalsize}

\RequirePackage[nostruts,compact]{titlesec}

\titlespacing{\chapter}{0in}{\UOneInChapterSpace}{\UHeadSpace}[0in] 
\titlespacing{\section}{0in}{0in}{\UDoubleSpace}[0in]
\titlespacing{\subsection}{0in}{0in}{\UDoubleSpace}[0in]
\titlespacing{\subsubsection}{0in}{0in}{\UDoubleSpace}[0in]
\titlespacing{\paragraph}{1em}{1ex}{1ex}[1em]

\titleformat{\chapter}
    [display]
    {\color{URED}\centering\normalfont\Large\bfseries\doublespacing}
    {\MakeUppercase{\chaptertitlename} \Large\thechapter}
    {0in}
    {\MakeUppercase}
    []

\titleformat{\section}
    [hang]
    {\centering\singlespacing\normalfont\Large\bfseries}
    {\thesection}
    {1ex}
    {}
    []

\titleformat{\subsection}
    [hang]
    {\centering\singlespacing\normalfont\large\bfseries}
    {\thesubsection}
    {1ex}
    {}
    []

\titleformat{\subsubsection}
    [hang]
    {\centering\singlespacing\normalfont\normalsize\bfseries}
    {\thesubsubsection}
    {1ex}
    {}
    []

\titleformat{\paragraph}
    [runin]
    {\centering\singlespacing\normalfont\normalsize\bfseries}
    {\theparagraph}
    {1ex}
    {}
    []

\titleformat{\subparagraph}
    [runin]
    {\centering\singlespacing\normalfont\normalsize\bfseries}
    {\thesubparagraph}
    {1ex}
    {}
    []

\parskip=0pt

\RequirePackage[final]{microtype}  


\RequirePackage[defernums=true,
                hyperref,
                backref,
                backend=biber,
                style=ieee,
                natbib=true,
                refsegment=chapter,
                block=space
                ]{biblatex}

\setlength\bibitemsep{1.5\itemsep}

\defbibheading{references}[References]{% 
    \section{#1}
    \markboth{#1}{#1}%
    \singlespacing
}

\def\finalBibliography{
    {\singlespacing
    \printbibliography[heading=bibintoc, title={\uppercase{Bibliography}}] % Whole
    }
}

\RequirePackage{hyperref}
\hypersetup{pdfpagemode={UseOutlines},
    bookmarksopen=true,
    bookmarksopenlevel=0,
    hypertexnames=true,
    colorlinks=true,
    citecolor=darkBrown,
    linktoc=all,
    linkcolor=URED,
    urlcolor=midnightBlue,
    pdfstartview={FitV},
    unicode,
    breaklinks=true,
}
\RequirePackage{doi}
\RequirePackage{url}

\RequirePackage[capitalise]{cleveref}
\crefname{paragraph}{Paragraph}{Paragraphs}
\crefname{subparagraph}{Sub Paragraph}{Sub Paragraphs}

\captionsetup[sub]{labelsep=none, subrefformat=parens}

\RequirePackage[titles]{tocloft}
\renewcommand{\cftchapdotsep}{\cftdotsep}
\renewcommand{\contentsname}{\color{URED}\hfill \Large CONTENTS \hfill}
\renewcommand{\listfigurename}{\color{URED}\hfill \Large LIST OF FIGURES \hfill}
\renewcommand{\listtablename}{\color{URED}\hfill \Large LIST OF TABLES \hfill}

\setlength{\cftsecindent}{1em}
\setlength{\cftsubsecindent}{2em}
\setlength{\cftsubsubsecindent}{3em}
\setlength{\cftparaindent}{4em}
\setlength{\cftsubparaindent}{5em}

\RequirePackage{xfp}
\RequirePackage{xparse}

\renewcommand\cftchapdotsep{2}
\renewcommand\cftsecdotsep{2}
\renewcommand\cftsubsecdotsep{2}
\renewcommand\cftsubsubsecdotsep{2}
\renewcommand\cftparadotsep{2}
\renewcommand\cftsubparadotsep{2}

\renewcommand\cftchapafterpnum{\vskip2pt}
\renewcommand\cftsecafterpnum{\vskip2pt}
\renewcommand\cftsubsecafterpnum{\vskip2pt}

\setlength{\cfttabindent}{0em}
\setlength{\cftfigindent}{0em}

\RequirePackage{algpseudocode}
\RequirePackage{algorithm}

\def\thesistype#1{\gdef\@thesistype{#1}}
\def\degreeAchieved#1{\gdef\@degreeAchieved{#1}}
\def\department#1{\gdef\@department{#1}}
\def\departmentLink#1{\gdef\@departmentLink{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
\newcommand\skiplines[1]{\vspace{#1\baselineskip}}

\newcommand\thesisTitle{
    {
    \thispagestyle{empty}
    \begin{minipage}[c]{\textwidth}
        \vspace{1in}
        \centering
        \begin{spacing}{2}
            {\doublespacing\Large\bfseries\MakeUppercase{\@title}}\\
        \end{spacing}
        \large
        \skiplines{4}
        \begin{spacing}{2}
            by \\
            \@author \\
        \end{spacing}
        \skiplines{4}
        A \@thesistype ~submitted to the faculty of\\
        University\\
        in partial fulfillment of the requirements for the degree of \\
        \skiplines{4}
        {\@degreeAchieved}\\
        \skiplines{4}
        \begin{spacing}{2}
            \href{\@departmentLink}{\@department}\\
            \href{http://google.com}{University}\\
            \@submitdate
        \end{spacing}
    \end{minipage}
    \clearpage
    }
}


\def\copyrightyear#1{\gdef\@copyrightyear{#1}}

\newcommand\copyrightpage{
    {\newpage
    \thispagestyle{empty}
    \topskip0pt
    \vspace*{\fill}
    \noindent
    \begin{minipage}[c]{\textwidth}%
        \centering
        Copyright \copyright\ \@author\ \@copyrightyear \\
        \skiplines{1} % university requirement
        All Rights Reserved
    \end{minipage}%
    \vspace*{\fill}
    \newpage
    }
}

\def\committeeChair#1{\gdef\@committeeChair{#1}}
\def\advisorTitle#1{\gdef\@\advisorTitle{#1}}
\def\committeeMemberII#1{\gdef\@committeeMemberII{#1}}
\def\committeeMemberIII#1{\gdef\@committeeMemberIII{#1}}
\def\committeeMemberIIII#1{\gdef\@committeeMemberIIII{#1}}
\def\committeeMemberIIIII#1{\gdef\@committeeMemberIIIII{#1}}

\def\graduateDean#1{\gdef\@graduateDean{#1}}
\def\departmentChair#1{\gdef\@departmentChair{#1}}
\def\departmentChairTitle#1{\gdef\@departmentChairTitle{#1}}
\def\deptmentCollegeSchool#1{\gdef\@deptmentCollegeSchool{#1}}

\def\approvaldepartment#1{\gdef\@approvaldepartment{#1}}
\def\chairDateApproved#1{\gdef\@chairDateApproved{#1}}
\def\committeeMemberIIDateApproved#1{\gdef\@committeeMemberIIDateApproved{#1}}
\def\committeeMemberIIIDateApproved#1{\gdef\@committeeMemberIIIDateApproved{#1}}
\def\committeeMemberIIIIDateApproved#1{\gdef\@committeeMemberIIIIDateApproved{#1}}
\def\committeeMemberIIIIIDateApproved#1{\gdef\@committeeMemberIIIIIDateApproved{#1}}

\def\bfunderline#1{\underline{\kern 1in \textbf{#1}\kern 1in}}

\RequirePackage{tabularx} % pagewidth tables
\RequirePackage{array} % Specify width of tables
\RequirePackage{ragged2e} % Allows for justification of sections

\long \def \dissertationapproval{%
    \newpage
    \thispagestyle{empty}
    \vspace*{\fill}
    \noindent
    \begin{minipage}[c]{\textwidth}
        \centering
        \textbf{\Large University Graduate School} \\
        \skiplines{2}
        \textbf{\Large STATEMENT OF DISSERTATION APPROVAL}
        \skiplines{2}
        %
        \justify
        \begin{doublespace}
            The dissertation of\hspace{1in}\bfunderline{\@author} \\
            \skiplines{2}
            has been approved by the following supervisory committee members:

            \begin{table}[H] % [htbp]
                \centering    \begin{tabular}{>{\centering\arraybackslash}p{0.6\textwidth}p{0.1\textwidth}>{\centering\arraybackslash}p{0.2\textwidth}}
                    \bfseries{\@committeeChair} & \multicolumn{1}{l}{ , Chair} & \multicolumn{1}{c}{\bfseries{\@chairDateApproved}} \\
                    \cmidrule{1-1}\cmidrule{3-3}          &       & \tiny{Date Approved} \\
                        &    &    \\ % add extra row between the committee members
                    \bfseries{\@committeeMemberII} & \multicolumn{1}{l}{ , Member} & \multicolumn{1}{c}{\bfseries{\@committeeMemberIIDateApproved}} \\
                    \cmidrule{1-1}\cmidrule{3-3}          &       & \tiny{Date Approved} \\
                        &    &    \\ % add extra row between the committee members
                    \bfseries{\@committeeMemberIII} & \multicolumn{1}{l}{ , Member} & \multicolumn{1}{c}{\bfseries{\@committeeMemberIIIDateApproved}} \\
                    \cmidrule{1-1}\cmidrule{3-3}          &       & \tiny{Date Approved} \\
                        &    &    \\ % add extra row between the committee members
                    \bfseries{\@committeeMemberIIII} & \multicolumn{1}{l}{ , Member} & \multicolumn{1}{c}{\bfseries{\@committeeMemberIIIIDateApproved}} \\
                    \cmidrule{1-1}\cmidrule{3-3}          &       & \tiny{Date Approved} \\
                        &    &    \\ % add extra row between the committee members
                    \bfseries{\@committeeMemberIIIII} & \multicolumn{1}{l}{ , Member} & \multicolumn{1}{c}{\bfseries{\@committeeMemberIIIIIDateApproved}} \\
                    \cmidrule{1-1}\cmidrule{3-3}          &       & \tiny{Date Approved} \\
                \end{tabular}%
            \end{table}%
            
            \justify
            and by \hspace{1in}\bfunderline{\@departmentChair}, {\@departmentChairTitle} of \\
            the {\@deptmentCollegeSchool} of \hspace{1in}\bfunderline{\@approvaldepartment} \\
            and by \bfunderline{\@graduateDean}, Dean of The Graduate School.\\
        \end{doublespace}
    \end{minipage}
    \vspace*{\fill}
}

\def\abstractString#1{\gdef\@abstractString{#1}}

\newcommand\abstractPage{
    {\newpage
    \chapter*{Abstract}
        % manually set to page iii (University requirement)
        \setcounter{page}{3}
        \addcontentsline{toc}{chapter}{\uppercase{Abstract}}
        \hspace{\parindent}
        \begin{doublespace}
            \@abstractString
        \end{doublespace}
    }
}


\def\dedication#1{\gdef\@dedication{#1}}

\newcommand\dedicationPage{
    {\newpage
        \clearpage\thispagestyle{empty}\addtocounter{page}{-1} 
        \topskip0pt
        \vspace*{\fill}
        \noindent
        \begin{minipage}[c]{.95\textwidth}%
            \centering
            \@dedication
        \end{minipage}%
        \vspace*{\fill}
    }
}

\def\frontispiece#1{\gdef\@frontispiece{#1}}

\newcommand\frontispiecePage{
    {\newpage        
        \clearpage\thispagestyle{empty}
        \topskip0pt
        \vspace*{\fill}
        \noindent
        \begin{minipage}[c]{\textwidth}%
            \centering
            \includegraphics[width=\textwidth]{{\@frontispiece}}
        \end{minipage}%
        \vspace*{\fill}
    }
}


\RequirePackage{epigraph}
\def\epigraphQuote#1{\gdef\@epigraphQuote{#1}}
\def\epigraphAuthor#1{\gdef\@epigraphAuthor{#1}}

\newcommand\epigraphPage{
    {\newpage
        \clearpage\thispagestyle{empty}
        \topskip0pt
        \vspace*{\fill}
        \noindent
        \begin{minipage}[c]{\textwidth}%
            \centering
            \epigraph{\Large{\@epigraphQuote}}{---{\@epigraphAuthor}}
        \end{minipage}%
        \vspace*{\fill}
    }
}


\def\Acknowledgement#1{\gdef\@Acknowledgement{#1}}

\newcommand\AcknowledgementPage{
    {
    \chapter*{Acknowledge}
    \addcontentsline{toc}{chapter}{\uppercase{Acknowledge}}
    \hspace{\parindent}
    \begin{doublespace}
        \@Acknowledgement
    \end{doublespace}
    }
}


\def\NotationAndSymbols#1{\gdef\@NotationAndSymbols{#1}}

\newcommand\NotationSymbolsPage{
    {
    \chapter*{Notation and Symbols}
        \addcontentsline{toc}{chapter}{\uppercase{Notation and Symbols}}
        \begin{center}
            \@NotationAndSymbols
        \end{center}
    }
}

\RequirePackage{fancyhdr}

\newcommand\frontMatter{%
    \cleardoublepage
    \pagenumbering{roman}}

\newcommand\mainMatter{%
    \addtocontents{toc}{\vspace{1em}\noindent{\bf\uppercase{Chapters}}\hfill\par} 
    \cleardoublepage
    
    \pagestyle{fancy}
    \fancyhf{} 
    \lhead{} 
    \rhead{\thepage} 
    \renewcommand{\headrulewidth}{0pt} 
    
    \fancypagestyle{plain}{%
      \renewcommand{\headrulewidth}{0pt}%
      \fancyhf{} 
      %\fancyhead[R]{\thepage} 
    }
    
    \pagenumbering{arabic} 
    \doublespacing 
}

\newcommand\backMatter{%
    \if@openright
    \cleardoublepage
    \else
    \clearpage
    \fi
    % \@mainmatterfalse
}

\renewcommand\cftfigafterpnum{\vskip5pt\par}
\renewcommand\cfttabafterpnum{\vskip5pt\par}

\newcommand\tableOfContents{
    {
    \hypersetup{linkcolor=blue}
    \clearpage
    \pdfbookmark{Table of Contents}{toc}
    \tableofcontents
    
    \clearpage
    \phantomsection
    \addcontentsline{toc}{chapter}{\uppercase{List of Figures}}
    \listoffigures
    
    \clearpage
    \phantomsection
    \addcontentsline{toc}{chapter}{\uppercase{List of Tables}}
    \listoftables
    }
}

\pdfstringdefDisableCommands{\let\uppercase\relax} 

\RequirePackage{mwe}

\endinput

这是我的StudentInfo.tex文件:

\author        {Full Name}
\title        {Thesis title}
\thesistype    {dissertation}
\degreeAchieved    {Doctor of Philosophy}
\department    {Department of xx}
\departmentLink    {}
\submitdate    {xx yyyy}
\copyrightyear  {\the\year{}}

\abstractString    {Abstract goes here.  \\\indent More info here.}

\dedication    {To Science!}

\frontispiece    {example-image-a} % 

\epigraphQuote    {``Quote"} 
\epigraphAuthor    {Famous Individual}

\Acknowledgement{Acknowledge \ldots \\\indent more recognition.}

\NotationAndSymbols{
\begin{tabular}{p{0.05\textwidth}p{0.9\textwidth}}
    \toprule
    x     & \emph{Var} - the variable x. \\
    \bottomrule
\end{tabular}%
}

\approvaldepartment     {Dept.}

\graduateDean           {xx}
\departmentChair        {yy}
\departmentChairTitle   {Chair}
\deptmentCollegeSchool  {Department}

\committeeChair         {Advisor}
\advisorTitle           {Associate Professor, Associate Chair}

\committeeMemberII      {xx}
\committeeMemberIII     {yy}
\committeeMemberIIII    {zz}
\committeeMemberIIIII   {aa}

\chairDateApproved                  {xx xx \the\year{}}
\committeeMemberIIDateApproved      {xx xx \the\year{}}
\committeeMemberIIIDateApproved     {xx xx \the\year{}}
\committeeMemberIIIIDateApproved    {xx xx \the\year{}}
\committeeMemberIIIIIDateApproved   {xx xx \the\year{}}

这是我的bibliography.bib文件

@article{test,
author = {Last, First},
doi = {xxxx},
issn = {xxx},
journal = {ABC},
number = {1-2},
pages = {12--22},
title = {{Title}},
volume = {111},
year = {xxxx}
}

最后但同样重要的是,这是调用 cls 和学生信息文件的 MWE


% The class file specifying the document structure
\documentclass{MastersDoctoralThesis}

\input{StudentInfo.tex}

\addbibresource{bibliography.bib}

\begin{document}
    \frontMatter
    \begin{center}
        \thesisTitle
        \copyrightpage
        \dissertationapproval
    \end{center}
    \abstractPage
    \dedicationPage
    \frontispiecePage
    \epigraphPage
    \tableOfContents
    \NotationSymbolsPage
    \AcknowledgementPage
    
    \mainMatter
    \chapter{\uppercase{Introduction}}\label{Chapter1}
        \section{Overview}
            \lipsum[1] \cite{test}
        
        \section{Background and significance}
            \lipsum[1-3]
        
        \section{Hypothesis and Rationale}\label{Hyptohesis_Rationale}
        \subsection{Aim 1}\label{aim:1}
            \lipsum[1]
        
        \subsection{Aim 2}\label{aim:2}
            \lipsum[2]
        
        \subsection{Aim 3}\label{aim:3}
            \lipsum[3]
        
        \section{Impact and Intellectual Contributions}\label{sec:impact}
            \lipsum[1-2]
    
        % Bibliography
        \printbibliography[segment=\therefsegment, heading=references]
        
    \chapter[\uppercase{Multiline title}]{\uppercase{Multiline \protect\\ title}}\label{Chapter2}
        
        \lipsum[1]
    
        \section{Abstract}
            \lipsum[1]
        
        \section{Introduction}
            \lipsum[1-5]
        
        \section{Section1}\label{sec:Section1}

        \subsection{Subsection1}\label{subsec:Subsection1}
            \lipsum[1-2]

            \begin{figure}[tbp]
                \centering
                \begin{subfigure}[b]{0.3\textwidth}
                    \centering
                    \includegraphics[width=\linewidth]
                    {example-image-a}
                    \subcaption{\label{fig:a}}
                \end{subfigure}%
                \begin{subfigure}[b]{0.3\textwidth}
                    \centering
                    \includegraphics[width=\linewidth]
                    {example-image-b}
                    \subcaption{\label{fig:b}}
                \end{subfigure}%
                \begin{subfigure}[b]{0.3\textwidth}
                    \centering
                    \includegraphics[width=\linewidth]
                    {example-image-c}
                    \subcaption{\label{fig:c}}
                \end{subfigure}%
                \caption{\subref{fig:a} \ldots \subref{fig:b} \ldots \subref{fig:c}
                \ldots}
                \label{fig:Figure_1}
            \end{figure}
            
            \lipsum[1-2]
        
        \subsection{Subsection2}\label{subsec:Subsection2}
            \lipsum[1-2]
            
            \begin{figure}[tbp]
                \centering
                \begin{subfigure}[b]{0.9\textwidth}
                    \centering
                    \includegraphics[width=\linewidth]
                    {example-image-a}
                    \subcaption{\label{fig:d}}
                \end{subfigure} \\[1ex]
                \begin{subfigure}[b]{0.45\textwidth}
                    \centering
                    \includegraphics[height=5cm]
                    {example-image-b}
                    \subcaption{\label{fig:e}}
                \end{subfigure}%
                \begin{subfigure}[b]{0.45\textwidth}
                    \centering
                    \includegraphics[height=5cm]
                    {example-image-c}
                    \subcaption{\label{fig:f}}
                \end{subfigure}
                \caption{\ldots \subref{fig:d} \ldots \subref{fig:e} \ldots
                \subref{fig:f} \ldots}
                \label{fig:Figure_2}
            \end{figure}
        
        \subsection{SubSection3}\label{subsec:Subsection3}
            \lipsum[1-2]
        
        \paragraph{Paragraph1}\label{par:Paragraph1}
            \lipsum[6-7]
            
            \begin{figure}[tbp]
                \centering
                \begin{subfigure}[b]{0.5\textwidth}
                    \centering
                    \includegraphics[width=\linewidth]
                    {example-image-a}
                    \subcaption{\label{fig:g}}
                \end{subfigure}%
                \begin{subfigure}[b]{0.5\textwidth}
                    \centering
                    \includegraphics[width=\linewidth]
                    {example-image-b}
                    \subcaption{\label{fig:h}}
                \end{subfigure}%
                \caption{\ldots \subref{fig:g} \ldots
                \subref{fig:h} \ldots} 
                \label{fig:Figure_3}
            \end{figure}
            
        \paragraph{Paragraph2}\label{par:Paragraph2}
            \lipsum[8-10]
            
            \begin{figure}[tbp]
                \centering
                \includegraphics[width=0.5\textwidth]
                {example-image-a}
                \caption{\ldots} 
                \label{fig:Figure_4}
            \end{figure}
            
            \lipsum[66]
            
            \begin{figure}[tbp]
                \centering
                \includegraphics[width=0.5\textwidth]
                {example-image-16x10}
                \caption{\ldots} 
                \label{fig:Figure_5}
            \end{figure}
            
            \lipsum[75]
        
        \subsection{SubSection4}\label{subsec:Subsection4}
            \lipsum[10-12]
    \appendix
    \finalBibliography
\end{document}

在第 11 页上,我能够重现间距问题。我只是不确定如何使各节/小节/段落/子段落之间的间距都相同。我确实使图表/表格/算法上方和下方的间距相同。

谢谢你!

在此处输入图片描述

答案1

更新

我使用已发布的简化 MWE 来说明该问题。

从某种意义上说,您正在查看的额外空间是由于浮动而产生的该特定页面的产物。

该类设置所有标题空间。还插入在图形环境(包括表格和方程式)后面3ex使用 留出一个空格\addvspace。当浮动元素被推到页面顶部时,不会添加这个空格。

3ex比基线略大,并且这个额外的空间插入在第2段,他在页面上显示了四行。

MastersDoctoralThesis.sty \AtBeginEnvironment{figure}{\addvspace{\UHeadSpace}}解决方案是改为 \AtBeginEnvironment{figure}{}

之前的间距错误\paragraph

瓦

\AtBeginEnvironment{figure}{}在 MastersDoctoralThesis.sty 中使用。

现在第2段 该页面显示五行。

G

% !TeX TS-program = pdflatex
\documentclass{MastersDoctoralThesis}

\usepackage{showframe} % show the margin

\begin{document}

\section{Section1}  
\subsection{Subsection1}
\lipsum[1-2]

\subsection{Subsection2}
\lipsum[1-2]    

\subsection{SubSection3}\label{subsec:Subsection3}
\lipsum[1]

\paragraph{Paragraph1}
1.  \lipsum[1-2]        

\setlength{\UHeadSpace}{0pt}  % add before \begin{figure} <<<<<<<<<
\begin{figure}[tbp]
    \centering
    \begin{subfigure}[b]{0.5\textwidth}
        \centering
        \includegraphics[width=\linewidth]
        {example-image-a}
        \subcaption{\label{fig:g}}
    \end{subfigure}%
    \begin{subfigure}[b]{0.5\textwidth}
        \centering
        \includegraphics[width=\linewidth]
        {example-image-b}
        \subcaption{\label{fig:h}}
    \end{subfigure}%
    \caption{\ldots \subref{fig:g} \ldots
    \subref{fig:h} \ldots} 
    \label{fig:Figure_3}
    \setlength{\UHeadSpace}{3ex} % add before \end{figure}  <<<<<<<<<<
\end{figure}

\paragraph{Paragraph2}
1.  \lipsum[1]
2   \lipsum[2]

\end{document}

回到已发布的 MWE,使用\AtBeginEnvironment{figure}{}第 11 页,现在显示以下七行段落2且无空间异常。

11

相关内容