如何删除章节和其名称之间的间距?
CHAPTER#
CHAPTER NAME
to
CHAPTER#
CHAPTER NAME
我曾尝试使用
\titleformat{\chapter}[display]{\fontsize{20}{24}\selectfont\bfseries\centering}{CHAPTER \ \thechapter}{-5mm}{}[]
但是,对于会扩展到多行的长标题,间距会不一致。您可以看到第 1 章和长章节之间的间距会导致此问题。我该如何解决这个问题?并使标题的内容接近章节号而不会出现不一致。
这里有一个平均能量损失
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{parskip}
\usepackage{fontspec}
\usepackage{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb} % MATH SYMBOLS
\usepackage{anyfontsize} % Font size
\usepackage{titlesec} % Title format
\usepackage{setspace} % setting stretch
\usepackage{geometry} % Paper margins
\usepackage{fancyhdr} % Fix page numbering
%================================================================
% FONT SETTING
%================================================================
\geometry{a4paper,left=2.54cm,right=2.54cm,top=2.54cm,bottom=2.54cm}
\setstretch{1.15}
\setlength{\parindent}{0em}
\setlength{\parskip}{8pt}
\linespread{1.08}
\renewcommand{\baselinestretch}{1.08}
\setmainfont{Times New Roman}
%================================================================
% TITLE SETTING
%================================================================
\titleformat{\chapter}[display]{\fontsize{20}{24}\selectfont\bfseries\centering}{CHAPTER \
\thechapter}{-5mm}{}[]
\titleformat{\section}
{\fontsize{14}{16.8}\selectfont\bf}
{\thesection.}{0.5em}{}
\titleformat{\subsection}
{\fontsize{13}{18.2}\bf}
{\thesubsection.}{0.5em}{}
\titlespacing{\section}{0in}{12pt}{8pt}
\titlespacing{\chapter}{0cm}{0cm}{0cm}
\titlespacing{\subsection}{0in}{12pt}{8pt}
%================================================================
% NAMES IN title/names_super
%================================================================
\begin{document}
\chapter{LONG CHAPTER THAT WILL CAUSE THIS ISSUE}
\end{document}
答案1
您觉得错误的垂直间距实际上是正确的。错误的是“CHAPTER 1”后面的间距。这部分是由于您的定义,\chapter
部分是由于包的使用parskip
(或重新定义\parskip
为 8pt)。
我使用了fontsize
包来更改正常大小和行距。fontspec
但是,通过使用 ,您也可以采取不同的操作。
下面是一个 mwe:
\documentclass[12pt,a4paper]{report}
\usepackage[skip=8pt]{parskip}
\usepackage{titlesec} % Title format
\usepackage{geometry} % Paper margins
\geometry{a4paper,left=2.54cm,right=2.54cm,top=2.54cm,bottom=2.54cm}
\usepackage{fontspec}
\setmainfont{Times New Roman}
%================================================================
% FONT SETTING
%================================================================
\usepackage{fontsize}
\changefontsize[16.2]{12}
%================================================================
% TITLE SETTING
%================================================================
\titleformat{\chapter}[display]{%
\parskip=0pt
\fontsize{20}{24}\selectfont\bfseries\centering}{CHAPTER \
\thechapter}
{0mm}
{}
\titleformat{\section}
{\fontsize{14}{16.8}\selectfont\bf}
{\thesection.}
{0.5em}
{}
\titleformat{\subsection}
{\fontsize{13}{18.2}\bf}
{\thesubsection.}
{0.5em}
{}
\titlespacing{\section}{0in}{12pt}{8pt}
\titlespacing{\chapter}{0cm}{0cm}{0cm}
\titlespacing{\subsection}{0in}{12pt}{8pt}
%================================================================
% NAMES IN title/names_super
%================================================================
\usepackage{lipsum}
\begin{document}
\chapter{LONG CHAPTER THAT WILL CAUSE THIS ISSUE}
\lipsum
\end{document}