章节编号和名称以斜体显示

章节编号和名称以斜体显示

请注意,我“继承”了我想改编的序言:

\documentclass[a4paper,12pt]{book}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.1pt} % for upper line
\renewcommand{\footrulewidth}{0.1pt} % for lower line
\fancyhead[LE,RO]{\itshape \nouppercase \rightmark}
\fancyhead[LO,RE]{\itshape \nouppercase \leftmark}
\fancyfoot[C]{\thepage}

\usepackage{fancybox}

\usepackage{xcolor}
\usepackage{framed}

\numberwithin{equation}{section} % numbering according to the section
\bibliographystyle{plain} %Choose a bibliograhpic style

\setlength{\headheight}{15pt}

%\parindent0em
\parskip1ex

有了上述序言,每当我创建新章节,即 时\section{My Section},章节编号和文本My Section都会定期显示。为了使文本变成斜体,我将其放入\textit{My Section}。但是,这种方式不会使章节编号变成斜体。我应该如何更改才能使章节编号和名称始终为斜体?

答案1

将以下内容添加到您的序言中:

\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
%                                   {\normalfont\Large\bfseries}}% DELETED
                                   {\normalfont\Large\bfseries\itshape}}% ADDED
\makeatother

相关内容