自訂章節樣式和標題

自訂章節樣式和標題

我正在使用回憶錄。透過這些基本設定:

\makechapterstyle{chappell2}{%
\setlength{\beforechapskip}{-15pt}
\renewcommand*{\chapnamefont}{\large}

\renewcommand*{\printchapternum}{\chapnumfont \Large \thechapter }
\renewcommand*{\chaptitlefont}{\Large\bfseries}
\renewcommand*{\printchaptertitle}[1]{%
%\vskip\onelineskip 
\chaptitlefont ##1}}

\makechapterstyle{mystyle}{%
    \chapterstyle{default}
    \renewcommand{\printchaptername}{}
    \renewcommand{\chapternamenum}{}
    \renewcommand{\chapnumfont}{\normalfont\bfseries}
    \renewcommand{\printchapternum}{}%\chapnumfont \thechapter\space}
    \renewcommand{\afterchapternum}{}
    \renewcommand*{\printchapternum}{%
    \@hangfrom{\chapnumfont \thechapter\quad}}%
}
%\nouppercaseheads

\chapterstyle{chappell2}
\renewcommand\thechapter{Capitolo \arabic{chapter}}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}}

我明白了:

在此輸入影像描述

在此輸入影像描述

我只想在標題中列印“Capitolo 2”。我該怎麼做?抱歉,我不是乳膠專家...

答案1

您沒有提供必須從\documentclass...到 開始的可編譯範例\end{document}。當我添加必要的程式碼時,您提供的內容並未產生您在圖形中顯示的內容。

我已經盡力了,我認為這可能適合你。

\documentclass{memoir}
\usepackage{lipsum}

\renewcommand{\chaptername}{Capitolo}  % change chapter name
\renewcommand{\chapterrefname}{Capitolo} % change chapter reference name  
\makechapterstyle{chappell2}{%
\setlength{\beforechapskip}{-15pt}
%\renewcommand*{\chapnamefont}{\large}
\renewcommand*{\chapnamefont}{\Large\bfseries} % to match the chapter number

\renewcommand*{\printchapternum}{\chapnumfont \Large \thechapter }
\renewcommand*{\chaptitlefont}{\Large\bfseries}
\renewcommand*{\printchaptertitle}[1]{%
%\vskip\onelineskip 
\chaptitlefont ##1}}

%\nouppercaseheads

\chapterstyle{chappell2}
%\renewcommand\thechapter{Capitolo \arabic{chapter}}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}}

\begin{document}

\frontmatter
\tableofcontents
\mainmatter
\chapter{INFORMAZIONI}
\lipsum[1]
\section{First section}
\lipsum
\chapter{ANOTHER}
\lipsum[2]
\end{document}

您定義了mystyle章節樣式但未使用它。為什麼?

相關內容