对于无编号章节,减少章节标题上方的空白,并减少标题和文本之间的空间

对于无编号章节,减少章节标题上方的空白,并减少标题和文本之间的空间

如何减少章节标题上方的空白?

如何减少标题和文本之间的间距?

我希望能够仅对选定的章节执行此操作,或者在给定章节之后执行此操作(我希望从简介章节开始向外有正常间距,但在此之前我希望减少间距)。

梅威瑟:

\documentclass[b5paper, 11pt, twoside, openright]{report}
\usepackage{titlesec}
\begin{document}
\chapter*{Abstract}
This chapter should have less spacing
\chapter*{Preface}
This chapter should have less spacing
\tableofcontents %Less spacing
\listoffigures %Less spacing
\listoftables %Less spacing
\chapter*{Glossary}
Less spacing
\chapter{Introduction}
From this chapter, I want normal spacing
\end{document}

答案1

这个答案直接修改了report.cls格式化未编号章节标题的命令。

\documentclass[b5paper, 11pt, twoside, openright]{report}
\usepackage{titlesec}
\makeatletter
\renewcommand{\@makeschapterhead}[1]{%
%  \vspace*{50\p@}%
  \vspace*{20\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
%    \vskip 40\p@
    \vskip 20\p@
  }}
\makeatother

\begin{document}
\chapter*{Abstract}
This chapter should have less spacing
\chapter*{Preface}
This chapter should have less spacing
\tableofcontents %Less spacing
\listoffigures %Less spacing
\listoftables %Less spacing
\chapter*{Glossary}
Less spacing
\chapter{Introduction}
From this chapter, I want normal spacing
\end{document}

答案2

titlesec支持编号和未编号章节的不同间距:

\documentclass[b5paper, 11pt]{report}

%%% Add this %%%
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename~\thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{50pt}{40pt}
\titlespacing*{name=\chapter,numberless}{0pt}{-30pt}{10pt}
%%%   End   %%%


\begin{document}
\chapter*{Abstract}
This chapter should have less spacing
\chapter*{Preface}
This chapter should have less spacing
\tableofcontents %Less spacing
\listoffigures %Less spacing
\listoftables %Less spacing
\chapter*{Glossary}
Less spacing
\chapter{Introduction}
From this chapter, I want normal spacing
\end{document}

相关内容