调整章节与章节之间、章节与小节之间或小节与小小节之间的间距,且页眉之间没有文字

调整章节与章节之间、章节与小节之间或小节与小小节之间的间距,且页眉之间没有文字

我正在尝试调整标题之间没有文字的\chapter& \section\section&\subsection\subsection&之间的间距,以使副标题之间的间距相同。我需要在所有标题上方留三倍空格 ( ),在所有文本之前留两倍空格 ( )。(这些尺寸也可以是s,它们只需保持一致即可)\subsubsection3ex2ex\baselineskip

在我的类文件中,我用来titlesec完全控制标题。但是,如果不添加负数,我似乎无法获得正确的间距\vspace

\titlespacing{\chapter}
             {0in}
             {1in}
             {3ex}
             [0in]

\titlespacing{\section}
             {0in}
             {3ex}
             {1ex}
             [0in]

\titlespacing{\subsection}
             {0in}
             {3ex}
             {1ex}
             [0in]

\titlespacing{\subsubsection}
             {0in}
             {3ex}
             {0in}
             [0in]

\titlespacing{\paragraph}
             {1em}
             {-0.5\baselineskip}
             {1ex}
             [0in]

\titlespacing{\subparagraph}
             {1em}
             {-0.5\baselineskip}
             {1ex}
             [0in]

\titleformat{\chapter}  % command
    [display]           % shape (Creates new line after the word "CHAPTER ii"
    {\color{red}\centering\normalfont\Large\bfseries\doublespacing} % format
    {\MakeUppercase{\chaptertitlename} \vspace{3ex} \Large\thechapter} % label
    {0in}               % separations (horizontal)
    {\MakeUppercase}    % before
    [\vspace{3ex}]                  % After (leave blank)

\titleformat{\section}  % command
    [hang]           % shape %
    {\centering\singlespacing\normalfont\Large\bfseries} % format
    {\thesection} % label
    {1ex}               % separations (horizontal)
    {}                  % before
    [\vspace{1ex}]                  % After (leave blank)

\titleformat{\subsection}  % command
    [hang]              % shape
    {\centering\singlespacing\normalfont\large\bfseries} % format
    {\thesubsection} % label
    {1ex}               % separations (horizontal)
    {}                  % before
    [\vspace{1ex}]                  % After (leave blank)

\titleformat{\subsubsection}  % command
    [hang]                 % shape
    {\centering\singlespacing\normalfont\normalsize\bfseries} % format
    {\thesubsubsection} % label
    {1ex}               % separations (horizontal)
    {}                  % before
    [\vspace{1ex}]                  % After (leave blank)

\titleformat{\paragraph}  % command
    [runin]                 % shape
    {\centering\singlespacing\normalfont\normalsize\bfseries} % format
    {\theparagraph} % label
    {1ex}               % separations (horizontal)
    {}                  % before
    [\hspace*{1ex}]                  % After (leave blank)

\titleformat{\subparagraph}  % command
    [runin]                 % shape
    {\centering\singlespacing\normalfont\normalsize\bfseries} % format
    {\thesubparagraph} % label
    {1ex}               % separations (horizontal)
    {}                  % before
    [\hspace*{1ex}]                  % After (leave blank)

我想避免的是这样的:


\chapter{\uppercase{Chapter 1}}
    
\vspace{-2ex} % Space between chapter and section with no text (Try to avoid this)

\section{Section 1}

\vspace{-1ex} % Space between section & subsection with no text (Try to avoid this)

\subsection{Subsection 1}

对阵

\chapter{\uppercase{Chapter 1}}
    
\lipsum[66]

\section{Section 1}

\lipsum[66]

\subsection{Subsection 1}

有人知道我可以在哪里进行此调整吗?

答案1

我是这样定义标题间距的(从某处复制并调整到我满意为止),结果是,无论是文本还是章节标题在章节标题上方都无关紧要。但我不想弄乱我的论文,所以请自己尝试是否可以更改加号和减号参数。我在文档中没有找到有关其工作原理的任何解释。

\titleformat{\chapter}[hang]{\Large\bf}{\thechapter{.~}}{0pt}{\Large\bf\lineskiplimit=-\maxdimen}%
\titleformat{\section}[hang]{\bf}{\thesection{.~}}{0pt}{\bf\lineskiplimit=-\maxdimen}%
\titleformat{\subsection}[hang]{\bf}{\thesubsection{.~}}{0pt}{\bf\lineskiplimit=-\maxdimen}%
\titlespacing*{\chapter} {0pt}{1ex plus 3ex minus .2ex}{2ex plus .2ex}%minder ruimte boven en onder hoofdstuktitel
\titlespacing*{\section} {0pt}{3.5ex plus 3ex minus .2ex}{1ex plus .2ex}%minder ruimte boven en onder sectiontitel
\titlespacing*{\subsection} {0pt}{3.5ex plus 3ex minus .2ex}{1ex plus .2ex}%minder ruimte boven en onder sectiontitel

相关内容