幫助更改章節標題格式

幫助更改章節標題格式

我正在嘗試使用 titlesec 套件來格式化章節標題。我定義了一個宏,它為我提供了我想要的格式,但在嘗試使用 titlesec 複製格式時,我似乎無法獲得正確的間距。

氣象局:

\documentclass[letterpaper]{book}
\usepackage{titlesec}
\usepackage{lipsum}

\setlipsumdefault{1}
\newcommand{\chapterpretitle}{}

\titleformat{\chapter}[display]
{\large\scshape\filcenter}{\chapterpretitle}{0pt}{\Huge\bfseries}
\titlespacing{\chapter}{0pt}{0pt}{0pt}

\newcommand{\ctitle}[2][\*]{%
  \renewcommand{\chapterpretitle}{#1}
  \chapter{#2}}

\newcommand{\ctitleTwo}[2][The Chapter]{
  \begin{center}
    {\scshape\large #1,\\
      called\\
      \Huge\bfseries #2.}
    \end{center}\par}


\begin{document}
\ctitle[The Chapter\\called,]{Chapter One}
\lipsum

\ctitleTwo{Chapter One}

\lipsum

\end{document}

我希望第一章標題格式與最後一個章節標題格式相符。這對我來說是這樣的:

預期結果

實際結果

非常感謝任何幫助,謝謝。

答案1

\titleformat{\chapter}[display]
{\large\scshape\filcenter}{\chapterpretitle}{-12pt}{\Huge\bfseries}
\titlespacing{\chapter}{0pt}{0pt}{5pt}

\newcommand{\ctitle}[2][\*]{%
  \renewcommand{\chapterpretitle}{#1}
  \chapter{#2.}}

相關內容