章节和章节标题的字体大小

Jan*_*des 1 latex

我试图使标题 CHAPTER 1 居中对齐,章节标题向左对齐。

\titleformat{\chapter}[display]
  {\large\bfseries}{\filcenter\chaptertitlename\ \thechapter}
  {20pt}{\MakeUppercase{#1}}
\titlespacing*{\chapter}
  {0pt}{0pt}{20pt}  %controls vertical margins on title
Run Code Online (Sandbox Code Playgroud)

但是,那么我怎样才能改变字体大小呢?也就是说,例如,我需要比标题“介绍”更小的“第 1 章”。

use*_*724 5

您可以通过在 之前添加命令来更改字体大小#1,如下所示:

\documentclass{book}

\usepackage[explicit]{titlesec}
\titleformat{\chapter}[display]
  {\large\bfseries}{\filcenter\chaptertitlename\ \thechapter}
  {20pt}{\Huge\MakeUppercase{#1}}
\titlespacing*{\chapter}
  {0pt}{0pt}{20pt}  %controls vertical margins on title

\usepackage{lipsum}

\begin{document}

\chapter{Introduction}

\lipsum[1]

\end{document}
Run Code Online (Sandbox Code Playgroud)