如何将章节编号放在章节标题上方?

如何将章节编号放在章节标题上方?

默认的样子是这样的:

第1章

章节标题

我希望它看起来像这样(但居中):

1

章节标题

此外:

  1. 章节号应加粗、大
  2. 章节标题应为普通文本,大号,大写。
  3. 我希望能够控制章节号与页面顶部、章节号与章节标题以及章节标题与正文之间的间距。

谢谢!

编辑。以下是一些 MWE:

这是默认的。它根本不能满足我的要求:

\documentclass[]{report}
\begin{document}
\chapter{Vector Spaces}
\end{document}

这个比较接近,但是章节标题上方没有章节号:

\documentclass{report}
\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}%
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \Large\centering \thechapter \quad #1\par\nobreak
    \vskip 2.5em
}}
\makeatother

\begin{document}
\chapter{VECTOR SPACES}
\end{document}

这个也没有内置大写字体。我不得不自己把字母大写,这不是什么大问题,但我还是希望修复它。

答案1

这里的简单选择是重新定义\@chapapp以吞噬其参数:

在此处输入图片描述

\documentclass{report}

\makeatletter
\let\@chapapp\@gobble
\makeatother

\begin{document}
\chapter{Vector Spaces}
\end{document}

为什么这样做有效?看看\@makechapterhead(来自report.cls):

\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}

\@chapapp后面总是跟有\space。因此,将其重新定义为\@gobble只会吸收\space


根据您的\@makechapterhead规范,这里有一些修改:

在此处输入图片描述

\documentclass{report}

\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-5em}% Space above number
    {\parindent \z@  \normalfont
    \interlinepenalty\@M
    \Large\centering \textbf{\thechapter}%
    \par\vspace{1em}% Space between number and title
    \MakeUppercase{#1}%
    \par\vspace{2.5em}% Space between title and text
}}
\makeatother

\begin{document}
\chapter{Vector Spaces}
\end{document}

答案2

titlesec

\documentclass{report}
\usepackage[explicit]{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\filcenter}
{\LARGE\bfseries\thechapter}
{20pt}
{\Huge\MakeUppercase{#1}}

\titleformat{name=\chapter,numberless}[display]
{\normalfont\huge\bfseries\filcenter}
{}
{20pt}
{\Huge\MakeUppercase{#1}}

\titlespacing*{\chapter}{0pt}{50pt}{40pt}
\titlespacing*{\chapter}{0pt}{50pt}{40pt}
\usepackage{showframe}
\begin{document}
\chapter{Vector Spaces}
Some text here.
\chapter*{Vector Spaces}
Some text here.
\end{document}

在此处输入图片描述

答案3

好的,加载此 en 序言

\documentclass[12pt]{book}
.
.
.
.
\usepackage{titlesec}

\titleformat{\chapter}[display] % 
{\bfseries\Huge} %
{% Chapter label 

\filright 
%\Large\chaptertitlename\ % Name of Current chapter
\textbf{\Large\thechapter} % number of current chap 
} 
{0mm} % space between number of chapter and its name
{\filright} 
[\vspace{-1mm}\vspace{2pt}
]

\begin{doucument}

相关内容